*/
void Host_Reconnect_f (void)
{
- if (cmd_source == src_command)
- {
- Con_Print("reconnect is not valid from the console\n");
- return;
- }
- if (Cmd_Argc() != 1)
+ if (cls.protocol == PROTOCOL_QUAKEWORLD)
{
- Con_Print("reconnect : wait for signon messages again\n");
- return;
+ if (cls.qw_downloadmemory) // don't change when downloading
+ return;
+
+ S_StopAllSounds();
+
+ if (cls.netcon)
+ {
+ if (cls.state == ca_connected && cls.signon < SIGNONS)
+ {
+ Con_Printf("reconnecting...\n");
+ MSG_WriteChar(&cls.netcon->message, qw_clc_stringcmd);
+ MSG_WriteString(&cls.netcon->message, "new");
+ }
+ else
+ Con_Printf("Please use connect instead (reconnect not implemented)\n");
+ }
}
- if (!cls.signon)
+ else
{
- //Con_Print("reconnect: no signon, ignoring reconnect\n");
- return;
+ if (Cmd_Argc() != 1)
+ {
+ Con_Print("reconnect : wait for signon messages again\n");
+ return;
+ }
+ if (!cls.signon)
+ {
+ Con_Print("reconnect: no signon, ignoring reconnect\n");
+ return;
+ }
+ cls.signon = 0; // need new connection messages
}
- cls.signon = 0; // need new connection messages
}
/*
// TODO: shouldn't this be a cvar instead?
void Host_FullServerinfo_f (void) // credit: taken from QuakeWorld
{
+ char temp[512];
if (Cmd_Argc() != 2)
{
Con_Printf ("usage: fullserverinfo <complete info string>\n");
}
strlcpy (cl.qw_serverinfo, Cmd_Argv(1), sizeof(cl.qw_serverinfo));
+ InfoString_GetValue(cl.qw_serverinfo, "teamplay", temp, sizeof(temp));
+ cl.qw_teamplay = atoi(temp);
}
/*
out = send+4;
send[0] = send[1] = send[2] = send[3] = 0xff;
- l = strlen (in);
+ l = (int)strlen (in);
for (i=0 ; i<l ; i++)
{
if (out >= send + sizeof(send) - 1)
*out++ = '\n';
i++;
}
+ else if (in[i] == '\\' && in[i+1] == '0')
+ {
+ *out++ = '\0';
+ i++;
+ }
+ else if (in[i] == '\\' && in[i+1] == 't')
+ {
+ *out++ = '\t';
+ i++;
+ }
+ else if (in[i] == '\\' && in[i+1] == 'r')
+ {
+ *out++ = '\r';
+ i++;
+ }
+ else if (in[i] == '\\' && in[i+1] == '"')
+ {
+ *out++ = '\"';
+ i++;
+ }
else
*out++ = in[i];
}
- *out = 0;
mysocket = NetConn_ChooseClientSocketForAddress(&address);
if (mysocket)
- NetConn_WriteString(mysocket, send, &address);
+ NetConn_Write(mysocket, send, out - send, &address);
}
//=============================================================================