Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 09-24-2015, 01:06 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

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?
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:32 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3