Pull specific info from a newly changed userinfo string into a more C freindly form.
(client_t cl)
| 776 | * freindly form. |
| 777 | */ |
| 778 | static void SV_UserinfoChanged(client_t cl) { |
| 779 | // call prog code to allow overrides |
| 780 | games.get(cl.gameName).gameExports.ClientUserinfoChanged(cl.edict, cl.userinfo); |
| 781 | |
| 782 | // name for C code |
| 783 | cl.name = Info.Info_ValueForKey(cl.userinfo, "name"); |
| 784 | |
| 785 | // mask off high bit |
| 786 | //TODO: masking for german umlaute |
| 787 | //for (i=0 ; i<sizeof(cl.name) ; i++) |
| 788 | // cl.name[i] &= 127; |
| 789 | |
| 790 | // rate command |
| 791 | String val = Info.Info_ValueForKey(cl.userinfo, "rate"); |
| 792 | if (val.length() > 0) { |
| 793 | cl.rate = Lib.atoi(val); |
| 794 | if (cl.rate < 100) |
| 795 | cl.rate = 100; |
| 796 | if (cl.rate > 15000) |
| 797 | cl.rate = 15000; |
| 798 | } else |
| 799 | cl.rate = 5000; |
| 800 | |
| 801 | // msg command |
| 802 | val = Info.Info_ValueForKey(cl.userinfo, "msg"); |
| 803 | if (val.length() > 0) { |
| 804 | cl.messagelevel = Lib.atoi(val); |
| 805 | } |
| 806 | |
| 807 | } |
| 808 | |
| 809 | private static void SV_ExecuteUserCommand(client_t cl, String command) { |
| 810 |
no test coverage detected