void ProtocolGame::sendLoginPacket(uint timestamp, uint8 unknown) { OutputMessage oMsg; oMsg.addU8(Proto::ClientEnterGame); oMsg.addU16(Proto::OsLinux); oMsg.addU16(Proto::ClientVersion); oMsg.addU8(0); // first RSA byte must be 0 // xtea key generateXteaKey(); oMsg.addU32(m_xteaKey[0]); oMsg.addU32(m_xteaKey[1]); oMsg.addU32(m_xteaKey[2]); oMsg.addU32(m_xteaKey[3]); oMsg.addU8(0); // is gm set? oMsg.addString(m_accountName); oMsg.addString(m_characterName); oMsg.addString(m_accountPassword); oMsg.addU32(timestamp); oMsg.addU8(unknown); // complete the 128 bytes for rsa encryption with zeros oMsg.addPaddingBytes(128 - (29 + m_accountName.length() + m_characterName.length() + m_accountPassword.length())); // encrypt with RSA Rsa::encrypt((char*)oMsg.getBuffer() + 6 + oMsg.getMessageSize() - 128, 128, Proto::RSA); send(oMsg); enableXteaEncryption(); }
void ProtocolLogin::sendLoginPacket() { OutputMessage oMsg; oMsg.addU8(Proto::ClientEnterAccount); oMsg.addU16(Proto::OsLinux); oMsg.addU16(Proto::ClientVersion); oMsg.addU32(g_thingsType.getSignature()); // data signature oMsg.addU32(g_sprites.getSignature()); // sprite signature oMsg.addU32(Proto::PicSignature); // pic signature oMsg.addU8(0); // first RSA byte must be 0 // xtea key generateXteaKey(); oMsg.addU32(m_xteaKey[0]); oMsg.addU32(m_xteaKey[1]); oMsg.addU32(m_xteaKey[2]); oMsg.addU32(m_xteaKey[3]); oMsg.addString(m_accountName); oMsg.addString(m_accountPassword); // complete the 128 bytes for rsa encryption with zeros oMsg.addPaddingBytes(128 - (21 + m_accountName.length() + m_accountPassword.length())); Rsa::encrypt((char*)oMsg.getBuffer() + InputMessage::DATA_POS + oMsg.getMessageSize() - 128, 128, Proto::RSA); send(oMsg); enableXteaEncryption(); recv(); }
void ProtocolGame::sendAttack(uint creatureId) { OutputMessage msg; msg.addU8(Proto::ClientAttack); msg.addU32(creatureId); msg.addU32(0); msg.addU32(0); send(msg); }
void ProtocolGame::sendRemoveVip(uint playerId) { OutputMessage msg; msg.addU8(Proto::ClientRemoveVip); msg.addU32(playerId); send(msg); }
void ProtocolGame::sendPassLeadership(uint creatureId) { OutputMessage msg; msg.addU8(Proto::ClientPassLeadership); msg.addU32(creatureId); send(msg); }
void ProtocolGame::sendRevokeInvitation(uint creatureId) { OutputMessage msg; msg.addU8(Proto::ClientRevokeInvitation); msg.addU32(creatureId); send(msg); }
void ProtocolGame::sendJoinParty(uint creatureId) { OutputMessage msg; msg.addU8(Proto::ClientJoinParty); msg.addU32(creatureId); send(msg); }
void ProtocolGame::sendFollow(uint creatureId) { OutputMessage msg; msg.addU8(Proto::ClientFollow); msg.addU32(creatureId); send(msg); }
void ProtocolGame::sendRemoveVip(uint playerId) { OutputMessage oMsg; oMsg.addU8(Proto::ClientRemoveBuddy); oMsg.addU32(playerId); send(oMsg); }
void ProtocolGame::sendInviteToParty(uint creatureId) { OutputMessage oMsg; oMsg.addU8(Proto::ClientInviteToParty); oMsg.addU32(creatureId); send(oMsg); }
void ProtocolGame::sendEditText(uint id, const std::string& text) { OutputMessage msg; msg.addU8(Proto::ClientEditText); msg.addU32(id); msg.addString(text); send(msg); }
void ProtocolGame::sendTextWindow(uint windowTextId, const std::string& text) { OutputMessage oMsg; oMsg.addU8(Proto::ClientEditText); oMsg.addU32(windowTextId); oMsg.addString(text); send(oMsg); }
void ProtocolGame::sendHouseWindow(int doorId, uint id, const std::string& text) { OutputMessage oMsg; oMsg.addU8(Proto::ClientEditList); oMsg.addU8(doorId); oMsg.addU32(id); oMsg.addString(text); send(oMsg); }
void ProtocolGame::sendUseOnCreature(const Position& pos, int thingId, int stackpos, uint creatureId) { OutputMessage msg; msg.addU8(Proto::ClientUseOnCreature); addPosition(msg, pos); msg.addU16(thingId); msg.addU8(stackpos); msg.addU32(creatureId); send(msg); }
void ProtocolGame::sendRequestTrade(const Position& pos, int thingId, int stackpos, uint playerId) { OutputMessage oMsg; oMsg.addU8(Proto::ClientTradeObject); addPosition(oMsg, pos); oMsg.addU16(thingId); oMsg.addU8(stackpos); oMsg.addU32(playerId); send(oMsg); }