/// <summary> /// CL_SignonReply /// /// An svc_signonnum has been received, perform a client side setup /// </summary> static void SignonReply() { Con.DPrint("CL_SignonReply: {0}\n", Cls.signon); switch (Cls.signon) { case 1: Cls.message.WriteByte(Protocol.clc_stringcmd); Cls.message.WriteString("prespawn"); break; case 2: Cls.message.WriteByte(Protocol.clc_stringcmd); Cls.message.WriteString(String.Format("name \"{0}\"\n", _Name.String)); Cls.message.WriteByte(Protocol.clc_stringcmd); Cls.message.WriteString(String.Format("color {0} {1}\n", ((int)_Color.Value) >> 4, ((int)_Color.Value) & 15)); Cls.message.WriteByte(Protocol.clc_stringcmd); Cls.message.WriteString("spawn " + Cls.spawnparms); break; case 3: Cls.message.WriteByte(Protocol.clc_stringcmd); Cls.message.WriteString("begin"); Cache.Report(); // print remaining memory break; case 4: Scr.EndLoadingPlaque(); // allow normal screen updates break; } }
/// <summary> /// Host_Error /// This shuts down both the client and server /// </summary> public static void Error(string error, params object[] args) { _ErrorDepth++; try { if (_ErrorDepth > 1) { Sys.Error("Host_Error: recursively entered. " + error, args); } Scr.EndLoadingPlaque(); // reenable screen updates string message = (args.Length > 0 ? String.Format(error, args) : error); Con.Print("Host_Error: {0}\n", message); if (Server.sv.active) { ShutdownServer(false); } if (Client.cls.state == cactive_t.ca_dedicated) { Sys.Error("Host_Error: {0}\n", message); // dedicated servers exit } Client.Disconnect(); Client.cls.demonum = -1; throw new EndGameException(); // longjmp (host_abortserver, 1); } finally { _ErrorDepth--; } }
/// <summary> /// Con_ToggleConsole_f /// </summary> public static void ToggleConsole_f() { if (Key.Destination == keydest_t.key_console) { if (Client.Cls.state == ClientActivityState.Connected) { Key.Destination = keydest_t.key_game; Key.Lines[Key.EditLine][1] = '\0'; // clear any typing Key.LinePos = 1; } else { MenuBase.MainMenu.Show(); } } else { Key.Destination = keydest_t.key_console; } Scr.EndLoadingPlaque(); Array.Clear(_Times, 0, _Times.Length); }