1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

Fix maximum connections

This commit is contained in:
Koncord 2016-08-19 08:18:25 +08:00
parent e1955b440f
commit d3c9864fb0
3 changed files with 8 additions and 1 deletions

View file

@ -432,3 +432,8 @@ unsigned short Networking::NumberOfConnections() const
{
return peer->NumberOfConnections();
}
unsigned int Networking::MaxConnections() const
{
return peer->GetMaximumIncomingConnections();
}

View file

@ -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();

View file

@ -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)
{