Handle padded BB room names for crossplay opt-in
This commit is contained in:
+20
-6
@@ -4946,12 +4946,26 @@ static bool game_name_enables_full_crossplay(const string& name, Version creator
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// BB room names appear here with an 8-space + "E" prefix before the user-visible room name.
|
// BB room names appear here with leading padding and an episode marker before
|
||||||
// Example: a BB room entered as "x asdf" is decoded here as " Ex asdf".
|
// the user-visible room name. For example, a BB room entered as "x asdf" has
|
||||||
if ((creator_version == Version::BB_V4) &&
|
// been observed as " Ex asdf". Skip the padding and accept either:
|
||||||
(name.size() >= 10) &&
|
// x...
|
||||||
(name.compare(0, 9, " E") == 0)) {
|
// Ex...
|
||||||
return (name[9] == 'x') || (name[9] == 'X');
|
if (creator_version == Version::BB_V4) {
|
||||||
|
size_t offset = 0;
|
||||||
|
while ((offset < name.size()) && (name[offset] == ' ')) {
|
||||||
|
offset++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((offset < name.size()) && ((name[offset] == 'x') || (name[offset] == 'X'))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((offset + 1 < name.size()) &&
|
||||||
|
((name[offset] == 'E') || (name[offset] == 'e')) &&
|
||||||
|
((name[offset + 1] == 'x') || (name[offset + 1] == 'X'))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user