Recognize BB x-prefixed crossplay rooms
This commit is contained in:
+15
-3
@@ -4941,8 +4941,20 @@ static uint16_t safe_default_compatibility_group_for_version(Version v) {
|
|||||||
return groups.at(static_cast<size_t>(v));
|
return groups.at(static_cast<size_t>(v));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool game_name_enables_full_crossplay(const string& name) {
|
static bool game_name_enables_full_crossplay(const string& name, Version creator_version) {
|
||||||
return !name.empty() && ((name[0] == 'x') || (name[0] == 'X'));
|
if (!name.empty() && ((name[0] == 'x') || (name[0] == 'X'))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// BB room names appear here with an 8-space + "E" prefix before the user-visible room name.
|
||||||
|
// Example: a BB room entered as "x asdf" is decoded here as " Ex asdf".
|
||||||
|
if ((creator_version == Version::BB_V4) &&
|
||||||
|
(name.size() >= 10) &&
|
||||||
|
(name.compare(0, 9, " E") == 0)) {
|
||||||
|
return (name[9] == 'x') || (name[9] == 'X');
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr<Lobby> create_game_generic(
|
shared_ptr<Lobby> create_game_generic(
|
||||||
@@ -4985,7 +4997,7 @@ shared_ptr<Lobby> create_game_generic(
|
|||||||
game->episode = episode;
|
game->episode = episode;
|
||||||
game->mode = mode;
|
game->mode = mode;
|
||||||
game->difficulty = difficulty;
|
game->difficulty = difficulty;
|
||||||
bool full_crossplay_enabled = game_name_enables_full_crossplay(name);
|
bool full_crossplay_enabled = game_name_enables_full_crossplay(name, creator_c->version());
|
||||||
if (full_crossplay_enabled) {
|
if (full_crossplay_enabled) {
|
||||||
game->allowed_versions = s->compatibility_groups.at(static_cast<size_t>(creator_c->version()));
|
game->allowed_versions = s->compatibility_groups.at(static_cast<size_t>(creator_c->version()));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user