spring / uberserver

uberserver, a matchmaking/chat lobby server for the spring rts project
https://springrts.com/wiki/Uberserver
Other
33 stars 38 forks source link

MySQL mode incorrect 'b' char added on login username #381

Closed JackCarterSmith closed 3 years ago

JackCarterSmith commented 3 years ago

Hi,

I've got some troubles with mysql configuration, I registered a new user 'NEXUS' in the DB with no problem. But when I'm trying to login, I've got a fail with an invalid username send:

'b'NEXUS

Why a 'b' is detected in the username variable?

This problem doesn't appear on sqlite mode however.

2020-11-06 09:58:42 INFO SQLUsers.audit_access:701 removing 0 botflags from inactive hosts 2020-11-06 09:58:42 INFO SQLUsers.audit_access:707 removing 0 inactive admins 2020-11-06 09:58:42 INFO SQLUsers.audit_access:711 removing 0 inactive mods 2020-11-06 09:58:42 INFO SQLUsers.clean:677 deleting 0 users who failed to verify registration 2020-11-06 09:58:42 INFO SQLUsers.clean:682 deleting 0 inactive users with no ingame time 2020-11-06 09:58:42 INFO SQLUsers.clean:687 deleting 0 very inactive users 2020-11-06 09:58:42 INFO SQLUsers.clean:692 deleting 0 channel history messages 2020-11-06 09:58:42 INFO SQLUsers.clean:885 deleting 0 inactive bridged users 2020-11-06 09:58:42 INFO SQLUsers.clean:1453 deleting 0 expired channel mutes 2020-11-06 09:58:42 INFO SQLUsers.clean:1457 deleting 0 expired channel bans 2020-11-06 09:58:42 INFO SQLUsers.clean:1461 deleting 0 expired channel bridged bans 2020-11-06 09:58:42 INFO SQLUsers.clean:1465 deleting 0 inactive channels 2020-11-06 09:58:42 INFO SQLUsers.clean:1211 deleting 0 expired verifications 2020-11-06 09:58:42 INFO SQLUsers.clean:1054 deleting 0 expired bans 2020-11-06 09:58:42 INFO DataHandler.scheduled_clean:273 scheduled clean finished 2020-11-06 09:58:48 INFO Protocol._new:281 [1] Client connected from 91.173.124.210:29416 2020-11-06 09:58:48 INFO Protocol.out_DENIED:3224 [1] Failed to log in user : Invalid username -- did you mean 'b'NEXUS'' 2020-11-06 09:58:48 INFO Protocol._remove:286 [1] disconnected from 91.173.124.210: Connection to the other side was lost in a non-clean fashion: Connection lost.

abma commented 3 years ago

did you register with a different case?

https://github.com/spring/uberserver/blob/master/SQLUsers.py#L522

also you could try to add ?charset=utf8 to the sql url. "b" means binary: for some reason the encoding is not correctly set.

JackCarterSmith commented 3 years ago

The database is in utf8_general_ci mode, this is good?

In the users table, all infos is correct: image

I launched the server with ?charset=utf8&use_unicode=0 parameters

abma commented 3 years ago

remove &use_unicode=0, thats very likely the problem.

JackCarterSmith commented 3 years ago

Problem solved! Thanks.

I think the "use_unicode=0" can be deleted from the exemple in the help part of the script.

abma commented 3 years ago

thanks for the feedback + fixed:

https://github.com/spring/uberserver/commit/cc4155c3b45e8189100d9dd9097a9aa04c0eb3ec