Odd.
This is the number sent to the client for the number of players online on a server:
https://github.com/EQEmu/Server/blob...nager.cpp#L260
Code:
...
data_ptr += 4;
*(uint32*)data_ptr = (*iter)->GetPlayersOnline();
data_ptr += 4;
++iter;
...
GetPlayersOnline() is a simple property read.
https://github.com/EQEmu/Server/blob..._server.h#L119
Code:
...
/**
* Gets the number of players on the server.
*/
unsigned int GetPlayersOnline() const { return players_online; }
...
It's properly zeroed out on class construction and in a Reset() method:
https://github.com/EQEmu/Server/blob...server.cpp#L26
Code:
WorldServer::WorldServer(EmuTCPConnection *c)
{
connection = c;
zones_booted = 0;
players_online = 0;
...
https://github.com/EQEmu/Server/blob...server.cpp#L48
Code:
void WorldServer::Reset()
{
zones_booted = 0;
players_online = 0;
status = 0;
runtime_id;
server_list_id = 0;
server_type = 0;
authorized = false;
logged_in = false;
}
It's given the number by the login server.
https://github.com/EQEmu/Server/blob...erver.cpp#L502
Code:
void WorldServer::Handle_LSStatus(ServerLSStatus_Struct *s)
{
players_online = s->num_players;
zones_booted = s->num_zones;
status = s->status;
}
The login server sends it here:
https://github.com/EQEmu/Server/blob...erver.cpp#L301
Code:
void LoginServer::SendStatus() {
statusupdate_timer.Start();
auto pack = new ServerPacket;
pack->opcode = ServerOP_LSStatus;
pack->size = sizeof(ServerLSStatus_Struct);
pack->pBuffer = new uchar[pack->size];
memset(pack->pBuffer, 0, pack->size);
ServerLSStatus_Struct* lss = (ServerLSStatus_Struct*) pack->pBuffer;
if (WorldConfig::get()->Locked)
lss->status = -2;
else if (numzones <= 0)
lss->status = -2;
else
lss->status = numplayers;
lss->num_zones = numzones;
lss->num_players = numplayers;
SendPacket(pack);
delete pack;
}
I lost track of it at numplayers, referenced as an extern:
https://github.com/EQEmu/Server/blob...server.cpp#L69
Code:
...
extern ZSList zoneserver_list;
extern ClientList client_list;
extern uint32 numzones;
extern uint32 numplayers;
extern volatile bool RunLoops;
...
Stepping backwards through the pipeline so far here, I haven't seen any place where the number might be set to arbitrary values. Is it possibly a networking or RAM issue?