memcpy(conn->sendMessage, data->data, data->cursize);
conn->sendMessageLength = data->cursize;
- if (conn->sendMessageLength <= MAX_DATAGRAM)
+ if (conn->sendMessageLength <= MAX_PACKETFRAGMENT)
{
dataLen = conn->sendMessageLength;
eom = NETFLAG_EOM;
}
else
{
- dataLen = MAX_DATAGRAM;
+ dataLen = MAX_PACKETFRAGMENT;
eom = 0;
}
if (conn->sendMessageLength && !conn->canSend && conn->sendNext)
{
- if (conn->sendMessageLength <= MAX_DATAGRAM)
+ if (conn->sendMessageLength <= MAX_PACKETFRAGMENT)
{
dataLen = conn->sendMessageLength;
eom = NETFLAG_EOM;
}
else
{
- dataLen = MAX_DATAGRAM;
+ dataLen = MAX_PACKETFRAGMENT;
eom = 0;
}
if (conn->sendMessageLength && !conn->canSend && (realtime - conn->lastSendTime) > 1.0)
{
- if (conn->sendMessageLength <= MAX_DATAGRAM)
+ if (conn->sendMessageLength <= MAX_PACKETFRAGMENT)
{
dataLen = conn->sendMessageLength;
eom = NETFLAG_EOM;
}
else
{
- dataLen = MAX_DATAGRAM;
+ dataLen = MAX_PACKETFRAGMENT;
eom = 0;
}
Con_DPrintf("ack sequencing error\n");
conn->lastMessageTime = realtime;
conn->timeout = realtime + net_messagetimeout.value;
- conn->sendMessageLength -= MAX_DATAGRAM;
+ conn->sendMessageLength -= MAX_PACKETFRAGMENT;
if (conn->sendMessageLength > 0)
{
- memcpy(conn->sendMessage, conn->sendMessage+MAX_DATAGRAM, conn->sendMessageLength);
+ memcpy(conn->sendMessage, conn->sendMessage+MAX_PACKETFRAGMENT, conn->sendMessageLength);
conn->sendNext = true;
NetConn_SendMessageNext(conn);
}
#define ON_EPSILON 0.1 // point on plane side epsilon
+#define MAX_PACKETFRAGMENT 1024 // max length of packet fragment
// LordHavoc: this was 1024, now 65536
#define MAX_DATAGRAM 65536 // max length of unreliable
#define MAX_NETRELIABLE 65536 // max length of reliable message (fragments into unreliable packets)
{
int i, v;
- if (sv.datagram.cursize > MAX_DATAGRAM-16)
+ if (sv.datagram.cursize > MAX_PACKETFRAGMENT-18)
return;
MSG_WriteByte (&sv.datagram, svc_particle);
MSG_WriteDPCoord (&sv.datagram, org[0]);
*/
void SV_StartEffect (vec3_t org, int modelindex, int startframe, int framecount, int framerate)
{
- if (sv.datagram.cursize > MAX_DATAGRAM-18)
- return;
if (modelindex >= 256 || startframe >= 256)
{
+ if (sv.datagram.cursize > MAX_PACKETFRAGMENT-19)
+ return;
MSG_WriteByte (&sv.datagram, svc_effect2);
MSG_WriteDPCoord (&sv.datagram, org[0]);
MSG_WriteDPCoord (&sv.datagram, org[1]);
}
else
{
+ if (sv.datagram.cursize > MAX_PACKETFRAGMENT-17)
+ return;
MSG_WriteByte (&sv.datagram, svc_effect);
MSG_WriteDPCoord (&sv.datagram, org[0]);
MSG_WriteDPCoord (&sv.datagram, org[1]);
if (channel < 0 || channel > 7)
Host_Error ("SV_StartSound: channel = %i", channel);
- if (sv.datagram.cursize > MAX_DATAGRAM-16)
+ if (sv.datagram.cursize > MAX_PACKETFRAGMENT-21)
return;
// find precache number for sound