-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultiServer: allow underscore as space replacement #3283
base: main
Are you sure you want to change the base?
Conversation
Will this break if a user has an actual underscore in their name? What about if there are 2 players: test_potato and test potato ? |
I think I would be fine with not allowing two players to have the same name where the only difference is one has an underscore where the other has a space |
This is already addressed, you cannot have this. |
case-sensitive-only overlapping usernames have been disallowed for a long time now.
You think this is better than trying to fix clients and command parsing to properly allow both spaces and underscores everywhere? Encapsulating string with spaces in I won't block this, but I'll let the community decide (i.e. wait for enough peer review approvals before I hit approve). |
This is a relatively simple and easy change we can do now, a proper command parser that understands " everywhere I'd say is still desirable and may eventually replace this. |
|
||
p = ServerCommandProcessor(Context("", 0, "", "", 0, 0, False)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note sure if you want to fix this, but this should probably be a separate test for readability.
@@ -210,7 +210,7 @@ def main(args=None, callback=ERmain): | |||
else: | |||
raise RuntimeError(f'No weights specified for player {player}') | |||
|
|||
if len(set(name.lower() for name in erargs.name.values())) != len(erargs.name): | |||
if len(set(name.lower().replace("_", " ") for name in erargs.name.values())) != len(erargs.name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it would be cheaper to do " " -> "_"
rather than "_" -> " "
because during runtime we will see more "_"
than " "
, but it shouldn't matter much.
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
What is this fixing or adding?
requests such as https://discord.com/channels/731205301247803413/1238036062346149909
How was this tested?
with a few commands, such as