Sanae6 / SmoOnlineServer

Official server for Super Mario Odyssey: Online
https://discord.gg/jYCueK2BqD
103 stars 24 forks source link

added !* variants for ban, crash, rejoin, autocomplete for usernames if not ambiguous #18

Closed TheUbMunster closed 1 year ago

TheUbMunster commented 1 year ago

Eg. if users "Moo", "Moomoss", "mo", "Bar", "Foo" are connected, guid's in order are 00...000, 00...001, 00...002, 00...003, 00...004,

ban !* mo Banned: "Moo", "Moomoss", "Bar", "Foo"

ban !* mo isn't ambiguous because argument "mo" is an exact match for user "mo"

ban !* Mo Banned: "Bar", "Foo" Ambiguous for "Mo": "Moo", "Moomoss", "mo"

It tries to find exact match, but it cant so it finds case-insensitive matches and three are found (ambiguous), so none of the ambiguous users are banned

ban !* baz Banned: "Moo", "Moomoss", "mo", "Bar", "Foo" Failed to find matches for: "baz"

since no user exists with the name baz, it bans everyone except baz (which is everyone)

ban !* mo baz Banned: "Moo", "Moomoss", "Bar", "Foo" Failed to find matches for: "baz"

since it found "mo", it banned everyone except mo, and it couldn't find baz.

ban * still bans everyone

ban mo Banned: "mo"

found an exact match for "mo" so it banned "mo"

ban Mo Ambiguous for "Mo": "Moo", "Moomoss", "mo"

since it didn't find an exact match for "Mo" it tried case-insensitive/autocomplete, and it got ambiguous users (no action taken).

ban 00000000000000000000000000000004 mo Banned: "Foo", "mo"

banned mo from "mo", "Foo" from guid

ban !* 00000000000000000000000000000002 Banned: "Moo", "Moomoss", "Bar", "Foo"

banned everyone except mo (with guid 00...002)

TheUbMunster commented 1 year ago

pending additional testing

TheUbMunster commented 1 year ago

fix image

should be fixed, pending further testing