- bugfix for network session id randomizing

This commit is contained in:
Mark Vejvoda
2011-10-01 01:40:00 +00:00
parent 77a2fa7d48
commit 6c1f0186c6

View File

@@ -364,7 +364,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
if(socket != NULL) {
//RandomGen random;
//sessionKey = random.randRange(-100000, 100000);
srand(time(NULL));
srand(time(NULL) / (this->playerIndex + 1));
sessionKey = rand() % 1000000;
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] accepted new client connection, serverInterface->getOpenSlotCount() = %d, sessionKey = %d\n",__FILE__,__FUNCTION__,__LINE__,serverInterface->getOpenSlotCount(),sessionKey);