Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2010, 09:11 AM
Keladon
Fire Beetle
 
Join Date: Sep 2007
Posts: 7
Default EQEmu architecture and code

Not quite sure if this is the right forum but seemed more appropiate here than in the standard development, bug, feature request or custom code forum. Please move this thread
to the appropiate forum as you deem fit.

I want to write a databas function which queries the databas at regular intervals. I read the page about EQEmu architecture but I can't really tie
it to the code.

I'm guessing I could write a query in the DBAsync file and then make
a function call from somewhere in the main thread as it is continuesly running.

Would this be the right approach and if so how would I go about to make a function call from the main thread? Also anyone know how long the mainthread sleeps?
Reply With Quote
  #2  
Old 01-12-2010, 02:36 PM
cybernine186
Sarnak
 
Join Date: Feb 2008
Posts: 87
Default

You can take a look in the net.cpp file under the world folder. Find this code below because here is where you would want to do that at. The InterserverTimer is currently set at 10000ms. If you don't want to include a new function with the InterserverTimer you could copy it and create a new timer.


Code:
		if (InterserverTimer.Check()) {
			InterserverTimer.Start();
			database.ping();
			AsyncLoadVariables(dbasync, &database);
			if (Config->LoginHost.length() && loginserver.Connected() == false) {
#ifdef WIN32
				_beginthread(AutoInitLoginServer, 0, NULL);
#else
				pthread_t thread;
				pthread_create(&thread, NULL, &AutoInitLoginServer, NULL);
#endif
			}
		}
Reply With Quote
  #3  
Old 01-16-2010, 03:01 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

What kind of query?
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #4  
Old 01-16-2010, 03:54 PM
Keladon
Fire Beetle
 
Join Date: Sep 2007
Posts: 7
Default

The first idea was to implement an pvp table which would log pvp events and by continously querying the databas be able to remove pvp events older than a certain amount of time and impose certain rules to those "in" combat.

My concern with this approach is that it would probaly create alot more load on the databasserver.

Instead I tried to create a PvpList similar to that of the HateList and attach pvp events to clients. But when I add a virtual function to the mob file I keep getting undefined reference errors from other files such as horse, npc, playercorpse, etc. How are these classes interconnected?

Is there an UML diagram somewhere or some information of what classes build upon which classes?

Could anyone guide me to some information regarding general c++ debugging and development?
Reply With Quote
  #5  
Old 01-16-2010, 05:00 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by Keladon View Post
Instead I tried to create a PvpList similar to that of the HateList and attach pvp events to clients. But when I add a virtual function to the mob file I keep getting undefined reference errors from other files such as horse, npc, playercorpse, etc. How are these classes interconnected?
Client is derived from Mob, which in turn is derived from Entity, however since only clients can PvP, I would think you should just add your 'PvPList' into the Client class and not worry about the Mob class or virtual functions at all.
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 08:09 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