Guest User

Untitled

a guest
Nov 23rd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.72 KB | None | 0 0
  1. ++ b/src/server/authserver/Server/AuthSocket.h
  2. @@ -23,6 +23,59 @@
  3. #include "BigNumber.h"
  4. #include "RealmSocket.h"
  5.  
  6. #include <ace/Singleton.h>
  7. #include <ace/Null_Mutex.h>
  8. #include <set>
  9. #include <string>
  10. #include <time.h> // time
  11.  
  12. typedef struct IP
  13. {
  14.    std::string Ip;
  15.    time_t      AddTime;
  16. } sIP;
  17.  
  18. class LauncherChecker
  19. {
  20.    friend class ACE_Singleton<LauncherChecker, ACE_Null_Mutex>;
  21.  
  22.    public:
  23.  
  24.        typedef std::set<sIP*> IpSet;
  25.  
  26.        LauncherChecker() : m_IpList() {};
  27.        ~LauncherChecker() {};
  28.  
  29.        static LauncherChecker* instance() { return ACE_Singleton<LauncherChecker, ACE_Null_Mutex>::instance(); }
  30.  
  31.         void AddIp(sIP *Ip) { m_IpList.insert(Ip); }
  32.        void DeleteIp(const std::string &Ip)
  33.        {
  34.            for(IpSet::iterator itr = m_IpList.begin(); itr != m_IpList.end(); ++itr)
  35.            {
  36.                if(Ip == (*itr)->Ip)
  37.                {
  38.                    delete *itr;
  39.                    m_IpList.erase(itr);
  40.                    break;
  41.                }
  42.            }
  43.        }
  44.        bool CheckIp(const std::string &Ip) const
  45.        {
  46.            for(IpSet::const_iterator itr = m_IpList.begin(); itr != m_IpList.end(); ++itr)
  47.                 if(Ip == (*itr)->Ip)
  48.                    return true;  
  49.             return false;
  50.        }
  51.         IpSet GetIpList() const { return m_IpList; }
  52.  
  53.    private:
  54.        IpSet m_IpList;
  55. };
  56.  
  57. #define sLauncherChecker LauncherChecker::instance()
  58.  
  59. enum RealmFlags
  60. {
  61.     REALM_FLAG_NONE                              = 0x00,
  62. @@ -54,6 +107,7 @@ public:
  63.     bool _HandleReconnectChallenge();
  64.     bool _HandleReconnectProof();
  65.     bool _HandleRealmList();
  66.     bool _HandleLauncherValidation();
  67.  
  68.     //data transfer handle for patch
  69.     bool _HandleXferResume();
Add Comment
Please, Sign In to add comment