void CUser::ReqKnightsPacket(Packet & pkt) { uint8 opcode; pkt >> opcode; switch (opcode) { case KNIGHTS_CREATE: CreateKnights(pkt, uid); break; case KNIGHTS_JOIN: JoinKnights(pkt, uid); break; case KNIGHTS_WITHDRAW: WithdrawKnights(pkt, uid); break; case KNIGHTS_REMOVE: case KNIGHTS_ADMIT: case KNIGHTS_REJECT: case KNIGHTS_CHIEF: case KNIGHTS_VICECHIEF: case KNIGHTS_OFFICER: case KNIGHTS_PUNISH: ModifyKnightsMember(pkt, opcode, uid); break; case KNIGHTS_DESTROY: DestroyKnights(pkt, uid); break; case KNIGHTS_MEMBER_REQ: AllKnightsMember(pkt, uid); break; case KNIGHTS_LIST_REQ: KnightsList(pkt, uid); break; case KNIGHTS_ALLLIST_REQ: m_DBAgent.LoadKnightsAllList(pkt.read<uint8>()); // read nation break; case KNIGHTS_MARK_REGISTER: RegisterClanSymbol(pkt, uid); break; } }
// TODO: Move this to the CUser class. void CKnightsManager::PacketProcess(CUser *pUser, Packet & pkt) { if (pUser == nullptr) return; uint8 opcode = pkt.read<uint8>(); TRACE("Clan packet: %X\n", opcode); switch (opcode) { case KNIGHTS_CREATE: CreateKnights(pUser, pkt); break; case KNIGHTS_JOIN: JoinKnights(pUser, pkt); break; case KNIGHTS_WITHDRAW: WithdrawKnights(pUser, pkt); break; case KNIGHTS_REMOVE: case KNIGHTS_ADMIT: case KNIGHTS_REJECT: case KNIGHTS_CHIEF: case KNIGHTS_VICECHIEF: case KNIGHTS_OFFICER: case KNIGHTS_PUNISH: ModifyKnightsMember(pUser, pkt, opcode); break; case KNIGHTS_HANDOVER_VICECHIEF_LIST: ModifyKnightsLeader(pUser, pkt, opcode); break; case KNIGHTS_HANDOVER_REQ: ModifyKnightsLeader(pUser, pkt, opcode); break; case KNIGHTS_HANDOVER: ModifyKnightsLeader(pUser, pkt, opcode); break; case KNIGHTS_POINT_METHOD: ModifyKnightsPointMethod(pUser, pkt); break; case KNIGHTS_DESTROY: DestroyKnights(pUser); break; case KNIGHTS_ALLLIST_REQ: AllKnightsList(pUser, pkt); break; case KNIGHTS_MEMBER_REQ: AllKnightsMember(pUser); break; case KNIGHTS_CURRENT_REQ: CurrentKnightsMember(pUser, pkt); break; case KNIGHTS_JOIN_REQ: JoinKnightsReq(pUser, pkt); break; case KNIGHTS_MARK_REGISTER: RegisterClanSymbol(pUser, pkt); break; case KNIGHTS_MARK_VERSION_REQ: RequestClanSymbolVersion(pUser, pkt); break; case KNIGHTS_MARK_REGION_REQ: RequestClanSymbols(pUser, pkt); break; case KNIGHTS_MARK_REQ: GetClanSymbol(pUser, pkt.read<uint16>()); break; case KNIGHTS_ALLY_CREATE: //KnightsAllianceCreate(pUser, pkt); break; case KNIGHTS_ALLY_REQ: //KnightsAllianceRequest(pUser, pkt); break; case KNIGHTS_ALLY_INSERT: //KnightsAllianceInsert(pUser, pkt); break; case KNIGHTS_ALLY_REMOVE: //KnightsAllianceRemove(pUser, pkt); break; case KNIGHTS_ALLY_PUNISH: //KnightsAlliancePunish(pUser, pkt); break; case KNIGHTS_ALLY_LIST: KnightsAllianceList(pUser, pkt); break; case KNIGHTS_TOP10: ListTop10Clans(pUser); break; case KNIGHTS_POINT_REQ: DonateNPReq(pUser, pkt); break; case KNIGHTS_DONATE_POINTS: DonateNP(pUser, pkt); break; case KNIGHTS_DONATION_LIST: DonationList(pUser, pkt); break; default: TRACE("Unhandled clan system opcode: %X\n", opcode); } }
// TO-DO: Move this to the CUser class. void CKnightsManager::PacketProcess(CUser *pUser, Packet & pkt) { if (pUser == NULL) return; uint8 opcode = pkt.read<uint8>(); TRACE("Clan packet: %X\n", opcode); switch (opcode) { case KNIGHTS_CREATE: CreateKnights(pUser, pkt); break; case KNIGHTS_JOIN: JoinKnights(pUser, pkt); break; case KNIGHTS_WITHDRAW: WithdrawKnights(pUser, pkt); break; case KNIGHTS_REMOVE: case KNIGHTS_ADMIT: case KNIGHTS_REJECT: case KNIGHTS_CHIEF: case KNIGHTS_VICECHIEF: case KNIGHTS_OFFICER: case KNIGHTS_PUNISH: ModifyKnightsMember(pUser, pkt, opcode); break; case KNIGHTS_DESTROY: DestroyKnights(pUser); break; case KNIGHTS_ALLLIST_REQ: AllKnightsList(pUser, pkt); break; case KNIGHTS_MEMBER_REQ: AllKnightsMember(pUser); break; case KNIGHTS_CURRENT_REQ: CurrentKnightsMember(pUser, pkt); break; case KNIGHTS_JOIN_REQ: JoinKnightsReq(pUser, pkt); break; case KNIGHTS_MARK_REGISTER: RegisterClanSymbol(pUser, pkt); break; case KNIGHTS_MARK_VERSION_REQ: RequestClanSymbolVersion(pUser, pkt); break; case KNIGHTS_MARK_REGION_REQ: RequestClanSymbols(pUser, pkt); break; case KNIGHTS_MARK_REQ: GetClanSymbol(pUser, pkt.read<uint16>()); break; case KNIGHTS_TOP10: ListTop10Clans(pUser); break; case KNIGHTS_DONATE_POINTS: break; case KNIGHTS_POINT_REQ: break; case KNIGHTS_ALLY_LIST: break; default: TRACE("Unhandled clan system opcode: %X\n", opcode); } }