// *************************************************************** // Function: ClientSeed.cpp // *************************************************************** #include "Main.h" //************************************ // Name: HandleOpcode_CLIENT_SEED // // Sends the key packet reply the client // // Parameters: // pData - Network message // pLir - Player's data // // Return: // - Size of packet //************************************ int HandleOpcode_CLIENT_SEED(NetMessage* pData, PLAYER_DATA* pLir) { //Create an encryption state that will be used by the encryption function ENCRYPTION_STATE e; e.offset1=0; e.offset2=0; memset(e.key, 0, 264); //memcpy(e.key, keybak, 264); gpGameServer->SetEncryptionState(pData->networkId, &e); CompiledPacket pck; pck.AddShort(ServerOpcode(1)); pck.Fill(0, 20); NetMessage s; s.networkId=pData->networkId; s.pData=pck.GetString(&s.dataSize); BIT_SET(s.flags, NETMESS_BOOL_DEL); gpGameServer->SendData(&s); pck.Clear(); //enable cryptography pLir->establishedEncryptedConnection=true; gCoreLog.debug("Encrypted connection established!"); return 66; }