EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   General::General Discussion (https://www.eqemulator.org/forums/forumdisplay.php?f=586)
-   -   EQEmu architecture and code (https://www.eqemulator.org/forums/showthread.php?t=30298)

Keladon 01-12-2010 09:11 AM

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?

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.


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
                        }
                }


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

Quote:

Originally Posted by Keladon (Post 182957)
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.


All times are GMT -4. The time now is 07:04 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.