NUM_ACTIVE_ZONES bug

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

NUM_ACTIVE_ZONES bug

Post by John Adams » Thu Jun 25, 2009 3:24 pm

Scat, there seems to be a problem with the SERVER_STAT_NUM_ACTIVE_ZONES stat. I think it's counting all zones that start up fine, but not subtracting it when the zone shuts down. Checking in the code, I see the stat update in place, but not sure why I am seeing 40+ running zones when there are 0 players online.

Just FYI, I can't figure it out :(

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: NUM_ACTIVE_ZONES bug

Post by LethalEncounter » Thu Jun 25, 2009 3:33 pm

heh, it is actually adding to the zone count when it shuts down as well :) Scat - let me know if you need me to fix it, otherwise I'll leave it in your capable hands :P

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: NUM_ACTIVE_ZONES bug

Post by John Adams » Thu Jun 25, 2009 3:45 pm

I think I didn't understand what a += was doing. Is that the problem?

Also, I need to change the stat_value field in statistics to sint, because if we ever need a negative stat, we're not going to get it. But I need to check with Scatman first to make sure I don't break anything by doing that.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: NUM_ACTIVE_ZONES bug

Post by John Adams » Thu Jun 25, 2009 3:53 pm

Actually LE, go ahead and fix it if it's something simple. Scatman is probably gorging himself on Jumjum pies (plural) somewhere and I'd hate to disturb him.

You ever try to get a hobbit away from his snacks?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: NUM_ACTIVE_ZONES bug

Post by John Adams » Thu Jun 25, 2009 4:12 pm

Yo Scat/LE,

Seems now that I am testing these (heh) that SERVER_STAT_MOST_CONNECTIONS is also not incrementing. I have 2 accounts logged into Dev now, but my "Most Simultaneous Connections" value is staying at 1. Looks like we're doing a compare of client_list.Count(), which I imagine is correct - but something is not bumping the stat to 2.

I was wondering why Tess, with 6 connections at one time, still showed only 1. :D

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: NUM_ACTIVE_ZONES bug

Post by LethalEncounter » Thu Jun 25, 2009 5:49 pm

kk sure, I'll get it complete sometime tomorrow morning. (I'm off tomorrow)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: NUM_ACTIVE_ZONES bug

Post by John Adams » Thu Jun 25, 2009 7:19 pm

I have a couple stats "fixes" I wanted to check in, but after looking at the code a while, I am not sure it's the best way to implement it.

When the world starts, some settings need to be reinitialized, like Accepted Connections, Server Startup Time, and Zones Active (in case of crash and the statistics table didn't get updated on exit). So in World::init() I am just throwing UpdateServerStatistic() updates right in the init process.

I'm not sure that's right, but it works.

Code: Select all

.
.
.
	LoadVitalityInformation();
	database.LoadServerStatistics();
	world.UpdateServerStatistic(STAT_SERVER_START_TIME, Timer::GetUnixTimeStamp(), true);
	world.UpdateServerStatistic(STAT_SERVER_ACCEPTED_CONNECTION, 0, true);
	world.UpdateServerStatistic(STAT_SERVER_NUM_ACTIVE_ZONES, 0, true);
}

vector<EntityCommand*>* World::GetEntityCommandList(int32 id){
You think that's ok, just calling these directly like that? Or should there be a single function that updates a list of known "resets" all at once somewhere during init? The reason I am iffy about the re-inits is that they get put into the cycle and are not done immediately, so during testing, the values stay as they were for 'n' seconds til the thread fires off... and I am not sure of any ill effects from this.

Just rambling.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: NUM_ACTIVE_ZONES bug

Post by Scatman » Thu Jun 25, 2009 9:55 pm

Sorry. The last three days I haven't been home except to sleep. Grr. I actually had fixed that zone stat problem without anyone noticing ;) but I must've forgot to commit it :roll:

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: NUM_ACTIVE_ZONES bug

Post by Scatman » Fri Jun 26, 2009 10:47 pm

LE, are you sure it's adding even when a zone is shutdown? I tested this today. I opened two zones and let the first zone shutdown properly and the number of zones decreased. I think the problem is when the server crashes or is simply exited out of, the zones don't get shutdown properly, therefore the values remain in the database.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: NUM_ACTIVE_ZONES bug

Post by LethalEncounter » Sat Jun 27, 2009 4:34 am

I might have read it wrong, but you were using -1 on an int32 (unsigned) value, so the -1 turned into 0xFFFFFFFF. It might work depending on how you are implementing it though if it overruns its max value and starts over at 0.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: NUM_ACTIVE_ZONES bug

Post by Scatman » Sat Jun 27, 2009 6:01 am

Doh, I always forget int32 is typedefed. If you didn't do it I'll just add an 's' infront :P

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: NUM_ACTIVE_ZONES bug

Post by LethalEncounter » Sat Jun 27, 2009 6:50 am

Nope, I haven't touched it after I read your previous comments - feel free :P

Locked

Who is online

Users browsing this forum: No registered users and 0 guests