Esempio n. 1
0
 public ServerSync(ServerProfile server, AccountProfile account, ShardProfile shard)
 {
     this.m_Server         = server;
     this.m_Account        = account;
     this.m_Shard          = shard;
     this.m_Buffer         = new byte[0x800];
     this.m_CryptoProvider = new LoginCrypto((uint)Network.ClientIP);
     Dns.BeginResolve(server.Address, new AsyncCallback(this.OnResolve), null);
 }
Esempio n. 2
0
 public ServerSync(ServerProfile server, AccountProfile account, ShardProfile shard)
 {
     this.m_Server = server;
     this.m_Account = account;
     this.m_Shard = shard;
     this.m_Buffer = new byte[0x800];
     this.m_CryptoProvider = new LoginCrypto((uint) Network.ClientIP);
     Dns.BeginResolve(server.Address, new AsyncCallback(this.OnResolve), null);
 }
Esempio n. 3
0
 public ShardSync(ServerProfile server, AccountProfile account, ShardProfile shard)
 {
     this.m_Server = server;
     this.m_Account = account;
     this.m_Shard = shard;
     this.m_Compressed = new byte[0x800];
     this.m_Buffer = new byte[0x800];
     this.m_CryptoProvider = new GameCrypto((uint) shard.Auth);
     this.Connect(new IPEndPoint(shard.Address, shard.Port));
 }
Esempio n. 4
0
 public ShardSync(ServerProfile server, AccountProfile account, ShardProfile shard)
 {
     this.m_Server         = server;
     this.m_Account        = account;
     this.m_Shard          = shard;
     this.m_Compressed     = new byte[0x800];
     this.m_Buffer         = new byte[0x800];
     this.m_CryptoProvider = new GameCrypto((uint)shard.Auth);
     this.Connect(new IPEndPoint(shard.Address, shard.Port));
 }
Esempio n. 5
0
 public static void SetupCrypto(uint seed)
 {
     if (m_Decompress)
     {
         m_CryptoProvider = new GameCrypto(seed);
     }
     else
     {
         m_CryptoProvider = new LoginCrypto(seed);
     }
 }
Esempio n. 6
0
 public static void Close()
 {
     Flush();
     if (m_Server != null)
     {
         try
         {
             m_Server.Shutdown(SocketShutdown.Both);
         }
         catch
         {
         }
         try
         {
             m_Server.Close();
         }
         catch
         {
         }
         m_Server = null;
     }
     if (m_Logger != null)
     {
         m_Logger.WriteLine();
         m_Logger.WriteLine("#####\tEnding packet log on {0}\t#####", DateTime.Now);
         m_Logger.Flush();
         m_Logger.Close();
         m_Logger = null;
     }
     if (m_Protocol != null)
     {
         m_Protocol.WriteLine();
         m_Protocol.WriteLine("#####\tEnding protocol log on {0}\t#####", DateTime.Now);
         m_Protocol.Flush();
         m_Protocol.Close();
         m_Protocol = null;
     }
     m_ServerIP       = null;
     m_ServerIPEP     = null;
     m_ServerHost     = null;
     m_Tree           = null;
     m_Buffer         = null;
     OnRecv           = null;
     OnSend           = null;
     OnPacketHandle   = null;
     m_Table          = null;
     m_UnpackBuffer   = null;
     m_OutputBuffer   = null;
     m_CryptoProvider = null;
 }
Esempio n. 7
0
 public static void EnableUnpacking()
 {
     m_Decompress     = true;
     m_CryptoProvider = null;
 }
Esempio n. 8
0
 public static void SetupCrypto(uint seed)
 {
     if (m_Decompress)
     {
         m_CryptoProvider = new GameCrypto(seed);
     }
     else
     {
         m_CryptoProvider = new LoginCrypto(seed);
     }
 }
Esempio n. 9
0
 public static void EnableUnpacking()
 {
     m_Decompress = true;
     m_CryptoProvider = null;
 }
Esempio n. 10
0
 public static void Close()
 {
     Flush();
     if (m_Server != null)
     {
         try
         {
             m_Server.Shutdown(SocketShutdown.Both);
         }
         catch
         {
         }
         try
         {
             m_Server.Close();
         }
         catch
         {
         }
         m_Server = null;
     }
     if (m_Logger != null)
     {
         m_Logger.WriteLine();
         m_Logger.WriteLine("#####\tEnding packet log on {0}\t#####", DateTime.Now);
         m_Logger.Flush();
         m_Logger.Close();
         m_Logger = null;
     }
     if (m_Protocol != null)
     {
         m_Protocol.WriteLine();
         m_Protocol.WriteLine("#####\tEnding protocol log on {0}\t#####", DateTime.Now);
         m_Protocol.Flush();
         m_Protocol.Close();
         m_Protocol = null;
     }
     m_ServerIP = null;
     m_ServerIPEP = null;
     m_ServerHost = null;
     m_Tree = null;
     m_Buffer = null;
     OnRecv = null;
     OnSend = null;
     OnPacketHandle = null;
     m_Table = null;
     m_UnpackBuffer = null;
     m_OutputBuffer = null;
     m_CryptoProvider = null;
 }