aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver/Master.cpp
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-10-02 14:26:58 +0200
committerMachiavelli <none@none>2010-10-02 14:26:58 +0200
commitc4710bde766bdb37477022e4a1768dab3ff311fa (patch)
tree6c6f8eaa2f20a1c1fcc2412f2942ce1010fab8d7 /src/server/worldserver/Master.cpp
parent0f09690c5c1d0c391df9faa6a702f3d892a452dc (diff)
Core/DBLayer: Fix MySQL timeout issue. World runnable will now call KeepAlive on each database after a specified number of seconds (MaxPingTime in worldserver.conf)
Based on patch by kingarus81 Fixes issue #4062 Also remove explicit numbering from WorldTimers enum --HG-- branch : trunk
Diffstat (limited to 'src/server/worldserver/Master.cpp')
-rw-r--r--src/server/worldserver/Master.cpp26
1 files changed, 1 insertions, 25 deletions
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp
index 15ec29c140c..ef1e562b412 100644
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -119,25 +119,7 @@ public:
class RARunnable : public ACE_Based::Runnable
{
public:
- uint32 numLoops, loopCounter;
-
- RARunnable ()
- {
- uint32 socketSelecttime = sWorld.getIntConfig(CONFIG_SOCKET_SELECTTIME);
- numLoops = (sConfig.GetIntDefault ("MaxPingTime", 30) * (MINUTE * 1000000 / socketSelecttime));
- loopCounter = 0;
- }
-
- void checkping ()
- {
- // ping if need
- if ((++loopCounter) == numLoops)
- {
- loopCounter = 0;
- sLog.outDetail ("Ping MySQL to keep connection alive");
- LoginDatabase.KeepAlive();
- }
- }
+ RARunnable () {}
void run ()
{
@@ -171,18 +153,12 @@ public:
if (usera)
{
while (!World::IsStopped())
- {
h.Select (0, socketSelecttime);
- checkping ();
- }
}
else
{
while (!World::IsStopped())
- {
ACE_Based::Thread::Sleep(static_cast<unsigned long> (socketSelecttime / 1000));
- // checkping (); -- What?
- }
}
}
};