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)
if (in == 0) // default layout
{
- 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);
}
}
}
// remove menu
+ if (key_dest == key_menu || key_dest == key_menu_grabbed)
+ MR_ToggleMenu(0);
key_dest = key_game;
svs.serverflags = 0; // haven't completed an episode yet
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);
}
/*
}
// remove menu
+ if (key_dest == key_menu || key_dest == key_menu_grabbed)
+ MR_ToggleMenu(0);
key_dest = key_game;
SV_VM_Begin();
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);
}
/*
}
// remove menu
+ if (key_dest == key_menu || key_dest == key_menu_grabbed)
+ MR_ToggleMenu(0);
key_dest = key_game;
allowcheats = sv_cheats.integer != 0;
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);
}
CL_Disconnect ();
// remove menu
+ if (key_dest == key_menu || key_dest == key_menu_grabbed)
+ MR_ToggleMenu(0);
key_dest = key_game;
cls.demonum = -1; // stop demo loop in case this fails
// 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);