client_t *client;
int seconds = 0, minutes = 0, hours = 0, i, j, k, in, players, ping = 0, packetloss = 0;
void (*print) (const char *fmt, ...);
- char ip[22];
+ char ip[48]; // can contain a full length v6 address with [] and a port
int frags;
if (cmd_source == src_command)
print ("players: %i active (%i max)\n\n", players, svs.maxclients);
if (in == 1)
- print ("^2IP %%pl ping time frags no name\n");
+ print ("^2IP %%pl ping time frags no name\n");
else if (in == 2)
- print ("^5IP no name\n");
+ print ("^5IP no name\n");
for (i = 0, k = 0, client = svs.clients;i < svs.maxclients;i++, client++)
{
}
if(sv_status_privacy.integer && cmd_source != src_command)
- strlcpy(ip, client->netconnection ? "hidden" : "botclient" , 22);
+ strlcpy(ip, client->netconnection ? "hidden" : "botclient", 48);
else
- strlcpy(ip, (client->netconnection && client->netconnection->address) ? client->netconnection->address : "botclient", 22);
+ strlcpy(ip, (client->netconnection && client->netconnection->address) ? client->netconnection->address : "botclient", 48);
frags = client->frags;
if (in == 0) // default layout
{
- // LordHavoc: we must use multiple prints for ProQuake compatibility
- print ("#%-3u ", i+1);
- print ("%-16.16s ", client->name);
- print ("%4i ", frags);
- print ("%2i:%02i:%02i\n ", hours, minutes, seconds);
- print ("%s\n", ip);
-// print ("#%-3u %-16.16s %3i %2i:%02i:%02i\n", i+1, client->name, frags, hours, minutes, seconds);
-// print (" %s\n", ip);
+ if (sv.protocol == PROTOCOL_QUAKE && svs.maxclients <= 99)
+ {
+ // LordHavoc: this is very touchy because we must maintain ProQuake compatible status output
+ print ("#%-2u %-16.16s %3i %2i:%02i:%02i\n", i+1, client->name, frags, hours, minutes, seconds);
+ print (" %s\n", ip);
+ }
+ else
+ {
+ // LordHavoc: no real restrictions here, not a ProQuake-compatible protocol anyway...
+ print ("#%-3u %-16.16s %4i %2i:%02i:%02i\n", i+1, client->name, frags, hours, minutes, seconds);
+ print (" %s\n", ip);
+ }
}
else if (in == 1) // extended layout
{
- print ("%s%-21s %2i %4i %2i:%02i:%02i %4i #%-3u ^7%s\n", k%2 ? "^3" : "^7", ip, packetloss, ping, hours, minutes, seconds, frags, i+1, client->name);
+ print ("%s%-47s %2i %4i %2i:%02i:%02i %4i #%-3u ^7%s\n", k%2 ? "^3" : "^7", ip, packetloss, ping, hours, minutes, seconds, frags, i+1, client->name);
}
else if (in == 2) // reduced layout
{
- print ("%s%-21s #%-3u ^7%s\n", k%2 ? "^3" : "^7", ip, i+1, client->name);
+ print ("%s%-47s #%-3u ^7%s\n", k%2 ? "^3" : "^7", ip, i+1, client->name);
}
}
strlcpy(level, Cmd_Argv(1), sizeof(level));
SV_SpawnServer(level);
if (sv.active && cls.state == ca_disconnected)
- CL_EstablishConnection("local:1");
+ CL_EstablishConnection("local:1", -2);
}
/*
strlcpy(level, Cmd_Argv(1), sizeof(level));
SV_SpawnServer(level);
if (sv.active && cls.state == ca_disconnected)
- CL_EstablishConnection("local:1");
+ CL_EstablishConnection("local:1", -2);
}
/*
strlcpy(mapname, sv.name, sizeof(mapname));
SV_SpawnServer(mapname);
if (sv.active && cls.state == ca_disconnected)
- CL_EstablishConnection("local:1");
+ CL_EstablishConnection("local:1", -2);
}
/*
// will still contain its IP address, so get the address...
InfoString_GetValue(cls.userinfo, "*ip", temp, sizeof(temp));
if (temp[0])
- CL_EstablishConnection(temp);
+ CL_EstablishConnection(temp, -1);
else
Con_Printf("Reconnect to what server? (you have not connected to a server yet)\n");
return;
*/
void Host_Connect_f (void)
{
- if (Cmd_Argc() != 2)
+ if (Cmd_Argc() < 2)
{
- Con_Print("connect <serveraddress> : connect to a multiplayer game\n");
+ Con_Print("connect <serveraddress> [<key> <value> ...]: connect to a multiplayer game\n");
return;
}
// clear the rcon password, to prevent vulnerability by stuffcmd-ing a connect command
if(rcon_secure.integer <= 0)
Cvar_SetQuick(&rcon_password, "");
- CL_EstablishConnection(Cmd_Argv(1));
+ CL_EstablishConnection(Cmd_Argv(1), 2);
}
// parse the global vars
PRVM_ED_ParseGlobals (start);
+
+ // restore the autocvar globals
+ Cvar_UpdateAllAutoCvars();
}
else
{
if (i >= 0 && i < MAX_MODELS)
{
strlcpy(sv.model_precache[i], com_token, sizeof(sv.model_precache[i]));
- sv.models[i] = Mod_ForName (sv.model_precache[i], true, false, sv.model_precache[i][0] == '*' ? sv.modelname : NULL);
+ sv.models[i] = Mod_ForName (sv.model_precache[i], true, false, sv.model_precache[i][0] == '*' ? sv.worldname : NULL);
}
else
Con_Printf("unsupported model %i \"%s\"\n", i, com_token);
// make sure we're connected to loopback
if (sv.active && cls.state == ca_disconnected)
- CL_EstablishConnection("local:1");
+ CL_EstablishConnection("local:1", -2);
}
//============================================================================
Host_Playermodel_f
======================
*/
-cvar_t cl_playermodel = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_playermodel", "", "internal storage cvar for current player model in Nexuiz (changed by playermodel command)"};
+cvar_t cl_playermodel = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_playermodel", "", "internal storage cvar for current player model in Nexuiz/Xonotic (changed by playermodel command)"};
// the old cl_playermodel in cl_main has been renamed to __cl_playermodel
void Host_Playermodel_f (void)
{
Host_Playerskin_f
======================
*/
-cvar_t cl_playerskin = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_playerskin", "", "internal storage cvar for current player skin in Nexuiz (changed by playerskin command)"};
+cvar_t cl_playerskin = {CVAR_SAVE | CVAR_NQUSERINFOHACK, "_cl_playerskin", "", "internal storage cvar for current player skin in Nexuiz/Xonotic (changed by playerskin command)"};
void Host_Playerskin_f (void)
{
int i, j;
*/
void Host_Kick_f (void)
{
- char *who;
+ const char *who;
const char *message = NULL;
client_t *save;
int i;
SZ_Clear(&net_message);
MSG_WriteLong (&net_message, 0);
MSG_WriteByte (&net_message, CCREQ_RCON);
- SZ_Write(&net_message, (void*)rcon_password.string, n);
+ SZ_Write(&net_message, (const unsigned char*)rcon_password.string, n);
+ MSG_WriteByte (&net_message, 0); // terminate the (possibly partial) string
MSG_WriteString (&net_message, Cmd_Args());
StoreBigLong(net_message.data, NETFLAG_CTL | (net_message.cursize & NETFLAG_LENGTH_MASK));
NetConn_Write(mysocket, net_message.data, net_message.cursize, &to);
Cmd_AddCommand_WithClientCommand ("status", Host_Status_f, Host_Status_f, "print server status information");
Cmd_AddCommand ("quit", Host_Quit_f, "quit the game");
- if (gamemode == GAME_NEHAHRA)
- {
- Cmd_AddCommand_WithClientCommand ("max", NULL, Host_God_f, "god mode (invulnerability)");
- Cmd_AddCommand_WithClientCommand ("monster", NULL, Host_Notarget_f, "notarget mode (monsters do not see you)");
- Cmd_AddCommand_WithClientCommand ("scrag", NULL, Host_Fly_f, "fly mode (flight)");
- Cmd_AddCommand_WithClientCommand ("wraith", NULL, Host_Noclip_f, "noclip mode (flight without collisions, move through walls)");
- Cmd_AddCommand_WithClientCommand ("gimme", NULL, Host_Give_f, "alter inventory");
- }
- else
- {
- Cmd_AddCommand_WithClientCommand ("god", NULL, Host_God_f, "god mode (invulnerability)");
- Cmd_AddCommand_WithClientCommand ("notarget", NULL, Host_Notarget_f, "notarget mode (monsters do not see you)");
- Cmd_AddCommand_WithClientCommand ("fly", NULL, Host_Fly_f, "fly mode (flight)");
- Cmd_AddCommand_WithClientCommand ("noclip", NULL, Host_Noclip_f, "noclip mode (flight without collisions, move through walls)");
- Cmd_AddCommand_WithClientCommand ("give", NULL, Host_Give_f, "alter inventory");
- }
+ Cmd_AddCommand_WithClientCommand ("god", NULL, Host_God_f, "god mode (invulnerability)");
+ Cmd_AddCommand_WithClientCommand ("notarget", NULL, Host_Notarget_f, "notarget mode (monsters do not see you)");
+ Cmd_AddCommand_WithClientCommand ("fly", NULL, Host_Fly_f, "fly mode (flight)");
+ Cmd_AddCommand_WithClientCommand ("noclip", NULL, Host_Noclip_f, "noclip mode (flight without collisions, move through walls)");
+ Cmd_AddCommand_WithClientCommand ("give", NULL, Host_Give_f, "alter inventory");
Cmd_AddCommand ("map", Host_Map_f, "kick everyone off the server and start a new level");
Cmd_AddCommand ("restart", Host_Restart_f, "restart current level");
Cmd_AddCommand ("changelevel", Host_Changelevel_f, "change to another level, bringing along all connected clients");
Cmd_AddCommand_WithClientCommand ("color", Host_Color_f, Host_Color_f, "change your player shirt and pants colors");
Cvar_RegisterVariable (&cl_rate);
Cmd_AddCommand_WithClientCommand ("rate", Host_Rate_f, Host_Rate_f, "change your network connection speed");
- if (gamemode == GAME_NEHAHRA)
- {
- Cvar_RegisterVariable (&cl_pmodel);
- Cmd_AddCommand_WithClientCommand ("pmodel", Host_PModel_f, Host_PModel_f, "change your player model choice (Nehahra specific)");
- }
+ Cvar_RegisterVariable (&cl_pmodel);
+ Cmd_AddCommand_WithClientCommand ("pmodel", Host_PModel_f, Host_PModel_f, "(Nehahra-only) change your player model choice");
// BLACK: This isnt game specific anymore (it was GAME_NEXUIZ at first)
Cvar_RegisterVariable (&cl_playermodel);