Page 1 of 1
NUM_ACTIVE_ZONES bug
Posted: Thu Jun 25, 2009 3:24 pm
by John Adams
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

Re: NUM_ACTIVE_ZONES bug
Posted: Thu Jun 25, 2009 3:33 pm
by LethalEncounter
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

Re: NUM_ACTIVE_ZONES bug
Posted: Thu Jun 25, 2009 3:45 pm
by John Adams
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.
Re: NUM_ACTIVE_ZONES bug
Posted: Thu Jun 25, 2009 3:53 pm
by John Adams
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?
Re: NUM_ACTIVE_ZONES bug
Posted: Thu Jun 25, 2009 4:12 pm
by John Adams
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.

Re: NUM_ACTIVE_ZONES bug
Posted: Thu Jun 25, 2009 5:49 pm
by LethalEncounter
kk sure, I'll get it complete sometime tomorrow morning. (I'm off tomorrow)
Re: NUM_ACTIVE_ZONES bug
Posted: Thu Jun 25, 2009 7:19 pm
by John Adams
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.
Re: NUM_ACTIVE_ZONES bug
Posted: Thu Jun 25, 2009 9:55 pm
by Scatman
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

Re: NUM_ACTIVE_ZONES bug
Posted: Fri Jun 26, 2009 10:47 pm
by Scatman
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.
Re: NUM_ACTIVE_ZONES bug
Posted: Sat Jun 27, 2009 4:34 am
by LethalEncounter
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.
Re: NUM_ACTIVE_ZONES bug
Posted: Sat Jun 27, 2009 6:01 am
by Scatman
Doh, I always forget int32 is typedefed. If you didn't do it I'll just add an 's' infront

Re: NUM_ACTIVE_ZONES bug
Posted: Sat Jun 27, 2009 6:50 am
by LethalEncounter
Nope, I haven't touched it after I read your previous comments - feel free
