osuAkatsuki / bancho.py

An osu! server for the generic public, optimized for maintainability in modern python
https://akatsuki.gg
MIT License
217 stars 131 forks source link

bug: Scores aren't submitted for players with space at the end of the nickname. #429

Closed hzswdef closed 1 year ago

hzswdef commented 1 year ago

Describe the bug

The score will not submit if the player has space at the end of the nickname, probably issue may cause in other similar cases, but didn't test yet.

To Reproduce

  1. -

Expected behavior

Submit score.

bancho.py Version

4.7.2

Python Version

3.9.X (Default)

Relevant log output

No response

Additional context

No response

minisbett commented 1 year ago

How did you even manage to create an account with such an invalid name

hzswdef commented 1 year ago

w8, im stupid, i didn't think that might a guweb issue./ 2am, im sorry

hzswdef commented 1 year ago

How did you even manage to create an account with such an invalid name

Anyway, that's possible through the osu! client.

image

g1-1-1 commented 1 year ago

How did you even manage to create an account with such an invalid name

regardless of username it still shouldn't produce this issue during score submission

@hzswdef is there any relevant logs you can post now or attach to the original post? usually when a score fails to submit it will produce an potentially useful error in your console

tsunyoku commented 1 year ago

this is a weird one to fix - the reason this happens is because osu will append a space to the end of the username on score submission if the client believes the user has supporter privileges (used to catch really shitty supporter cheats) and as bancho.py provides osu!direct to all, every user has these client privileges.

bancho.py trims the trailing space from the username in order to make the name searchable, hence why this occurs. not too sure how we could have both supported, if it’s even worth doing; the first and last character of a username being a space should be (and i believe already is) forbidden

tsunyoku commented 1 year ago

oh actually, upon reading i think i have a simple fix. give me like 10 minutes.

minisbett commented 1 year ago

the first and last character of a username being a space should be (and i believe already is) forbidden

I thought so too, that's why I don't get why is error exists

minisbett commented 1 year ago

https://github.com/osuAkatsuki/bancho.py/blob/master/app/api/domains/osu.py#L1849 There does not seem to be any check for that