MCPcopy Create free account
hub / github.com/demoth/jake2 / SV_UserinfoChanged

Method SV_UserinfoChanged

server/src/main/java/jake2/server/SV_MAIN.java:778–807  ·  view source on GitHub ↗

Pull specific info from a newly changed userinfo string into a more C freindly form.

(client_t cl)

Source from the content-addressed store, hash-verified

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

Callers 2

gotnewclMethod · 0.95

Calls 4

Info_ValueForKeyMethod · 0.95
atoiMethod · 0.95
ClientUserinfoChangedMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected