Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2010, 10:49 AM
songie
Sarnak
 
Join Date: Dec 2009
Posts: 43
Default Zone idling

How do you go about altering this piece of code so that i can let most zones idle and others i (input) choose not ? c++ not my thing :p


void EntityList::MobProcess() {
#ifdef IDLE_WHEN_EMPTY
if(numclients < 1)
return;
#endif
_ZP(EntityList_MobProcess);
LinkedListIterator<Mob*> iterator(mob_list);
iterator.Reset();
while(iterator.MoreElements())
{
if(!iterator.GetData())
{
iterator.Advance();
continue;
}
if(!iterator.GetData()->Process()){
Mob* mob=iterator.GetData();
if(mob->IsNPC())
entity_list.RemoveNPC(mob->CastToNPC()->GetID());
#ifdef BOTS
else if(mob->IsBot()) {
entity_list.RemoveBot(mob->CastToBot()->GetID());
}
#endif
else{
#ifdef WIN32
struct in_addr in;
in.s_addr = mob->CastToClient()->GetIP();
cout << "Dropping client: Process=false, ip=" << inet_ntoa(in) << ", port=" << mob->CastToClient()->GetPort() << endl;
#endif
zone->StartShutdownTimer();
Group *g = GetGroupByMob(mob);
if(g) {
LogFile->write(EQEMuLog::Error, "About to delete a client still in a group.");
g->DelMember(mob);
}
Raid *r = entity_list.GetRaidByClient(mob->CastToClient());
if(r) {
LogFile->write(EQEMuLog::Error, "About to delete a client still in a raid.");
r->MemberZoned(mob->CastToClient());
}
entity_list.RemoveClient(mob->GetID());
}
iterator.RemoveCurrent();
}
else
iterator.Advance();
}
}
__________________
--You start casting "Extra Content"--
--You Hit your database for 9.999 Damage, you have slain your Server--
--Please wait reinstalling!--/Sigh
Reply With Quote
  #2  
Old 11-03-2010, 11:06 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by songie View Post
How do you go about altering this piece of code so that i can let most zones idle and others i (input) choose not ? c++ not my thing :p


void EntityList::MobProcess() {
#ifdef IDLE_WHEN_EMPTY
if(numclients < 1)
return;
#endif
_ZP(EntityList_MobProcess);
LinkedListIterator<Mob*> iterator(mob_list);
iterator.Reset();
while(iterator.MoreElements())
{
if(!iterator.GetData())
{
iterator.Advance();
continue;
}
if(!iterator.GetData()->Process()){
Mob* mob=iterator.GetData();
if(mob->IsNPC())
entity_list.RemoveNPC(mob->CastToNPC()->GetID());
#ifdef BOTS
else if(mob->IsBot()) {
entity_list.RemoveBot(mob->CastToBot()->GetID());
}
#endif
else{
#ifdef WIN32
struct in_addr in;
in.s_addr = mob->CastToClient()->GetIP();
cout << "Dropping client: Process=false, ip=" << inet_ntoa(in) << ", port=" << mob->CastToClient()->GetPort() << endl;
#endif
zone->StartShutdownTimer();
Group *g = GetGroupByMob(mob);
if(g) {
LogFile->write(EQEMuLog::Error, "About to delete a client still in a group.");
g->DelMember(mob);
}
Raid *r = entity_list.GetRaidByClient(mob->CastToClient());
if(r) {
LogFile->write(EQEMuLog::Error, "About to delete a client still in a raid.");
r->MemberZoned(mob->CastToClient());
}
entity_list.RemoveClient(mob->GetID());
}
iterator.RemoveCurrent();
}
else
iterator.Advance();
}
}
Table: 'zone'

Field: 'shutdowndelay' will determine how long that dynamic zone stays up before it is shut down, it goes by milliseconds and defaults to '5000' milliseconds which is 5 seconds.
Reply With Quote
  #3  
Old 11-03-2010, 11:37 AM
songie
Sarnak
 
Join Date: Dec 2009
Posts: 43
Default

I need some Static zones to stay up forever having to input 86400000 milliseconds to keep it up for 24 hours is more like a workaround, its mostly for opendoor zones and when i disable idling of zones after about a 500 zones running at the sametime it maxes out the cpu. I could input about a 7 days worth of milliseconds i guess but idd prefer a sourcecode change to excempt certain zones from being able to idle at all.
__________________
--You start casting "Extra Content"--
--You Hit your database for 9.999 Damage, you have slain your Server--
--Please wait reinstalling!--/Sigh
Reply With Quote
  #4  
Old 11-03-2010, 12:41 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by songie View Post
I need some Static zones to stay up forever having to input 86400000 milliseconds to keep it up for 24 hours is more like a workaround, its mostly for opendoor zones and when i disable idling of zones after about a 500 zones running at the sametime it maxes out the cpu. I could input about a 7 days worth of milliseconds i guess but idd prefer a sourcecode change to excempt certain zones from being able to idle at all.
That field is on a per zone basis. And is far more CPU efficient to call that out then to have statics running all the time. But that is your call, I don't see a whole lot of use in something like that. Otherwise I'm sure that it could be added. But you can pretty much serve the same purpose with shutdown delay.
Reply With Quote
  #5  
Old 11-03-2010, 01:47 PM
songie
Sarnak
 
Join Date: Dec 2009
Posts: 43
Default

Aaaah you mean instead of running all the zones as statics you run them as dynamics with a couple of hours worth of uptime. Havent looked at it like that. Ill play with the settings a bit see if i can get what i need. You run most zones as dynamics ? I have a couple of things in place tough that dont cope well with a zone going to sleep. Ill check it out. Thanks
__________________
--You start casting "Extra Content"--
--You Hit your database for 9.999 Damage, you have slain your Server--
--Please wait reinstalling!--/Sigh
Reply With Quote
  #6  
Old 11-03-2010, 02:23 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by songie View Post
Aaaah you mean instead of running all the zones as statics you run them as dynamics with a couple of hours worth of uptime. Havent looked at it like that. Ill play with the settings a bit see if i can get what i need. You run most zones as dynamics ? I have a couple of things in place tough that dont cope well with a zone going to sleep. Ill check it out. Thanks
Yes, I have some zones that players farm that are dynamic and they like to think they can zone in and out and force the zone to repop with a chance of a named being up. Those specific zones have a zoneshutdowndelay of about 15 minutes.
Reply With Quote
Reply


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 03:07 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3