+ if (host_client->edict && (f = ED_FindFunction ("SV_ChangeTeam")) && (SV_ChangeTeam = (func_t)(f - pr_functions)))
+ {
+ Con_DPrint("Calling SV_ChangeTeam\n");
+ pr_global_struct->time = sv.time;
+ pr_globals[OFS_PARM0] = playercolor;
+ pr_global_struct->self = EDICT_TO_PROG(host_client->edict);
+ PR_ExecuteProgram (SV_ChangeTeam, "QC function SV_ChangeTeam is missing");
+ }
+ else
+ {
+ eval_t *val;
+ if (host_client->edict)
+ {
+ if ((val = GETEDICTFIELDVALUE(host_client->edict, eval_clientcolors)))
+ val->_float = playercolor;
+ host_client->edict->v->team = bottom + 1;
+ }
+ host_client->colors = playercolor;
+ if (host_client->old_colors != host_client->colors)
+ {
+ host_client->old_colors = host_client->colors;
+ // send notification to all clients
+ MSG_WriteByte (&sv.reliable_datagram, svc_updatecolors);
+ MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
+ MSG_WriteByte (&sv.reliable_datagram, host_client->colors);
+ }
+ }
+}
+
+cvar_t cl_rate = {CVAR_SAVE, "_cl_rate", "10000"};
+void Host_Rate_f(void)
+{
+ int rate;
+
+ if (Cmd_Argc() != 2)
+ {
+ Con_Printf("\"rate\" is \"%i\"\n", cl_rate.integer);
+ Con_Print("rate <500-25000>\n");
+ return;
+ }
+
+ rate = atoi(Cmd_Argv(1));
+
+ if (cmd_source == src_command)
+ {
+ Cvar_SetValue ("_cl_rate", bound(NET_MINRATE, rate, NET_MAXRATE));
+ if (cls.state == ca_connected)
+ Cmd_ForwardToServer ();
+ return;
+ }