I've found another interesting fact about userinfo cvars that can dramatically improve this mod if I (or someone experienced enough) have time to modify it.
Any cvar present in userinfo string sent by player every while can be removed from userinfo using this simple trick:
stufftext "set test \\"
On client side, mohaa prints to console:
Code:
Can't use keys or values with a \
This is due to game behavior and network protocol and the nature of the userinfo string.
The code responsible for it can be found at https://github.com/openmoh/openmohaa...shared.c#L1807
I've tried ';' and '\"' but it wont pass to the client.
so, instead of making all the cvars inside userinfo, we can check each cvar individually, then clear it.
This will also overcome the userinfo max length reach issue as explained by Zappa.
Simple example:
$player stufftext "setu test test"
wait 1
iprintln ($player[1].userinfo);
//userinfo:
//\rate\30000\name\RyBack\dm_playergermanmodel\german_wehrmacht_officer\dm_playermodel\allied_sas\snaps\20\test\test
wait 5
$player stufftext "set test \\"
wait 1
iprintln ($player[1].userinfo);
//userinfo:
//\rate\30000\name\RyBack\dm_playergermanmodel\german_wehrmacht_officer\dm_playermodel\allied_sas\snaps\20
So by tweaking above code, we can check for each cvar indvidually.
Max userinfo length limit:
To overcome this issue, we can scan player's current user info. If scanned userinfo doesn't contain wanted cvars, we try to remove cvars from player one by one until our wanted cvar is found.
Note 1: The following cvars should NEVER be removed by the script:
Code:
\rate\30000\name\RyBack\dm_playergermanmodel\german_wehrmacht_officer\dm_playermodel\allied_sas\snaps\20
Note 2:
When player connects, user info is usually different (larger) at first, then it gets reduced to the cvars mentioned in note 1 + extra cvars set by "setu".
example:
Code:
\ip\192.168.56.1:12204\challenge\1603275915\qport\19763\protocol\8\rate\30000\name\RyBack\dm_playergermanmodel\german_wehrmacht_officer\dm_playermodel\allied_sas\snaps\20
basically it contains extra info that are not all cvars, which are marked bold-italic in above example.