Exemplo n.º 1
0
        public static void SV_UserinfoChanged(client_t cl)
        {
            String val;
            Int32  i;

            PlayerClient.ClientUserinfoChanged(cl.edict, cl.userinfo);
            cl.name = Info.Info_ValueForKey(cl.userinfo, "name");
            val     = Info.Info_ValueForKey(cl.userinfo, "rate");
            if (val.Length > 0)
            {
                i       = Lib.Atoi(val);
                cl.rate = i;
                if (cl.rate < 100)
                {
                    cl.rate = 100;
                }
                if (cl.rate > 15000)
                {
                    cl.rate = 15000;
                }
            }
            else
            {
                cl.rate = 5000;
            }
            val = Info.Info_ValueForKey(cl.userinfo, "msg");
            if (val.Length > 0)
            {
                cl.messagelevel = Lib.Atoi(val);
            }
        }
Exemplo n.º 2
0
        /**
         * Pull specific info from a newly changed userinfo string into a more C
         * freindly form.
         */
        public static void SV_UserinfoChanged(client_t cl)
        {
            string val;
            int    i;

            // call prog code to allow overrides
            PlayerClient.ClientUserinfoChanged(cl.edict, cl.userinfo);

            // name for C code
            cl.name = Info.Info_ValueForKey(cl.userinfo, "name");

            // mask off high bit
            //TODO: masking for german umlaute
            //for (i=0 ; i<sizeof(cl.name) ; i++)
            //	cl.name[i] &= 127;

            // rate command
            val = Info.Info_ValueForKey(cl.userinfo, "rate");

            if (val.Length > 0)
            {
                i       = Lib.atoi(val);
                cl.rate = i;

                if (cl.rate < 100)
                {
                    cl.rate = 100;
                }

                if (cl.rate > 15000)
                {
                    cl.rate = 15000;
                }
            }
            else
            {
                cl.rate = 5000;
            }

            // msg command
            val = Info.Info_ValueForKey(cl.userinfo, "msg");

            if (val.Length > 0)
            {
                cl.messagelevel = Lib.atoi(val);
            }
        }