Guest User

Untitled

a guest
Nov 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. ++ b/src/server/authserver/Main.cpp
  2. @@ -33,6 +33,10 @@
  3. #include "RealmList.h"
  4. #include "RealmAcceptor.h"
  5.  
  6. #include <ace/Event_Handler.h>
  7. #include <ace/Time_Value.h>
  8. #include "AuthSocket.h"
  9.  
  10. #ifndef _TRINITY_REALM_CONFIG
  11. # define _TRINITY_REALM_CONFIG  "authserver.conf"
  12. #endif
  13. @@ -60,6 +64,21 @@ public:
  14.     }
  15. };
  16.  
  17. class LauncherTimer : public ACE_Event_Handler
  18. {
  19.    public:
  20.        int handle_timeout(const ACE_Time_Value &CurrentTime, const void *ACT = NULL)
  21.        {
  22.            LauncherChecker::IpSet Ips = sLauncherChecker->GetIpList();
  23.            for(LauncherChecker::IpSet::const_iterator itr = Ips.begin(); itr != Ips.end(); ++itr)
  24.            {
  25.                if((*itr)->AddTime < (time(NULL) - 30)) // 1/2 minute
  26.                    sLauncherChecker->DeleteIp((*itr)->Ip);
  27.            }
  28.             return 0;      
  29.         }
  30. };
  31.  
  32. /// Print out the usage string for this program on the console.
  33. void usage(const char *prog)
  34. {
Add Comment
Please, Sign In to add comment