Just FYI, I can't figure it out
NUM_ACTIVE_ZONES bug
- 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
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
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
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 
- 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
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.
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.
- 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
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?
You ever try to get a hobbit away from his snacks?
- 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
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.
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.
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Re: NUM_ACTIVE_ZONES bug
kk sure, I'll get it complete sometime tomorrow morning. (I'm off tomorrow)
- 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
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.
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.
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){Just rambling.
- 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
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 
- 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
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
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.
- 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
Doh, I always forget int32 is typedefed. If you didn't do it I'll just add an 's' infront 
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Re: NUM_ACTIVE_ZONES bug
Nope, I haven't touched it after I read your previous comments - feel free 
Who is online
Users browsing this forum: No registered users and 0 guests