public static void F_ENCRYPTKEY(BaseClient client, PacketIn packet) { GameClient cclient = (GameClient)client; sEncrypt result = BaseClient.ByteToType <sEncrypt>(packet); string version = result.major + "." + result.minor + "." + result.revision; Log.Debug("F_ENCRYPTKEY", "Version = " + version); // Should be a connection to the remote client. //Log.Debug("F_ENCRYPTKEY", "Client Ip = " + cclient.); if (result.cipher == 0) { PacketOut Out = new PacketOut((byte)Opcodes.F_RECEIVE_ENCRYPTKEY, 1); Out.WriteByte(1); cclient.SendPacket(Out); } else if (result.cipher == 1) { byte[] encryptKey = new byte[256]; packet.Read(encryptKey, 0, encryptKey.Length); cclient.AddCrypt("RC4Crypto", new CryptKey(encryptKey), new CryptKey(encryptKey)); } }
static public void F_ENCRYPTKEY(BaseClient client, PacketIn packet) { GameClient cclient = client as GameClient; sEncrypt Result = BaseClient.ByteToType <sEncrypt>(packet); string Version = Result.major + "." + Result.minor + "." + Result.revision; Log.Debug("F_ENCRYPTKEY", "Version = " + Version); if (Result.cipher == 0) { PacketOut Out = new PacketOut((byte)Opcodes.F_RECEIVE_ENCRYPTKEY); Out.WriteByte(1); cclient.SendPacket(Out); } else if (Result.cipher == 1) { byte[] EncryptKey = new byte[256]; packet.Read(EncryptKey, 0, EncryptKey.Length); cclient.AddCrypt("RC4Crypto", new CryptKey(EncryptKey), new CryptKey(EncryptKey)); } }