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 02-19-2013, 11:38 AM
Chrono
Sarnak
 
Join Date: Apr 2002
Posts: 36
Default New Event: EVENT_CAMPED

I think it would be quite a nice feature to have as at the moment I've integrated various player leaderboards on my website, and I couldn't find a way to detect if a player is online or not.

You can use EVENT_CONNECT to see the player is on, however EVENT_DISCONNECT is only on actual disconnects and not camping.

So on EVENT_CONNECT I set a qglobal to say they are online, but it doesn't always get removed, only if a disconnect happens.

Unless there's another workaround I'm missing?

Thanks.
Reply With Quote
  #2  
Old 02-19-2013, 12:25 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

it looks as though it's because Client::OnDisconnect (which is where the parsing of that event happens) is only called if the client is a GM.

Code:
void Client::Handle_OP_Camp(const EQApplicationPacket *app) {
#ifdef BOTS
	// This block is necessary to clean up any bot objects owned by a Client
	Bot::BotHealRotationsClear(this);
	Bot::BotOrderCampAll(this);
#endif
	if(IsLFP())
		worldserver.StopLFP(CharacterID());

	if (GetGM()) 
	{
		OnDisconnect(true);
		return;
	}
	camp_timer.Start(29000,true);
	return;
}
i'm not sure if the original intent of the event was to catch anything except for sudden disconnects.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #3  
Old 02-19-2013, 12:44 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

@ line 210 of zone/client_process.cpp, you can try to add the lines in red

Code:
        if (camp_timer.Check()) {
            LeaveGroup();
            Save();
            if (GetMerc())
            {
                GetMerc()->Save();
                GetMerc()->RemoveMercFromGroup(GetMerc(), GetMerc()->GetGroup());
                GetMerc()->Depop();
            }
            instalog = true;
            if (parse->PlayerHasQuestSub("EVENT_DISCONNECT")) {
                parse->EventPlayer(EVENT_DISCONNECT, this, "", 0);
            }
        }
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #4  
Old 02-20-2013, 09:56 AM
Chrono
Sarnak
 
Join Date: Apr 2002
Posts: 36
Default

Just added it, works great. Thanks!

Don't suppose the need is great enough to get this added into main code?

I think it's quite useful, could be a good way to clear certain qglobals on logout etc.
Reply With Quote
Reply

Thread Tools
Display Modes

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