예제 #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);
 }
예제 #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);
 }
예제 #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));
 }
예제 #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));
 }
예제 #5
0
 public static void SetupCrypto(uint seed)
 {
     if (m_Decompress)
     {
         m_CryptoProvider = new GameCrypto(seed);
     }
     else
     {
         m_CryptoProvider = new LoginCrypto(seed);
     }
 }
예제 #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;
 }
예제 #7
0
 public static void EnableUnpacking()
 {
     m_Decompress     = true;
     m_CryptoProvider = null;
 }
예제 #8
0
 public static void SetupCrypto(uint seed)
 {
     if (m_Decompress)
     {
         m_CryptoProvider = new GameCrypto(seed);
     }
     else
     {
         m_CryptoProvider = new LoginCrypto(seed);
     }
 }
예제 #9
0
 public static void EnableUnpacking()
 {
     m_Decompress = true;
     m_CryptoProvider = null;
 }
예제 #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;
 }