Con_Printf("Host_Loadgame_f: loading version\n");
// version
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
version = atoi(com_token);
if (version != SAVEGAME_VERSION)
{
Con_Printf("Host_Loadgame_f: loading description\n");
// description
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
for (i = 0;i < NUM_SPAWN_PARMS;i++)
{
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
spawn_parms[i] = atof(com_token);
}
// skill
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
// this silliness is so we can load 1.06 save files, which have float skill values
current_skill = (int)(atof(com_token) + 0.5);
Cvar_SetValue ("skill", (float)current_skill);
Con_Printf("Host_Loadgame_f: loading mapname\n");
// mapname
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
strlcpy (mapname, com_token, sizeof(mapname));
if(developer_entityparsing.integer)
Con_Printf("Host_Loadgame_f: loading time\n");
// time
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
time = atof(com_token);
allowcheats = sv_cheats.integer != 0;
{
// light style
start = t;
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
// if this is a 64 lightstyle savegame produced by Quake, stop now
// we have to check this because darkplaces may save more than 64
if (com_token[0] == '{')
for (;;)
{
start = t;
- if (!COM_ParseToken_Simple(&t, false, false))
+ if (!COM_ParseToken_Simple(&t, false, false, true))
break;
if (com_token[0] == '{')
{
for (;;)
{
start = t;
- while (COM_ParseToken_Simple(&t, false, false))
+ while (COM_ParseToken_Simple(&t, false, false, true))
if (!strcmp(com_token, "}"))
break;
- if (!COM_ParseToken_Simple(&start, false, false))
+ if (!COM_ParseToken_Simple(&start, false, false, true))
{
// end of file
break;
while (entnum >= prog->max_edicts)
PRVM_MEM_IncreaseEdicts(prog);
ent = PRVM_EDICT_NUM(entnum);
- memset(ent->fields.vp, 0, prog->entityfields * 4);
+ memset(ent->fields.fp, 0, prog->entityfields * sizeof(prvm_vec_t));
ent->priv.server->free = false;
if(developer_entityparsing.integer)
memset(sv.lightstyles[0], 0, sizeof(sv.lightstyles));
memset(sv.model_precache[0], 0, sizeof(sv.model_precache));
memset(sv.sound_precache[0], 0, sizeof(sv.sound_precache));
- while (COM_ParseToken_Simple(&t, false, false))
+ while (COM_ParseToken_Simple(&t, false, false, true))
{
if (!strcmp(com_token, "sv.lightstyles"))
{
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
i = atoi(com_token);
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
if (i >= 0 && i < MAX_LIGHTSTYLES)
strlcpy(sv.lightstyles[i], com_token, sizeof(sv.lightstyles[i]));
else
}
else if (!strcmp(com_token, "sv.model_precache"))
{
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
i = atoi(com_token);
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
if (i >= 0 && i < MAX_MODELS)
{
strlcpy(sv.model_precache[i], com_token, sizeof(sv.model_precache[i]));
}
else if (!strcmp(com_token, "sv.sound_precache"))
{
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
i = atoi(com_token);
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
if (i >= 0 && i < MAX_SOUNDS)
strlcpy(sv.sound_precache[i], com_token, sizeof(sv.sound_precache[i]));
else
}
else if (!strcmp(com_token, "sv.bufstr"))
{
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
i = atoi(com_token);
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
k = atoi(com_token);
- COM_ParseToken_Simple(&t, false, false);
+ COM_ParseToken_Simple(&t, false, false, true);
stringbuffer = (prvm_stringbuffer_t*) Mem_ExpandableArray_RecordAtIndex(&prog->stringbuffersarray, i);
// VorteX: nasty code, cleanup required
// create buffer at this index
}
}
// skip any trailing text or unrecognized commands
- while (COM_ParseToken_Simple(&t, true, false) && strcmp(com_token, "\n"))
+ while (COM_ParseToken_Simple(&t, true, false, true) && strcmp(com_token, "\n"))
;
}
}
if (host_client->edict && PRVM_serverfunction(SV_ChangeTeam))
{
Con_DPrint("Calling SV_ChangeTeam\n");
- prog->globals.generic[OFS_PARM0] = playercolor;
+ prog->globals.fp[OFS_PARM0] = playercolor;
PRVM_serverglobalfloat(time) = sv.time;
PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(host_client->edict);
prog->ExecuteProgram(prog, PRVM_serverfunction(SV_ChangeTeam), "QC function SV_ChangeTeam is missing");
*/
static void Host_Pause_f (void)
{
- if (!pausable.integer)
- SV_ClientPrint("Pause not allowed.\n");
+ void (*print) (const char *fmt, ...);
+ if (cmd_source == src_command)
+ {
+ // if running a client, try to send over network so the pause is handled by the server
+ if (cls.state == ca_connected)
+ {
+ Cmd_ForwardToServer ();
+ return;
+ }
+ print = Con_Printf;
+ }
else
+ print = SV_ClientPrintf;
+
+ if (!pausable.integer)
{
- sv.paused ^= 1;
- SV_BroadcastPrintf("%s %spaused the game\n", host_client->name, sv.paused ? "" : "un");
- // send notification to all clients
- MSG_WriteByte(&sv.reliable_datagram, svc_setpause);
- MSG_WriteByte(&sv.reliable_datagram, sv.paused);
+ if (cmd_source == src_client)
+ {
+ if(cls.state == ca_dedicated || host_client != &svs.clients[0]) // non-admin
+ {
+ print("Pause not allowed.\n");
+ return;
+ }
+ }
}
+
+ sv.paused ^= 1;
+ SV_BroadcastPrintf("%s %spaused the game\n", host_client->name, sv.paused ? "" : "un");
+ // send notification to all clients
+ MSG_WriteByte(&sv.reliable_datagram, svc_setpause);
+ MSG_WriteByte(&sv.reliable_datagram, sv.paused);
}
/*
if (Cmd_Argc() > 2)
{
message = Cmd_Args();
- COM_ParseToken_Simple(&message, false, false);
+ COM_ParseToken_Simple(&message, false, false, true);
if (byNumber)
{
message++; // skip the #
case '8':
case '9':
// MED 01/04/97 added hipnotic give stuff
- if (gamemode == GAME_HIPNOTIC)
+ if (gamemode == GAME_HIPNOTIC || gamemode == GAME_QUOTH)
{
if (t[0] == '6')
{
lhnetsocket_t *mysocket;
char peer_address[64];
+ if (Cmd_Argc() == 1)
+ {
+ Con_Printf("%s: Usage: %s command\n", Cmd_Argv(0), Cmd_Argv(0));
+ return;
+ }
+
if (!rcon_password.string || !rcon_password.string[0] || rcon_secure.integer > 0)
{
Con_Printf ("You must set rcon_password before issuing an pqrcon command, and rcon_secure must be 0.\n");
lhnetsocket_t *mysocket;
char vabuf[1024];
+ if (Cmd_Argc() == 1)
+ {
+ Con_Printf("%s: Usage: %s command\n", Cmd_Argv(0), Cmd_Argv(0));
+ return;
+ }
+
if (!rcon_password.string || !rcon_password.string[0])
{
Con_Printf ("You must set rcon_password before issuing an rcon command.\n");
Cmd_AddCommand_WithClientCommand ("say_team", Host_Say_Team_f, Host_Say_Team_f, "send a chat message to your team on the server");
Cmd_AddCommand_WithClientCommand ("tell", Host_Tell_f, Host_Tell_f, "send a chat message to only one person on the server");
Cmd_AddCommand_WithClientCommand ("kill", NULL, Host_Kill_f, "die instantly");
- Cmd_AddCommand_WithClientCommand ("pause", NULL, Host_Pause_f, "pause the game (if the server allows pausing)");
+ Cmd_AddCommand_WithClientCommand ("pause", Host_Pause_f, Host_Pause_f, "pause the game (if the server allows pausing)");
Cmd_AddCommand ("kick", Host_Kick_f, "kick a player off the server by number or name");
Cmd_AddCommand_WithClientCommand ("ping", Host_Ping_f, Host_Ping_f, "print ping times of all players on the server");
Cmd_AddCommand ("load", Host_Loadgame_f, "load a saved game file");