// send the reliable message (forwarded commands) if there is one
if (buf.cursize || cls.netcon->message.cursize)
- NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, max(20*(buf.cursize+40), cl_rate.integer));
+ NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, max(20*(buf.cursize+40), cl_rate.integer), false);
if (cls.netcon->message.overflowed)
{
Con_DPrint("Sending clc_disconnect\n");
MSG_WriteByte(&buf, clc_disconnect);
}
- NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000);
- NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000);
- NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000);
+ NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, false);
+ NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, false);
+ NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, false);
NetConn_Close(cls.netcon);
cls.netcon = NULL;
}
sizebuf_t old;
// no need if server is local and definitely not if this is a demo
- if (sv.active || !cls.netcon || cls.protocol == PROTOCOL_QUAKEWORLD)
+ if (!cls.netcon || cls.protocol == PROTOCOL_QUAKEWORLD)
return;
if (readmessages)
msg.data = buf;
msg.maxsize = sizeof(buf);
MSG_WriteChar(&msg, clc_nop);
- NetConn_SendUnreliableMessage(cls.netcon, &msg, cls.protocol, 10000);
+ NetConn_SendUnreliableMessage(cls.netcon, &msg, cls.protocol, 10000, false);
}
}
buf.data = bufdata;
buf.maxsize = sizeof(bufdata);
MSG_WriteByte(&buf, svc_disconnect);
- NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000);
- NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000);
- NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000);
+ NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, false);
+ NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, false);
+ NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, false);
}
// break the net connection
NetConn_Close(host_client->netconnection);
SZ_Write (&host_client->netconnection->message, sv.signon.data, sv.signon.cursize);
MSG_WriteByte (&host_client->netconnection->message, svc_signonnum);
MSG_WriteByte (&host_client->netconnection->message, 2);
+ host_client->sendsignon = true; // send this message, this will be cleared later
}
// reset the name change timer because the client will send name soon
MSG_WriteByte (&host_client->netconnection->message, svc_signonnum);
MSG_WriteByte (&host_client->netconnection->message, 3);
+ host_client->sendsignon = true; // send this message, this will be cleared later
}
/*
}
}
-int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate)
+int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, qboolean quakesignon_suppressreliables)
{
int totallen = 0;
}
// if we have a new reliable message to send, do so
- if (!conn->sendMessageLength && conn->message.cursize)
+ if (!conn->sendMessageLength && conn->message.cursize && !quakesignon_suppressreliables)
{
if (conn->message.cursize > (int)sizeof(conn->sendMessage))
{
msg.data = buf;
msg.maxsize = sizeof(buf);
MSG_WriteChar(&msg, clc_nop);
- NetConn_SendUnreliableMessage(cls.netcon, &msg, cls.protocol, 10000);
+ NetConn_SendUnreliableMessage(cls.netcon, &msg, cls.protocol, 10000, false);
}
}
//extern cvar_t net_netaddress_ipv6;
qboolean NetConn_CanSend(netconn_t *conn);
-int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate);
+int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolversion_t protocol, int rate, qboolean quakesignon_suppressreliables);
void NetConn_CloseClientPorts(void);
void NetConn_OpenClientPorts(void);
void NetConn_CloseServerPorts(void);
qboolean clientconnectcalled;
// false = don't send datagrams
qboolean spawned;
+ // false = don't send reliable messages until svc_signonnum 2 (before spawned is set)
+ qboolean sendsignon;
// requested rate in bytes per second
int rate;
MSG_WriteByte (&client->netconnection->message, 1);
client->spawned = false; // need prespawn, spawn, etc
+ client->sendsignon = true; // send this message, this will be cleared later
// clear movement info until client enters the new level properly
memset(&client->cmd, 0, sizeof(client->cmd));
if (!NetConn_CanSend(client->netconnection))
{
// send the datagram
- //NetConn_SendUnreliableMessage (client->netconnection, &msg, sv.protocol, clientrate);
+ //NetConn_SendUnreliableMessage (client->netconnection, &msg, sv.protocol, clientrate, true);
return;
}
else if (host_client->spawned)
}
// send the datagram
- NetConn_SendUnreliableMessage (client->netconnection, &msg, sv.protocol, clientrate);
+ NetConn_SendUnreliableMessage (client->netconnection, &msg, sv.protocol, clientrate, !client->spawned && !client->sendsignon);
+ if (!client->netconnection->message.cursize)
+ client->sendsignon = false;
}
/*