va_list argptr;
va_start (argptr,error);
- vsprintf (hosterrorstring1,error,argptr);
+ dpvsnprintf (hosterrorstring1,sizeof(hosterrorstring1),error,argptr);
va_end (argptr);
Con_Printf("Host_Error: %s\n", hosterrorstring1);
void Host_InitLocal (void)
{
Host_InitCommands ();
-
+
Cmd_AddCommand("saveconfig", Host_SaveConfig_f);
Cvar_RegisterVariable (&host_framerate);
// config.cfg cvars
if (host_initialized && cls.state != ca_dedicated)
{
- f = FS_Open ("config.cfg", "w", false);
+ f = FS_Open ("config.cfg", "wb", false);
if (!f)
{
Con_Print("Couldn't write config.cfg.\n");
char msg[4096];
va_start(argptr,fmt);
- vsnprintf(msg,sizeof(msg),fmt,argptr);
+ dpvsnprintf(msg,sizeof(msg),fmt,argptr);
va_end(argptr);
SV_ClientPrint(msg);
}
if (sv_echobprint.integer && cls.state == ca_dedicated)
- Sys_Print(msg);
+ Con_Print(msg);
}
/*
char msg[4096];
va_start(argptr,fmt);
- vsnprintf(msg,sizeof(msg),fmt,argptr);
+ dpvsnprintf(msg,sizeof(msg),fmt,argptr);
va_end(argptr);
SV_BroadcastPrint(msg);
char string[1024];
va_start(argptr,fmt);
- vsprintf(string, fmt,argptr);
+ dpvsnprintf(string, sizeof(string), fmt, argptr);
va_end(argptr);
MSG_WriteByte(&host_client->message, svc_stufftext);
EntityFrame4_FreeDatabase(host_client->entitydatabase4);
if (host_client->entitydatabase5)
EntityFrame5_FreeDatabase(host_client->entitydatabase5);
-
+
if (sv.active)
{
// clear a fields that matter to DP_SV_CLIENTNAME and DP_SV_CLIENTCOLORS, and also frags
ED_ClearEdict(host_client->edict);
}
-
+
// clear the client struct (this sets active to false)
memset(host_client, 0, sizeof(*host_client));
double timecap, timeleft;
realtime += time;
- if (sys_ticrate.value < 0.01 || sys_ticrate.value > 0.1)
+ if (sys_ticrate.value < 0.01 || sys_ticrate.value > 0.10001)
Cvar_SetValue("sys_ticrate", bound(0.01, sys_ticrate.value, 0.1));
if (slowmo.value < 0)
Cvar_SetValue("slowmo", 0);
static double time2 = 0;
static double time3 = 0;
int pass1, pass2, pass3;
- usercmd_t cmd; // Used for receiving input
if (setjmp(host_abortserver))
return; // something bad happened, or the server disconnected
IN_Commands();
// Collect input into cmd
- IN_ProcessMove(&cmd);
+ IN_ProcessMove();
// process console commands
Cbuf_Execute();
// if running the server locally, make intentions now
if (cls.state == ca_connected && sv.active)
- CL_SendCmd(&cmd);
+ CL_SendCmd();
//-------------------
//
// if running the server remotely, send intentions now after
// the incoming messages have been read
if (!sv.active)
- CL_SendCmd(&cmd);
+ CL_SendCmd();
CL_ReadFromServer();
}
// AK shutdown PRVM
// AK hmm, no PRVM_Shutdown(); yet
+ CL_Video_Shutdown();
Host_SaveConfig_f();
CDAudio_Shutdown ();
+ S_Terminate ();
NetConn_Shutdown ();
+ PR_Shutdown ();
+ Cbuf_Shutdown ();
if (cls.state != ca_dedicated)
{
VID_Shutdown();
}
+ Cmd_Shutdown();
+ CL_Shutdown();
Sys_Shutdown();
Log_Close ();
+ COM_Shutdown ();
+ Memory_Shutdown();
}