X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=sv_ccmds.c;h=639a3253a42b62b6c580fe80a152b3e3d3b3e4ca;hp=d9e08c045008e2828b9aec013c67808dc56c28f5;hb=66ec69f1c020739371ac074baa7bb652834ecece;hpb=1c1c1d842e8930e8c09eea8e877f07a829858d5a diff --git a/sv_ccmds.c b/sv_ccmds.c index d9e08c04..639a3253 100644 --- a/sv_ccmds.c +++ b/sv_ccmds.c @@ -740,7 +740,7 @@ static void SV_Status_f(cmd_state_t *cmd) print ("version: %s build %s (gamename %s)\n", gamename, buildstring, gamenetworkfiltername); print ("protocol: %i (%s)\n", Protocol_NumberForEnum(sv.protocol), Protocol_NameForEnum(sv.protocol)); print ("map: %s\n", sv.name); - print ("timing: %s\n", Host_TimingReport(vabuf, sizeof(vabuf))); + print ("timing: %s\n", SV_TimingReport(vabuf, sizeof(vabuf))); print ("players: %i active (%i max)\n\n", players, svs.maxclients); if (in == 1) @@ -1411,7 +1411,6 @@ static void SV_Ent_Create_f(cmd_state_t *cmd) int i; qbool haveorigin; - qbool expectval = false; void (*print)(const char *, ...) = (cmd->source == src_client ? SV_ClientPrintf : Con_Printf); if(!Cmd_Argc(cmd)) @@ -1450,31 +1449,24 @@ static void SV_Ent_Create_f(cmd_state_t *cmd) } // Allow more than one key/value pair by cycling between expecting either one. - for(i = 2; i < Cmd_Argc(cmd); i++) + for(i = 2; i < Cmd_Argc(cmd); i += 2) { - if(!expectval) + if(!(key = PRVM_ED_FindField(prog, Cmd_Argv(cmd, i)))) { - if(!(key = PRVM_ED_FindField(prog, Cmd_Argv(cmd, i)))) - { - print("Key %s not found!\n", Cmd_Argv(cmd, i)); - PRVM_ED_Free(prog, ed); - return; - } + print("Key %s not found!\n", Cmd_Argv(cmd, i)); + PRVM_ED_Free(prog, ed); + return; + } - /* - * This is mostly for dedicated server console, but if the - * player gave a custom origin, we can ignore the traceline. - */ - if(!strcmp(Cmd_Argv(cmd, i), "origin")) - haveorigin = true; + /* + * This is mostly for dedicated server console, but if the + * player gave a custom origin, we can ignore the traceline. + */ + if(!strcmp(Cmd_Argv(cmd, i), "origin")) + haveorigin = true; - expectval = true; - } - else - { - PRVM_ED_ParseEpair(prog, ed, key, Cmd_Argv(cmd, i), false); - expectval = false; - } + if (i + 1 < Cmd_Argc(cmd)) + PRVM_ED_ParseEpair(prog, ed, key, Cmd_Argv(cmd, i+1), false); } if(!haveorigin) @@ -1509,7 +1501,7 @@ static void SV_Ent_Remove_f(cmd_state_t *cmd) { prvm_prog_t *prog = SVVM_prog; prvm_edict_t *ed; - int i, ednum; + int i, ednum = 0; void (*print)(const char *, ...) = (cmd->source == src_client ? SV_ClientPrintf : Con_Printf); if(!Cmd_Argc(cmd)) @@ -1564,7 +1556,7 @@ static void SV_Ent_Remove_f(cmd_state_t *cmd) return; } - if(!ed->priv.required->free) + if(!ed->free) { print("Removed a \"%s\"\n", PRVM_GetString(prog, PRVM_serveredictstring(ed, classname))); PRVM_ED_ClearEdict(prog, ed); @@ -1588,7 +1580,7 @@ static void SV_Ent_Remove_All_f(cmd_state_t *cmd) for (i = 0, rmcount = 0, ed = PRVM_EDICT_NUM(i); i < prog->num_edicts; i++, ed = PRVM_NEXT_EDICT(ed)) { - if(!ed->priv.required->free && !strcmp(PRVM_GetString(prog, PRVM_serveredictstring(ed, classname)), Cmd_Argv(cmd, 1))) + if(!ed->free && !strcmp(PRVM_GetString(prog, PRVM_serveredictstring(ed, classname)), Cmd_Argv(cmd, 1))) { if(!i) { @@ -1635,7 +1627,7 @@ void SV_InitOperatorCommands(void) Cmd_AddCommand(CF_SHARED, "maxplayers", SV_MaxPlayers_f, "sets limit on how many players (or bots) may be connected to the server at once"); host.hook.SV_SendCvar = SV_SendCvar_f; - // commands that do not have automatic forwarding from cmd_client, these are internal details of the network protocol and not of interest to users (if they know what they are doing they can still use a generic "cmd prespawn" or similar) + // commands that do not have automatic forwarding from cmd_local, these are internal details of the network protocol and not of interest to users (if they know what they are doing they can still use a generic "cmd prespawn" or similar) Cmd_AddCommand(CF_SERVER_FROM_CLIENT, "prespawn", SV_PreSpawn_f, "internal use - signon 1 (client acknowledges that server information has been received)"); Cmd_AddCommand(CF_SERVER_FROM_CLIENT, "spawn", SV_Spawn_f, "internal use - signon 2 (client has sent player information, and is asking server to send scoreboard rankings)"); Cmd_AddCommand(CF_SERVER_FROM_CLIENT, "begin", SV_Begin_f, "internal use - signon 3 (client asks server to start sending entities, and will go to signon 4 (playing) when the first entity update is received)");