void WorldSession::HandleGuildSetRankPermissions(WorldPackets::Guild::GuildSetRankPermissions& packet) { Guild* guild = GetPlayer()->GetGuild(); if (!guild) return; GuildBankRightsAndSlotsVec rightsAndSlots(GUILD_BANK_MAX_TABS); for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId) rightsAndSlots[tabId] = GuildBankRightsAndSlots(tabId, uint8(packet.TabFlags[tabId]), uint32(packet.TabWithdrawItemLimit[tabId])); TC_LOG_DEBUG("guild", "CMSG_GUILD_SET_RANK_PERMISSIONS [%s]: Rank: %s (%u)", GetPlayerInfo().c_str(), packet.RankName.c_str(), packet.RankOrder); guild->HandleSetRankInfo(this, packet.RankOrder, packet.RankName, packet.Flags, packet.WithdrawGoldLimit, rightsAndSlots); }
void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) { uint32 rankId; recvPacket >> rankId; uint32 rights; recvPacket >> rights; std::string rankName; recvPacket >> rankName; uint32 money; recvPacket >> money; TC_LOG_DEBUG(LOG_FILTER_GUILD, "CMSG_GUILD_RANK [%s]: Rank: %s (%u)", GetPlayerInfo().c_str(), rankName.c_str(), rankId); Guild* guild = GetPlayer()->GetGuild(); if (!guild) { recvPacket.rpos(recvPacket.wpos()); return; } GuildBankRightsAndSlotsVec rightsAndSlots(GUILD_BANK_MAX_TABS); for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId) { uint32 bankRights; uint32 slots; recvPacket >> bankRights; recvPacket >> slots; rightsAndSlots[tabId] = GuildBankRightsAndSlots(tabId, bankRights, slots); } guild->HandleSetRankInfo(this, rankId, rankName, rights, money, rightsAndSlots); }
void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) { uint32 BankStacks[GUILD_BANK_MAX_TABS]; for (uint32 i = 0; i < GUILD_BANK_MAX_TABS; i++) recvPacket >> BankStacks[i]; uint32 new_rights; recvPacket >> new_rights; uint32 new_rankId; recvPacket >> new_rankId; uint32 old_rankId; recvPacket >> old_rankId; uint32 BankRights[GUILD_BANK_MAX_TABS]; for (uint32 i = 0; i < GUILD_BANK_MAX_TABS; i++) recvPacket >> BankRights[i]; uint64 guildId; recvPacket >> guildId; uint32 old_rights; recvPacket >> old_rights; uint32 money; recvPacket >> money; uint64 playerGuid; recvPacket >> playerGuid; std::string rankName; recvPacket >> rankName; sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Received CMSG_GUILD_RANK"); if (GetPlayer()->GetGUID() != playerGuid) { printf("CMSG_GUILD_RANK: The playerGUID in the packet does not match the current player!\n"); recvPacket.rpos(recvPacket.wpos()); Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); return; } if (GetPlayer()->GetGuildId() != GUID_LOPART(guildId)) { printf("CMSG_GUILD_RANK: This player is not in the guild.\n"); recvPacket.rpos(recvPacket.wpos()); Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); return; } Guild* guild = _GetPlayerGuild(this, true); if (!guild) { recvPacket.rpos(recvPacket.wpos()); return; } GuildBankRightsAndSlotsVec rightsAndSlots(GUILD_BANK_MAX_TABS); if (old_rankId != GR_GUILDMASTER) { for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId) { rightsAndSlots[tabId] = GuildBankRightsAndSlots(BankRights[tabId], BankStacks[tabId]); } guild->HandleSetRankInfo(this, new_rankId, rankName, new_rights, money, rightsAndSlots); } if (old_rankId != new_rankId && old_rankId != GR_GUILDMASTER && new_rankId != GR_GUILDMASTER) guild->ChangeMemberRank(old_rankId, new_rankId); }
void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) { /* Packet Breakdown FF FF FF FF =>Bank permissions 1 FF FF FF FF =>Bank permissions 2 FF FF FF FF =>Bank permissions 3 FF FF FF FF =>Bank permissions 4 FF FF FF FF =>Bank permissions 5 FF FF FF FF =>Bank permissions 6 FF FF FF FF =>Bank permissions 7 FF FF FF FF =>Bank permissions 8 00 00 00 00 =>Bank withdrawal 1 00 00 00 00 =>Bank withdrawal 2 00 00 00 00 =>Bank withdrawal 3 00 00 00 00 =>Bank withdrawal 4 00 00 00 00 =>Bank withdrawal 5 00 00 00 00 =>Bank withdrawal 6 00 00 00 00 =>Bank withdrawal 7 00 00 00 00 =>Bank withdrawal 8 00 00 00 00 =>new rankID 00 00 00 00 =>last rankID 04 00 00 00 00 00 00 00 =>playerguid FF F1 1D 00 =>new permissions FF F1 1D 00 =>last permissions 02 00 00 00 00 00 F6 1F =>guildId FF FF FF FF =>max bank withdrawal 47 75 69 6C 64 20 4D 61 73 74 65 72 C2 B0 30 00 =>rankName */ uint32 BankRights[GUILD_BANK_MAX_TABS]; for(uint32 i = 0; i < GUILD_BANK_MAX_TABS; i++) recvPacket >> BankRights[i]; uint32 new_rights; recvPacket >> new_rights; uint32 new_rankId; recvPacket >> new_rankId; uint32 old_rankId; recvPacket >> old_rankId; uint32 BankStacks[GUILD_BANK_MAX_TABS]; for(uint32 i = 0; i < GUILD_BANK_MAX_TABS; i++) recvPacket >> BankStacks[i]; uint64 guildId; recvPacket >> guildId; uint32 old_rights; recvPacket >> old_rights; uint32 money; recvPacket >> money; uint64 playerGuid; recvPacket >> playerGuid; std::string rankName; recvPacket >> rankName; sLog->outDebug("WORLD: Received CMSG_GUILD_RANK"); if (GetPlayer()->GetGUID() != playerGuid) { printf("CMSG_GUILD_RANK: The playerGUID in the packet does not match the current player!\n"); recvPacket.rpos(recvPacket.wpos()); Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); return; } if (GetPlayer()->GetGuildId() != GUID_LOPART(guildId)) { printf("CMSG_GUILD_RANK: This player is not in the guild.\n"); recvPacket.rpos(recvPacket.wpos()); Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); return; } Guild* pGuild = _GetPlayerGuild(this, true); if (!pGuild) { recvPacket.rpos(recvPacket.wpos()); return; } GuildBankRightsAndSlotsVec rightsAndSlots(GUILD_BANK_MAX_TABS); if (old_rankId != GR_GUILDMASTER) { for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId) { rightsAndSlots[tabId] = GuildBankRightsAndSlots(uint8(old_rights), new_rights); } pGuild->HandleSetRankInfo(this, new_rankId, rankName, new_rights, money, rightsAndSlots); } if (old_rankId != new_rankId && old_rankId != GR_GUILDMASTER && new_rankId != GR_GUILDMASTER) pGuild->SwitchRank(old_rankId, new_rankId); }