@ -432,3 +432,8 @@ unsigned short Networking::NumberOfConnections() const
{
return peer->NumberOfConnections();
}
unsigned int Networking::MaxConnections() const
return peer->GetMaximumIncomingConnections();
@ -21,6 +21,7 @@ namespace mwmp
void KickPlayer(RakNet::RakNetGUID guid);
void Update(RakNet::Packet *packet);
unsigned short NumberOfConnections() const;
unsigned int MaxConnections() const;
int MainLoop();
@ -3,6 +3,7 @@
//
#include "Player.hpp"
#include "Networking.hpp"
TPlayers Players::players;
TSlots Players::slots;
@ -35,7 +36,7 @@ void Players::NewPlayer(RakNet::RakNetGUID id)
players[id]->NpcStats()->blank();
players[id]->CreatureStats()->blank();
for (int i = 0; i < 16; i++)
for (int i = 0; i < mwmp::Networking::Get().MaxConnections(); i++)
if (slots[i] == 0)