View Full Version : EQEmu architecture and code
Keladon
01-12-2010, 09:11 AM
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?
cybernine186
01-12-2010, 02:36 PM
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.
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
}
}
AndMetal
01-16-2010, 03:01 AM
What kind of query?
Keladon
01-16-2010, 03:54 PM
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?
Derision
01-16-2010, 05:00 PM
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.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.