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_RANDOM_NAME_LIST_INFO(BaseClient client, PacketIn packet) { GameClient cclient = client as GameClient; RandomNameInfo Info = BaseClient.ByteToType <RandomNameInfo>(packet); Random_name[] Names = CharMgr.GetRandomNames(); PacketOut Out = new PacketOut((byte)Opcodes.F_RANDOM_NAME_LIST_INFO); Out.WriteByte(0); Out.WriteByte(Info.Unk); Out.WriteByte(Info.Slot); Out.WriteUInt16(0); Out.WriteByte((byte)Names.Length); for (int i = Names.Length - 1; i >= 0; --i) { Out.FillString(Names[i].Name, Names[i].Name.Length + 1); } cclient.SendTCP(Out); }
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)); } }