nils-ost/TMNF-TimeAttackServer

Players Name with space (like: "Max Power") break website

Closed this issue · 3 comments

Hi, this software is wonderful!
I ran into a problem: player names with spaces break the website:

When "Max Power" joins into dedicated server, he is not displayed on the wallboard page. No players joining after "Max Power" are displayed on the wallboard page. The only way to fix this is to restart the entire Stack.

i think it is a "player id" problem.

gionko/10.150.0.30 <--- is OK.
max power/10.150.0.15 <--- it's bad!
max.power/10.150.0.64 <--- is OK.

The dedicated server continues to run, including the map change, but no data is collected on the website anymore.
The website continues to work, you can browse, but the "Challenge Schedule" is no longer synchronized with the dedicated server, and no data is updated anymore.

TMNF-TimeAttackServer: v1.1.0 --> /var/log/tmnf-tas.log

Nov 10 19:17:34 tm-server tmnf-tas[31281]: gionko/10.139.0.50:2350 connected
Nov 10 19:17:34 tm-server tmnf-tas[31281]: gionko/10.139.0.50:2350 disconnected
Nov 10 19:17:34 tm-server tmnf-tas[31281]: max.power/10.139.0.50:2350 connected
Nov 10 19:17:34 tm-server tmnf-tas[31281]: max.power/10.139.0.50:2350 drove: 57.06
Nov 10 19:17:34 tm-server tmnf-tas[31281]: Providing Replay: ef6ad66fa99f67aa298f0091004fa13c_1668107746
Nov 10 19:17:34 tm-server tmnf-tas[31281]: max.power/10.139.0.50:2350 disconnected
Nov 10 19:17:34 tm-server tmnf-tas[31281]: max power/10.139.0.50:2350 connected
Nov 10 19:17:34 tm-server tmnf-tas[31281]: Process Process-1:2:
Nov 10 19:17:34 tm-server tmnf-tas[31281]: Traceback (most recent call last):
Nov 10 19:17:34 tm-server tmnf-tas[31281]:   File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
Nov 10 19:17:34 tm-server tmnf-tas[31281]:     self.run()
Nov 10 19:17:34 tm-server tmnf-tas[31281]:   File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
Nov 10 19:17:34 tm-server tmnf-tas[31281]:     self._target(*self._args, **self._kwargs)
Nov 10 19:17:34 tm-server tmnf-tas[31281]:   File "/opt/middleware/tmnf-tas/helpers/tmnfd.py", line 172, in worker_function
Nov 10 19:17:34 tm-server tmnf-tas[31281]:     sendLaptimeNotice(sender, params[0])
Nov 10 19:17:34 tm-server tmnf-tas[31281]:   File "/opt/middleware/tmnf-tas/helpers/tmnfd.py", line 102, in sendLaptimeNotice
Nov 10 19:17:34 tm-server tmnf-tas[31281]:     sender.callMethod('SendNoticeToLogin', player_login, msg, '', 20)
Nov 10 19:17:34 tm-server tmnf-tas[31281]:   File "<string>", line 2, in callMethod
Nov 10 19:17:34 tm-server tmnf-tas[31281]:   File "/usr/lib/python3.8/multiprocessing/managers.py", line 835, in _callmethod
Nov 10 19:17:34 tm-server tmnf-tas[31281]:     kind, result = conn.recv()
Nov 10 19:17:34 tm-server tmnf-tas[31281]:   File "/usr/lib/python3.8/multiprocessing/connection.py", line 251, in recv
Nov 10 19:17:34 tm-server tmnf-tas[31281]:     return _ForkingPickler.loads(buf.getbuffer())
Nov 10 19:17:34 tm-server tmnf-tas[31281]: TypeError: __init__() missing 2 required positional arguments: 'faultCode' and 'faultString'

Tnx for your time :)

hah thanks for the discovery of this bug, I in fact never tested names with whitespaces. I'm going to take a look at this in the next few days.
And by the way thanks for using TMNF-TAS it's nice to see others interested in this project ;)

[OT]
I am very happy with your quick reply!
I'm a LanParty Admin (Frogbyte LanParty Italy www.frogbyte.it). I specialize in high performance networks.

https://www.drcommodore.it/2019/03/12/frogbyte-2019-torna-la-piu-grande-lan-party-italiana/
https://www.thegamesmachine.it/wp-content/uploads/2017/02/frogbyte-news.jpg
https://www.youtube.com/watch?v=wz_Gen4Kw1M&ab_channel=FrogbyteLANParty

Your software is great, it was just what I was looking for for the Trackmania tournament. I usually have a pool of 300+ players. At the end of November there will be a small LanParty of about 50 players where I will betatest your masterpiece.
[/OT]

In the meantime, I have found a possible workaround:

If you disable function sendLaptimeNotice in tmnfd.py at line 102 replace sender.callMethod('SendNoticeToLogin', player_login, msg, '', 20) with msg = None, you don't have messages in game like "You don't have a PB on this Challenge yet" but now name with space works, i have tested this name:

Tojo de Muja
Gionko
|Yure| Mr. C@raTTéri \Strani/

Now everything seems to work, except for the in-game messages.

tmnf-bug-gionko

[OT]
Nice to you like to give this project a chance, would really like to get a feedback afterwards ;)

I my-self, already tested it on the NLPT2022 event, 40 players LAN-Party not all of them participated on the TMNF Tournament, but the most of them. And it worked as expected :) just some convenience stuff I like to address in the future...
[/OT]

Regarding your issue, I've already sorted out that the SendNoticeToLogin call is in fakt the problem, it seems that this build-in method of the dedicated server is not capable of handling whitespaces.
But there is the SendNoticeToId call that does the same but using the internal unique player-session-id instead of the playerLogin. This one does work with playerLogins containing whitespaces as I tested. Luckily I already store this Id everytime a player logs into the server. So I just need to rewrite a bit of code to use SendNoticeToId
With some luck I have some time tomorrow to push this hotfix out for you ;)