mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
bah, need svc_chokecount when real clients are connected :P
This commit is contained in:
parent
ec4bab3088
commit
77af004b32
2 changed files with 19 additions and 8 deletions
|
@ -73,7 +73,7 @@ static void
|
||||||
client_drop (client_t *cl)
|
client_drop (client_t *cl)
|
||||||
{
|
{
|
||||||
MSG_WriteByte (&cl->netchan.message, svc_disconnect);
|
MSG_WriteByte (&cl->netchan.message, svc_disconnect);
|
||||||
Con_Printf ("Client %s removed\n", Info_ValueForKey (cl->userinfo, "name"));
|
qtv_printf ("Client %s removed\n", Info_ValueForKey (cl->userinfo, "name"));
|
||||||
cl->drop = 1;
|
cl->drop = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,6 +155,11 @@ cl_ptrack_f (client_t *cl, void *unused)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
cl_list_f (client_t *cl, void *unused)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static ucmd_t ucmds[] = {
|
static ucmd_t ucmds[] = {
|
||||||
{"new", cl_new_f, 0, 0},
|
{"new", cl_new_f, 0, 0},
|
||||||
{"modellist", cl_modellist_f, 0, 0},
|
{"modellist", cl_modellist_f, 0, 0},
|
||||||
|
@ -185,6 +190,8 @@ static ucmd_t ucmds[] = {
|
||||||
{"ptrack", cl_ptrack_f, 0, 1}, // ZOID - used with autocam
|
{"ptrack", cl_ptrack_f, 0, 1}, // ZOID - used with autocam
|
||||||
|
|
||||||
{"snap", 0, 0, 0},
|
{"snap", 0, 0, 0},
|
||||||
|
|
||||||
|
{"list", cl_list_f, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
static hashtab_t *ucmd_table;
|
static hashtab_t *ucmd_table;
|
||||||
|
@ -227,7 +234,7 @@ client_parse_message (client_t *cl)
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (net_message->badread) {
|
if (net_message->badread) {
|
||||||
Con_Printf ("SV_ReadClientMessage: badread\n");
|
qtv_printf ("SV_ReadClientMessage: badread\n");
|
||||||
client_drop (cl);
|
client_drop (cl);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -238,7 +245,7 @@ client_parse_message (client_t *cl)
|
||||||
|
|
||||||
switch (c) {
|
switch (c) {
|
||||||
default:
|
default:
|
||||||
Con_Printf ("SV_ReadClientMessage: unknown command char\n");
|
qtv_printf ("SV_ReadClientMessage: unknown command char\n");
|
||||||
client_drop (cl);
|
client_drop (cl);
|
||||||
return;
|
return;
|
||||||
case clc_nop:
|
case clc_nop:
|
||||||
|
@ -321,7 +328,7 @@ client_handler (connection_t *con, void *object)
|
||||||
client_t *cl = (client_t *) object;
|
client_t *cl = (client_t *) object;
|
||||||
|
|
||||||
if (net_message->message->cursize < 11) {
|
if (net_message->message->cursize < 11) {
|
||||||
Con_Printf ("%s: Runt packet\n", NET_AdrToString (net_from));
|
qtv_printf ("%s: Runt packet\n", NET_AdrToString (net_from));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -362,21 +369,21 @@ client_connect (connection_t *con, void *object)
|
||||||
MSG_BeginReading (net_message);
|
MSG_BeginReading (net_message);
|
||||||
seq = MSG_ReadLong (net_message);
|
seq = MSG_ReadLong (net_message);
|
||||||
if (seq != -1) {
|
if (seq != -1) {
|
||||||
Con_Printf ("unexpected connected packet\n");
|
qtv_printf ("unexpected connected packet\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
str = MSG_ReadString (net_message);
|
str = MSG_ReadString (net_message);
|
||||||
COM_TokenizeString (str, qtv_args);
|
COM_TokenizeString (str, qtv_args);
|
||||||
cmd_args = qtv_args;
|
cmd_args = qtv_args;
|
||||||
if (strcmp (Cmd_Argv (0), "connect")) {
|
if (strcmp (Cmd_Argv (0), "connect")) {
|
||||||
Con_Printf ("unexpected connected packet\n");
|
qtv_printf ("unexpected connected packet\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
version = atoi (Cmd_Argv (1));
|
version = atoi (Cmd_Argv (1));
|
||||||
if (version != PROTOCOL_VERSION) {
|
if (version != PROTOCOL_VERSION) {
|
||||||
Netchan_OutOfBandPrint (net_from, "%c\nServer is version %s.\n",
|
Netchan_OutOfBandPrint (net_from, "%c\nServer is version %s.\n",
|
||||||
A2C_PRINT, QW_VERSION);
|
A2C_PRINT, QW_VERSION);
|
||||||
Con_Printf ("* rejected connect from version %i\n", version);
|
qtv_printf ("* rejected connect from version %i\n", version);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qport = atoi (Cmd_Argv (2));
|
qport = atoi (Cmd_Argv (2));
|
||||||
|
@ -404,7 +411,7 @@ client_connect (connection_t *con, void *object)
|
||||||
con->object = cl;
|
con->object = cl;
|
||||||
con->handler = client_handler;
|
con->handler = client_handler;
|
||||||
|
|
||||||
Con_Printf ("client %s (%s) connected\n",
|
qtv_printf ("client %s (%s) connected\n",
|
||||||
Info_ValueForKey (userinfo, "name"),
|
Info_ValueForKey (userinfo, "name"),
|
||||||
NET_AdrToString (con->address));
|
NET_AdrToString (con->address));
|
||||||
|
|
||||||
|
|
|
@ -889,6 +889,10 @@ sv_parse (server_t *sv, qmsg_t *msg, int reliable)
|
||||||
case svc_updateping:
|
case svc_updateping:
|
||||||
sv_update_net (sv, msg, 1);
|
sv_update_net (sv, msg, 1);
|
||||||
break;
|
break;
|
||||||
|
case svc_chokecount:
|
||||||
|
//XXX
|
||||||
|
MSG_ReadByte (msg);
|
||||||
|
break;
|
||||||
case svc_serverdata:
|
case svc_serverdata:
|
||||||
sv_serverdata (sv, msg);
|
sv_serverdata (sv, msg);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue