/// <summary> /// Host_Pause_f /// </summary> private static void Pause_f() { if (Cmd.Source == cmd_source_t.src_command) { Cmd.ForwardToServer(); return; } if (_Pausable.Value == 0) { Server.ClientPrint("Pause not allowed.\n"); } else { Server.sv.paused = !Server.sv.paused; if (Server.sv.paused) { Server.BroadcastPrint("{0} paused the game\n", Progs.GetString(Server.Player.v.netname)); } else { Server.BroadcastPrint("{0} unpaused the game\n", Progs.GetString(Server.Player.v.netname)); } // send notification to all clients Server.sv.reliable_datagram.WriteByte(Protocol.svc_setpause); Server.sv.reliable_datagram.WriteByte(Server.sv.paused ? 1 : 0); } }
public void Set(string value) { bool changed = (String.Compare(_String, value) != 0); if (!changed) { return; } _String = value; _Value = Common.atof(_String); if (IsServer && Server.sv.active) { Server.BroadcastPrint("\"{0}\" changed to \"{1}\"\n", _Name, _String); } }
/* * ================= * PF_bprint * * broadcast print to everyone on server * * bprint(value) * ================= */ static void PF_bprint() { string s = PF_VarString(0); Server.BroadcastPrint(s); }