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
+ host_client->sendsignon = 0; // enable unlimited sends again
}
// 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
}
/*
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;
+ // 1 = send svc_serverinfo and advance to 2, 2 doesn't send, then advances to 0 (allowing unlimited sending) when prespawn is received
+ int 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
+ client->sendsignon = 1; // send this message, and increment to 2, 2 will be set to 0 by the prespawn command
// clear movement info until client enters the new level properly
memset(&client->cmd, 0, sizeof(client->cmd));
}
// send the datagram
- NetConn_SendUnreliableMessage (client->netconnection, &msg, sv.protocol, clientrate, !client->spawned && !client->sendsignon);
- if (!client->netconnection->message.cursize)
- client->sendsignon = false;
+ NetConn_SendUnreliableMessage (client->netconnection, &msg, sv.protocol, clientrate, client->sendsignon == 2);
+ if (client->sendsignon == 1 && !client->netconnection->message.cursize)
+ client->sendsignon = 2; // prevent reliable until client sends prespawn (this is the keepalive phase)
}
/*