Core/Guild: Code Refactor

- Send correct events when modifiying Ranks (Add, modify, delete)
- Store money/slots withdraw, not remaining slots. This will update remaining slots/money properly.
- Reset daily slots/money withdraw for all members at same time, configurable
- Better debug messages
This commit is contained in:
Spp
2012-11-02 22:26:10 +01:00
parent 3ee840a9be
commit 58ec4e5319
38 changed files with 1893 additions and 1709 deletions
@@ -0,0 +1,30 @@
CREATE TABLE IF NOT EXISTS `guild_member_withdraw` (
`guid` int(10) unsigned NOT NULL,
`tab0` int(10) unsigned NOT NULL DEFAULT '0',
`tab1` int(10) unsigned NOT NULL DEFAULT '0',
`tab2` int(10) unsigned NOT NULL DEFAULT '0',
`tab3` int(10) unsigned NOT NULL DEFAULT '0',
`tab4` int(10) unsigned NOT NULL DEFAULT '0',
`tab5` int(10) unsigned NOT NULL DEFAULT '0',
`money` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Guild Member Daily Withdraws';
ALTER TABLE `guild_member` DROP COLUMN `BankRemMoney`;
ALTER TABLE `guild_member` DROP COLUMN `BankRemSlotsTab0`;
ALTER TABLE `guild_member` DROP COLUMN `BankRemSlotsTab1`;
ALTER TABLE `guild_member` DROP COLUMN `BankRemSlotsTab2`;
ALTER TABLE `guild_member` DROP COLUMN `BankRemSlotsTab3`;
ALTER TABLE `guild_member` DROP COLUMN `BankRemSlotsTab4`;
ALTER TABLE `guild_member` DROP COLUMN `BankRemSlotsTab5`;
ALTER TABLE `guild_member` DROP COLUMN `BankResetTimeMoney`;
ALTER TABLE `guild_member` DROP COLUMN `BankResetTimeTab0`;
ALTER TABLE `guild_member` DROP COLUMN `BankResetTimeTab1`;
ALTER TABLE `guild_member` DROP COLUMN `BankResetTimeTab2`;
ALTER TABLE `guild_member` DROP COLUMN `BankResetTimeTab3`;
ALTER TABLE `guild_member` DROP COLUMN `BankResetTimeTab4`;
ALTER TABLE `guild_member` DROP COLUMN `BankResetTimeTab5`;
DELETE FROM `worldstates` WHERE `entry`=20006;
INSERT INTO `worldstates` (`entry`,`value`,`comment`) VALUES (20006,0, 'Guild daily reset');
@@ -95,12 +95,12 @@ void WorldSession::SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason)
} }
//Send by client when he click on accept for queue //Send by client when he click on accept for queue
void WorldSession::HandleBfQueueInviteResponse(WorldPacket & recv_data) void WorldSession::HandleBfQueueInviteResponse(WorldPacket & recvData)
{ {
uint32 BattleId; uint32 BattleId;
uint8 Accepted; uint8 Accepted;
recv_data >> BattleId >> Accepted; recvData >> BattleId >> Accepted;
sLog->outError(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted); sLog->outError(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted);
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId); Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
if (!Bf) if (!Bf)
@@ -113,12 +113,12 @@ void WorldSession::HandleBfQueueInviteResponse(WorldPacket & recv_data)
} }
//Send by client on clicking in accept or refuse of invitation windows for join game //Send by client on clicking in accept or refuse of invitation windows for join game
void WorldSession::HandleBfEntryInviteResponse(WorldPacket & recv_data) void WorldSession::HandleBfEntryInviteResponse(WorldPacket & recvData)
{ {
uint32 BattleId; uint32 BattleId;
uint8 Accepted; uint8 Accepted;
recv_data >> BattleId >> Accepted; recvData >> BattleId >> Accepted;
sLog->outError(LOG_FILTER_GENERAL, "HandleBattlefieldInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted); sLog->outError(LOG_FILTER_GENERAL, "HandleBattlefieldInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted);
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId); Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
if (!Bf) if (!Bf)
@@ -136,11 +136,11 @@ void WorldSession::HandleBfEntryInviteResponse(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleBfExitRequest(WorldPacket & recv_data) void WorldSession::HandleBfExitRequest(WorldPacket & recvData)
{ {
uint32 BattleId; uint32 BattleId;
recv_data >> BattleId; recvData >> BattleId;
sLog->outError(LOG_FILTER_GENERAL, "HandleBfExitRequest: BattleID:%u ", BattleId); sLog->outError(LOG_FILTER_GENERAL, "HandleBfExitRequest: BattleID:%u ", BattleId);
Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId); Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId);
if (!Bf) if (!Bf)
+1 -3
View File
@@ -472,8 +472,6 @@ LfgCompatibility LFGQueue::CheckCompatibility(LfgGuidList check)
if (numPlayers != MAXGROUPSIZE) if (numPlayers != MAXGROUPSIZE)
{ {
sLog->outDebug(LOG_FILTER_LFG, "LFGQueue::CheckCompatibility: (%s) Compatibles but not enough players(%u)", strGuids.c_str(), numPlayers); sLog->outDebug(LOG_FILTER_LFG, "LFGQueue::CheckCompatibility: (%s) Compatibles but not enough players(%u)", strGuids.c_str(), numPlayers);
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(check.front());
LfgCompatibilityData data(LFG_COMPATIBLES_WITH_LESS_PLAYERS); LfgCompatibilityData data(LFG_COMPATIBLES_WITH_LESS_PLAYERS);
data.roles = proposalRoles; data.roles = proposalRoles;
@@ -677,4 +675,4 @@ void LFGQueue::UpdateBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQu
else else
--queueData.dps; --queueData.dps;
} }
} }
+12 -1
View File
@@ -3022,6 +3022,9 @@ void Player::GiveLevel(uint8 level)
if (level == oldLevel) if (level == oldLevel)
return; return;
if (Guild* guild = GetGuild())
guild->UpdateMemberData(this, GUILD_MEMBER_DATA_LEVEL, level);
PlayerLevelInfo info; PlayerLevelInfo info;
sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), level, &info); sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), level, &info);
@@ -7446,6 +7449,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
sBattlefieldMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId); sBattlefieldMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
sBattlefieldMgr->HandlePlayerEnterZone(this, newZone); sBattlefieldMgr->HandlePlayerEnterZone(this, newZone);
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange... SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
if (Guild* guild = GetGuild())
guild->UpdateMemberData(this, GUILD_MEMBER_DATA_ZONEID, newZone);
} }
// group update // group update
@@ -21517,7 +21522,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply)
//cycle all equipped items //cycle all equipped items
for (int slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot) for (int slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot)
{ {
//enchants for the slot being socketed are handled by WorldSession::HandleSocketOpcode(WorldPacket& recv_data) //enchants for the slot being socketed are handled by WorldSession::HandleSocketOpcode(WorldPacket& recvData)
if (slot == exceptslot) if (slot == exceptslot)
continue; continue;
@@ -25583,3 +25588,9 @@ void Player::SendMovementSetFeatherFall(bool apply)
data << uint32(0); //! movement counter data << uint32(0); //! movement counter
SendDirectMessage(&data); SendDirectMessage(&data);
} }
Guild* Player::GetGuild()
{
uint32 guildId = GetGuildId();
return guildId ? sGuildMgr->GetGuildById(guildId) : NULL;
}
+4 -2
View File
@@ -46,6 +46,7 @@ class Channel;
class Creature; class Creature;
class DynamicObject; class DynamicObject;
class Group; class Group;
class Guild;
class OutdoorPvP; class OutdoorPvP;
class Pet; class Pet;
class PlayerMenu; class PlayerMenu;
@@ -1819,9 +1820,10 @@ class Player : public Unit, public GridObject<Player>
void SetInGuild(uint32 GuildId) { SetUInt32Value(PLAYER_GUILDID, GuildId); } void SetInGuild(uint32 GuildId) { SetUInt32Value(PLAYER_GUILDID, GuildId); }
void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); }
uint8 GetRank() { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); } uint8 GetRank() const { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); }
void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; } void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; }
uint32 GetGuildId() { return GetUInt32Value(PLAYER_GUILDID); } uint32 GetGuildId() const { return GetUInt32Value(PLAYER_GUILDID); }
Guild* GetGuild();
static uint32 GetGuildIdFromDB(uint64 guid); static uint32 GetGuildIdFromDB(uint64 guid);
static uint8 GetRankFromDB(uint64 guid); static uint8 GetRankFromDB(uint64 guid);
int GetGuildIdInvited() { return m_GuildIdInvited; } int GetGuildIdInvited() { return m_GuildIdInvited; }
File diff suppressed because it is too large Load Diff
+223 -145
View File
@@ -37,7 +37,14 @@ enum GuildMisc
GUILD_RANK_NONE = 0xFF, GUILD_RANK_NONE = 0xFF,
GUILD_WITHDRAW_MONEY_UNLIMITED = 0xFFFFFFFF, GUILD_WITHDRAW_MONEY_UNLIMITED = 0xFFFFFFFF,
GUILD_WITHDRAW_SLOT_UNLIMITED = 0xFFFFFFFF, GUILD_WITHDRAW_SLOT_UNLIMITED = 0xFFFFFFFF,
GUILD_EVENT_LOG_GUID_UNDEFINED = 0xFFFFFFFF GUILD_EVENT_LOG_GUID_UNDEFINED = 0xFFFFFFFF,
TAB_UNDEFINED = 0xFF,
};
enum GuildMemberData
{
GUILD_MEMBER_DATA_ZONEID,
GUILD_MEMBER_DATA_LEVEL,
}; };
enum GuildDefaultRanks enum GuildDefaultRanks
@@ -54,87 +61,97 @@ enum GuildDefaultRanks
enum GuildRankRights enum GuildRankRights
{ {
GR_RIGHT_EMPTY = 0x00000040, GR_RIGHT_EMPTY = 0x00000040,
GR_RIGHT_GCHATLISTEN = GR_RIGHT_EMPTY | 0x00000001, GR_RIGHT_GCHATLISTEN = GR_RIGHT_EMPTY | 0x00000001,
GR_RIGHT_GCHATSPEAK = GR_RIGHT_EMPTY | 0x00000002, GR_RIGHT_GCHATSPEAK = GR_RIGHT_EMPTY | 0x00000002,
GR_RIGHT_OFFCHATLISTEN = GR_RIGHT_EMPTY | 0x00000004, GR_RIGHT_OFFCHATLISTEN = GR_RIGHT_EMPTY | 0x00000004,
GR_RIGHT_OFFCHATSPEAK = GR_RIGHT_EMPTY | 0x00000008, GR_RIGHT_OFFCHATSPEAK = GR_RIGHT_EMPTY | 0x00000008,
GR_RIGHT_INVITE = GR_RIGHT_EMPTY | 0x00000010, GR_RIGHT_INVITE = GR_RIGHT_EMPTY | 0x00000010,
GR_RIGHT_REMOVE = GR_RIGHT_EMPTY | 0x00000020, GR_RIGHT_REMOVE = GR_RIGHT_EMPTY | 0x00000020,
GR_RIGHT_PROMOTE = GR_RIGHT_EMPTY | 0x00000080, GR_RIGHT_PROMOTE = GR_RIGHT_EMPTY | 0x00000080,
GR_RIGHT_DEMOTE = GR_RIGHT_EMPTY | 0x00000100, GR_RIGHT_DEMOTE = GR_RIGHT_EMPTY | 0x00000100,
GR_RIGHT_SETMOTD = GR_RIGHT_EMPTY | 0x00001000, GR_RIGHT_SETMOTD = GR_RIGHT_EMPTY | 0x00001000,
GR_RIGHT_EPNOTE = GR_RIGHT_EMPTY | 0x00002000, GR_RIGHT_EPNOTE = GR_RIGHT_EMPTY | 0x00002000,
GR_RIGHT_VIEWOFFNOTE = GR_RIGHT_EMPTY | 0x00004000, GR_RIGHT_VIEWOFFNOTE = GR_RIGHT_EMPTY | 0x00004000,
GR_RIGHT_EOFFNOTE = GR_RIGHT_EMPTY | 0x00008000, GR_RIGHT_EOFFNOTE = GR_RIGHT_EMPTY | 0x00008000,
GR_RIGHT_MODIFY_GUILD_INFO = GR_RIGHT_EMPTY | 0x00010000, GR_RIGHT_MODIFY_GUILD_INFO = GR_RIGHT_EMPTY | 0x00010000,
GR_RIGHT_WITHDRAW_GOLD_LOCK = 0x00020000, // remove money withdraw capacity GR_RIGHT_WITHDRAW_GOLD_LOCK = 0x00020000, // remove money withdraw capacity
GR_RIGHT_WITHDRAW_REPAIR = 0x00040000, // withdraw for repair GR_RIGHT_WITHDRAW_REPAIR = 0x00040000, // withdraw for repair
GR_RIGHT_WITHDRAW_GOLD = 0x00080000, // withdraw gold GR_RIGHT_WITHDRAW_GOLD = 0x00080000, // withdraw gold
GR_RIGHT_CREATE_GUILD_EVENT = 0x00100000, // wotlk GR_RIGHT_CREATE_GUILD_EVENT = 0x00100000, // wotlk
GR_RIGHT_ALL = 0x001DF1FF GR_RIGHT_ALL = 0x001DF1FF
}; };
enum GuildCommandType enum GuildCommandType
{ {
GUILD_CREATE_S = 0x00, GUILD_COMMAND_CREATE = 0,
GUILD_INVITE_S = 0x01, GUILD_COMMAND_INVITE = 1,
GUILD_QUIT_S = 0x03, GUILD_COMMAND_QUIT = 3,
GUILD_FOUNDER_S = 0x0E, GUILD_COMMAND_ROSTER = 5,
GUILD_UNK1 = 0x13, GUILD_COMMAND_PROMOTE = 6,
GUILD_UNK2 = 0x14 GUILD_COMMAND_DEMOTE = 7,
GUILD_COMMAND_REMOVE = 8,
GUILD_COMMAND_CHANGE_LEADER = 10,
GUILD_COMMAND_EDIT_MOTD = 11,
GUILD_COMMAND_GUILD_CHAT = 13,
GUILD_COMMAND_FOUNDER = 14,
GUILD_COMMAND_CHANGE_RANK = 16,
GUILD_COMMAND_PUBLIC_NOTE = 19,
GUILD_COMMAND_VIEW_TAB = 21,
GUILD_COMMAND_MOVE_ITEM = 22,
GUILD_COMMAND_REPAIR = 25,
}; };
enum GuildCommandError enum GuildCommandError
{ {
ERR_PLAYER_NO_MORE_IN_GUILD = 0x00, ERR_GUILD_COMMAND_SUCCESS = 0,
ERR_GUILD_INTERNAL = 0x01, ERR_GUILD_INTERNAL = 1,
ERR_ALREADY_IN_GUILD = 0x02, ERR_ALREADY_IN_GUILD = 2,
ERR_ALREADY_IN_GUILD_S = 0x03, ERR_ALREADY_IN_GUILD_S = 3,
ERR_INVITED_TO_GUILD = 0x04, ERR_INVITED_TO_GUILD = 4,
ERR_ALREADY_INVITED_TO_GUILD_S = 0x05, ERR_ALREADY_INVITED_TO_GUILD_S = 5,
ERR_GUILD_NAME_INVALID = 0x06, ERR_GUILD_NAME_INVALID = 6,
ERR_GUILD_NAME_EXISTS_S = 0x07, ERR_GUILD_NAME_EXISTS_S = 7,
ERR_GUILD_LEADER_LEAVE = 0x08, ERR_GUILD_LEADER_LEAVE = 8,
ERR_GUILD_PERMISSIONS = 0x08, ERR_GUILD_PERMISSIONS = 8,
ERR_GUILD_PLAYER_NOT_IN_GUILD = 0x09, ERR_GUILD_PLAYER_NOT_IN_GUILD = 9,
ERR_GUILD_PLAYER_NOT_IN_GUILD_S = 0x0A, ERR_GUILD_PLAYER_NOT_IN_GUILD_S = 10,
ERR_GUILD_PLAYER_NOT_FOUND_S = 0x0B, ERR_GUILD_PLAYER_NOT_FOUND_S = 11,
ERR_GUILD_NOT_ALLIED = 0x0C, ERR_GUILD_NOT_ALLIED = 12,
ERR_GUILD_RANK_TOO_HIGH_S = 0x0D, ERR_GUILD_RANK_TOO_HIGH_S = 13,
ERR_GUILD_RANK_TOO_LOW_S = 0x0E, ERR_GUILD_RANK_TOO_LOW_S = 14,
ERR_GUILD_RANKS_LOCKED = 0x11, ERR_GUILD_RANKS_LOCKED = 17,
ERR_GUILD_RANK_IN_USE = 0x12, ERR_GUILD_RANK_IN_USE = 18,
ERR_GUILD_IGNORING_YOU_S = 0x13, ERR_GUILD_IGNORING_YOU_S = 19,
ERR_GUILD_UNK1 = 0x14, ERR_GUILD_UNK1 = 20, // Forces roster update
ERR_GUILD_WITHDRAW_LIMIT = 0x19, ERR_GUILD_WITHDRAW_LIMIT = 25,
ERR_GUILD_NOT_ENOUGH_MONEY = 0x1A, ERR_GUILD_NOT_ENOUGH_MONEY = 26,
ERR_GUILD_BANK_FULL = 0x1C, ERR_GUILD_BANK_FULL = 28,
ERR_GUILD_ITEM_NOT_FOUND = 0x1D ERR_GUILD_ITEM_NOT_FOUND = 29,
}; };
enum GuildEvents enum GuildEvents
{ {
GE_PROMOTION = 0x00, GE_PROMOTION = 0,
GE_DEMOTION = 0x01, GE_DEMOTION = 1,
GE_MOTD = 0x02, GE_MOTD = 2,
GE_JOINED = 0x03, GE_JOINED = 3,
GE_LEFT = 0x04, GE_LEFT = 4,
GE_REMOVED = 0x05, GE_REMOVED = 5,
GE_LEADER_IS = 0x06, GE_LEADER_IS = 6,
GE_LEADER_CHANGED = 0x07, GE_LEADER_CHANGED = 7,
GE_DISBANDED = 0x08, GE_DISBANDED = 8,
GE_TABARDCHANGE = 0x09, GE_TABARDCHANGE = 9,
GE_UNK1 = 0x0A, // string, string EVENT_GUILD_ROSTER_UPDATE tab content change? GE_RANK_UPDATED = 10,
GE_UNK2 = 0x0B, // EVENT_GUILD_ROSTER_UPDATE GE_RANK_DELETED = 11,
GE_SIGNED_ON = 0x0C, // ERR_FRIEND_ONLINE_SS GE_SIGNED_ON = 12,
GE_SIGNED_OFF = 0x0D, // ERR_FRIEND_OFFLINE_S GE_SIGNED_OFF = 13,
GE_GUILDBANK_BAGSLOTS_CHANGED = 0x0E, // EVENT_GUILDBANK_BAGSLOTS_CHANGED GE_GUILDBANKBAGSLOTS_CHANGED = 14,
GE_GUILDBANK_TAB_PURCHASED = 0x0F, // EVENT_GUILDBANK_UPDATE_TABS GE_BANK_TAB_PURCHASED = 15,
GE_UNK5 = 0x10, // EVENT_GUILDBANK_UPDATE_TABS GE_BANK_TAB_UPDATED = 16,
GE_GUILDBANK_MONEY_UPDATE = 0x11, // EVENT_GUILDBANK_UPDATE_MONEY, string 0000000000002710 is 1 gold GE_BANK_MONEY_SET = 17,
GE_GUILDBANK_MONEY_WITHDRAWN = 0x12, // MSG_GUILD_BANK_MONEY_WITHDRAWN GE_BANK_MONEY_CHANGED = 18,
GE_GUILDBANK_TEXT_CHANGED = 0x13 // EVENT_GUILDBANK_TEXT_CHANGED GE_BANK_TEXT_CHANGED = 19,
}; };
enum PetitionTurns enum PetitionTurns
@@ -146,44 +163,44 @@ enum PetitionTurns
enum PetitionSigns enum PetitionSigns
{ {
PETITION_SIGN_OK = 0, PETITION_SIGN_OK = 0,
PETITION_SIGN_ALREADY_SIGNED = 1, PETITION_SIGN_ALREADY_SIGNED = 1,
PETITION_SIGN_ALREADY_IN_GUILD = 2, PETITION_SIGN_ALREADY_IN_GUILD = 2,
PETITION_SIGN_CANT_SIGN_OWN = 3, PETITION_SIGN_CANT_SIGN_OWN = 3,
PETITION_SIGN_NOT_SERVER = 4 PETITION_SIGN_NOT_SERVER = 4
}; };
enum GuildBankRights enum GuildBankRights
{ {
GUILD_BANK_RIGHT_VIEW_TAB = 0x01, GUILD_BANK_RIGHT_VIEW_TAB = 0x01,
GUILD_BANK_RIGHT_PUT_ITEM = 0x02, GUILD_BANK_RIGHT_PUT_ITEM = 0x02,
GUILD_BANK_RIGHT_UPDATE_TEXT = 0x04, GUILD_BANK_RIGHT_UPDATE_TEXT = 0x04,
GUILD_BANK_RIGHT_DEPOSIT_ITEM = GUILD_BANK_RIGHT_VIEW_TAB | GUILD_BANK_RIGHT_PUT_ITEM, GUILD_BANK_RIGHT_DEPOSIT_ITEM = GUILD_BANK_RIGHT_VIEW_TAB | GUILD_BANK_RIGHT_PUT_ITEM,
GUILD_BANK_RIGHT_FULL = 0xFF GUILD_BANK_RIGHT_FULL = 0xFF
}; };
enum GuildBankEventLogTypes enum GuildBankEventLogTypes
{ {
GUILD_BANK_LOG_DEPOSIT_ITEM = 1, GUILD_BANK_LOG_DEPOSIT_ITEM = 1,
GUILD_BANK_LOG_WITHDRAW_ITEM = 2, GUILD_BANK_LOG_WITHDRAW_ITEM = 2,
GUILD_BANK_LOG_MOVE_ITEM = 3, GUILD_BANK_LOG_MOVE_ITEM = 3,
GUILD_BANK_LOG_DEPOSIT_MONEY = 4, GUILD_BANK_LOG_DEPOSIT_MONEY = 4,
GUILD_BANK_LOG_WITHDRAW_MONEY = 5, GUILD_BANK_LOG_WITHDRAW_MONEY = 5,
GUILD_BANK_LOG_REPAIR_MONEY = 6, GUILD_BANK_LOG_REPAIR_MONEY = 6,
GUILD_BANK_LOG_MOVE_ITEM2 = 7, GUILD_BANK_LOG_MOVE_ITEM2 = 7,
GUILD_BANK_LOG_UNK1 = 8, GUILD_BANK_LOG_UNK1 = 8,
GUILD_BANK_LOG_UNK2 = 9 GUILD_BANK_LOG_BUY_SLOT = 9
}; };
enum GuildEventLogTypes enum GuildEventLogTypes
{ {
GUILD_EVENT_LOG_INVITE_PLAYER = 1, GUILD_EVENT_LOG_INVITE_PLAYER = 1,
GUILD_EVENT_LOG_JOIN_GUILD = 2, GUILD_EVENT_LOG_JOIN_GUILD = 2,
GUILD_EVENT_LOG_PROMOTE_PLAYER = 3, GUILD_EVENT_LOG_PROMOTE_PLAYER = 3,
GUILD_EVENT_LOG_DEMOTE_PLAYER = 4, GUILD_EVENT_LOG_DEMOTE_PLAYER = 4,
GUILD_EVENT_LOG_UNINVITE_PLAYER = 5, GUILD_EVENT_LOG_UNINVITE_PLAYER = 5,
GUILD_EVENT_LOG_LEAVE_GUILD = 6 GUILD_EVENT_LOG_LEAVE_GUILD = 6
}; };
enum GuildEmblemError enum GuildEmblemError
@@ -196,7 +213,15 @@ enum GuildEmblemError
ERR_GUILDEMBLEM_INVALIDVENDOR = 5 ERR_GUILDEMBLEM_INVALIDVENDOR = 5
}; };
//////////////////////////////////////////////////////////////////////////////////////////// enum GuildMemberFlags
{
GUILDMEMBER_STATUS_NONE = 0x0000,
GUILDMEMBER_STATUS_ONLINE = 0x0001,
GUILDMEMBER_STATUS_AFK = 0x0002,
GUILDMEMBER_STATUS_DND = 0x0004,
GUILDMEMBER_STATUS_MOBILE = 0x0008, // remote chat from mobile app
};
// Emblem info // Emblem info
class EmblemInfo class EmblemInfo
{ {
@@ -205,7 +230,7 @@ public:
void LoadFromDB(Field* fields); void LoadFromDB(Field* fields);
void SaveToDB(uint32 guildId) const; void SaveToDB(uint32 guildId) const;
void ReadPacket(WorldPacket& recv) { recv >> m_style >> m_color >> m_borderStyle >> m_borderColor >> m_backgroundColor; } void ReadPacket(WorldPacket& recv);
void WritePacket(WorldPacket& data) const; void WritePacket(WorldPacket& data) const;
uint32 GetStyle() const { return m_style; } uint32 GetStyle() const { return m_style; }
@@ -223,21 +248,33 @@ private:
}; };
// Structure for storing guild bank rights and remaining slots together. // Structure for storing guild bank rights and remaining slots together.
struct GuildBankRightsAndSlots class GuildBankRightsAndSlots
{ {
GuildBankRightsAndSlots() : rights(0), slots(0) { } public:
GuildBankRightsAndSlots(uint8 _rights, uint32 _slots) : rights(_rights), slots(_slots) { } GuildBankRightsAndSlots() : tabId(TAB_UNDEFINED), rights(0), slots(0) { }
GuildBankRightsAndSlots(uint8 _tabId) : tabId(_tabId), rights(0), slots(0) { }
GuildBankRightsAndSlots(uint8 _tabId, uint8 _rights, uint32 _slots) : tabId(_tabId), rights(_rights), slots(_slots) { }
inline bool IsEqual(GuildBankRightsAndSlots const& rhs) const { return rights == rhs.rights && slots == rhs.slots; }
void SetGuildMasterValues() void SetGuildMasterValues()
{ {
rights = GUILD_BANK_RIGHT_FULL; rights = GUILD_BANK_RIGHT_FULL;
slots = uint32(GUILD_WITHDRAW_SLOT_UNLIMITED); slots = uint32(GUILD_WITHDRAW_SLOT_UNLIMITED);
} }
void SetTabId(uint8 _tabId) { tabId = _tabId; }
void SetSlots(uint32 _slots) { slots = _slots; }
void SetRights(uint8 _rights) { rights = _rights; }
int8 GetTabId() const { return tabId; }
int32 GetSlots() const { return slots; }
int8 GetRights() const { return rights; }
private:
uint8 tabId;
uint8 rights; uint8 rights;
uint32 slots; uint32 slots;
}; };
typedef std::vector <GuildBankRightsAndSlots> GuildBankRightsAndSlotsVec; typedef std::vector <GuildBankRightsAndSlots> GuildBankRightsAndSlotsVec;
typedef std::set <uint8> SlotIds; typedef std::set <uint8> SlotIds;
@@ -248,16 +285,19 @@ private:
// Class representing guild member // Class representing guild member
class Member class Member
{ {
struct RemainingValue
{
RemainingValue() : value(0), resetTime(0) { }
uint32 value;
uint32 resetTime;
};
public: public:
Member(uint32 guildId, uint64 guid, uint8 rankId) : m_guildId(guildId), m_guid(guid), m_logoutTime(::time(NULL)), m_rankId(rankId) { } Member(uint32 guildId, uint64 guid, uint8 rankId):
m_guildId(guildId),
m_guid(guid),
m_zoneId(0),
m_level(0),
m_class(0),
m_logoutTime(::time(NULL)),
m_accountId(0),
m_rankId(rankId)
{
memset(m_bankWithdraw, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(int32));
}
void SetStats(Player* player); void SetStats(Player* player);
void SetStats(std::string const& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId); void SetStats(std::string const& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId);
@@ -265,6 +305,12 @@ private:
void SetPublicNote(std::string const& publicNote); void SetPublicNote(std::string const& publicNote);
void SetOfficerNote(std::string const& officerNote); void SetOfficerNote(std::string const& officerNote);
void SetZoneID(uint32 id) { m_zoneId = id; }
void SetLevel(uint8 var) { m_level = var; }
void AddFlag(uint8 var) { m_flags |= var; }
void RemFlag(uint8 var) { m_flags &= ~var; }
void ResetFlags() { m_flags = GUILDMEMBER_STATUS_NONE; }
bool LoadFromDB(Field* fields); bool LoadFromDB(Field* fields);
void SaveToDB(SQLTransaction& trans) const; void SaveToDB(SQLTransaction& trans) const;
@@ -274,6 +320,14 @@ private:
std::string const& GetName() const { return m_name; } std::string const& GetName() const { return m_name; }
uint32 GetAccountId() const { return m_accountId; } uint32 GetAccountId() const { return m_accountId; }
uint8 GetRankId() const { return m_rankId; } uint8 GetRankId() const { return m_rankId; }
uint64 GetLogoutTime() const { return m_logoutTime; }
std::string GetPublicNote() const { return m_publicNote; }
std::string GetOfficerNote() const { return m_officerNote; }
uint8 GetClass() const { return m_class; }
uint8 GetLevel() const { return m_level; }
uint8 GetFlags() const { return m_flags; }
uint32 GetZoneId() const { return m_zoneId; }
bool IsOnline() { return (m_flags & GUILDMEMBER_STATUS_ONLINE); }
void ChangeRank(uint8 newRank); void ChangeRank(uint8 newRank);
@@ -282,11 +336,9 @@ private:
inline bool IsRankNotLower(uint8 rankId) const { return m_rankId <= rankId; } inline bool IsRankNotLower(uint8 rankId) const { return m_rankId <= rankId; }
inline bool IsSamePlayer(uint64 guid) const { return m_guid == guid; } inline bool IsSamePlayer(uint64 guid) const { return m_guid == guid; }
void DecreaseBankRemainingValue(SQLTransaction& trans, uint8 tabId, uint32 amount); void UpdateBankWithdrawValue(SQLTransaction& trans, uint8 tabId, uint32 amount);
uint32 GetBankRemainingValue(uint8 tabId, const Guild* guild) const; int32 GetBankWithdrawValue(uint8 tabId) const;
void ResetValues();
void ResetTabTimes();
void ResetMoneyTime();
inline Player* FindPlayer() const { return ObjectAccessor::FindPlayer(m_guid); } inline Player* FindPlayer() const { return ObjectAccessor::FindPlayer(m_guid); }
@@ -296,16 +348,17 @@ private:
uint64 m_guid; uint64 m_guid;
std::string m_name; std::string m_name;
uint32 m_zoneId; uint32 m_zoneId;
uint8 m_level; uint8 m_level;
uint8 m_class; uint8 m_class;
uint8 m_flags;
uint64 m_logoutTime; uint64 m_logoutTime;
uint32 m_accountId; uint32 m_accountId;
// Fields from guild_member table // Fields from guild_member table
uint8 m_rankId; uint8 m_rankId;
std::string m_publicNote; std::string m_publicNote;
std::string m_officerNote; std::string m_officerNote;
RemainingValue m_bankRemaining[GUILD_BANK_MAX_TABS + 1]; int32 m_bankWithdraw[GUILD_BANK_MAX_TABS + 1];
}; };
// Base class for event entries // Base class for event entries
@@ -317,6 +370,7 @@ private:
virtual ~LogEntry() { } virtual ~LogEntry() { }
uint32 GetGUID() const { return m_guid; } uint32 GetGUID() const { return m_guid; }
uint64 GetTimestamp() const { return m_timestamp; }
virtual void SaveToDB(SQLTransaction& trans) const = 0; virtual void SaveToDB(SQLTransaction& trans) const = 0;
virtual void WritePacket(WorldPacket& data) const = 0; virtual void WritePacket(WorldPacket& data) const = 0;
@@ -384,6 +438,8 @@ private:
}; };
// Class encapsulating work with events collection // Class encapsulating work with events collection
typedef std::list<LogEntry*> GuildLog;
class LogHolder class LogHolder
{ {
public: public:
@@ -402,17 +458,17 @@ private:
uint32 GetNextGUID(); uint32 GetNextGUID();
private: private:
typedef std::list<LogEntry*> GuildLog;
GuildLog m_log; GuildLog m_log;
uint32 m_guildId; uint32 m_guildId;
uint32 m_maxRecords; uint32 m_maxRecords;
uint32 m_nextGUID; uint32 m_nextGUID;
}; };
// Class incapsulating guild rank data // Class encapsulating guild rank data
class RankInfo class RankInfo
{ {
public: public:
RankInfo(): m_guildId(0), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { }
RankInfo(uint32 guildId) : m_guildId(guildId), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { } RankInfo(uint32 guildId) : m_guildId(guildId), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { }
RankInfo(uint32 guildId, uint8 rankId, std::string const& name, uint32 rights, uint32 money) : RankInfo(uint32 guildId, uint8 rankId, std::string const& name, uint32 rights, uint32 money) :
m_guildId(guildId), m_rankId(rankId), m_name(name), m_rights(rights), m_bankMoneyPerDay(money) { } m_guildId(guildId), m_rankId(rankId), m_name(name), m_rights(rights), m_bankMoneyPerDay(money) { }
@@ -429,17 +485,22 @@ private:
uint32 GetRights() const { return m_rights; } uint32 GetRights() const { return m_rights; }
void SetRights(uint32 rights); void SetRights(uint32 rights);
uint32 GetBankMoneyPerDay() const { return m_rankId == GR_GUILDMASTER ? GUILD_WITHDRAW_MONEY_UNLIMITED : m_bankMoneyPerDay; } int32 GetBankMoneyPerDay() const { return m_bankMoneyPerDay; }
void SetBankMoneyPerDay(uint32 money); void SetBankMoneyPerDay(uint32 money);
inline uint8 GetBankTabRights(uint8 tabId) const { return tabId < GUILD_BANK_MAX_TABS ? m_bankTabRightsAndSlots[tabId].rights : 0; } inline int8 GetBankTabRights(uint8 tabId) const
inline uint32 GetBankTabSlotsPerDay(uint8 tabId) const
{ {
if (tabId < GUILD_BANK_MAX_TABS) return tabId < GUILD_BANK_MAX_TABS ? m_bankTabRightsAndSlots[tabId].GetRights() : 0;
return m_rankId == GR_GUILDMASTER ? GUILD_WITHDRAW_SLOT_UNLIMITED : m_bankTabRightsAndSlots[tabId].slots;
return 0;
} }
void SetBankTabSlotsAndRights(uint8 tabId, GuildBankRightsAndSlots rightsAndSlots, bool saveToDB);
inline int32 GetBankTabSlotsPerDay(uint8 tabId) const
{
return tabId < GUILD_BANK_MAX_TABS ? m_bankTabRightsAndSlots[tabId].GetSlots() : 0;
}
void SetBankTabSlotsAndRights(GuildBankRightsAndSlots rightsAndSlots, bool saveToDB);
bool CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& trans);
private: private:
uint32 m_guildId; uint32 m_guildId;
@@ -459,12 +520,12 @@ private:
memset(m_items, 0, GUILD_BANK_MAX_SLOTS * sizeof(Item*)); memset(m_items, 0, GUILD_BANK_MAX_SLOTS * sizeof(Item*));
} }
bool LoadFromDB(Field* fields); void LoadFromDB(Field* fields);
bool LoadItemFromDB(Field* fields); bool LoadItemFromDB(Field* fields);
void Delete(SQLTransaction& trans, bool removeItemsFromDB = false); void Delete(SQLTransaction& trans, bool removeItemsFromDB = false);
void WritePacket(WorldPacket& data) const; void WritePacket(WorldPacket& data) const;
void WriteSlotPacket(WorldPacket& data, uint8 slotId) const; bool WriteSlotPacket(WorldPacket& data, uint8 slotId, bool ignoreEmpty = true) const;
void WriteInfoPacket(WorldPacket& data) const void WriteInfoPacket(WorldPacket& data) const
{ {
data << m_name; data << m_name;
@@ -523,6 +584,7 @@ private:
Item* GetItem(bool isCloned = false) const { return isCloned ? m_pClonedItem : m_pItem; } Item* GetItem(bool isCloned = false) const { return isCloned ? m_pClonedItem : m_pItem; }
uint8 GetContainer() const { return m_container; } uint8 GetContainer() const { return m_container; }
uint8 GetSlotId() const { return m_slotId; } uint8 GetSlotId() const { return m_slotId; }
protected: protected:
virtual InventoryResult CanStore(Item* pItem, bool swap) = 0; virtual InventoryResult CanStore(Item* pItem, bool swap) = 0;
@@ -612,22 +674,26 @@ public:
void HandleRemoveMember(WorldSession* session, std::string const& name); void HandleRemoveMember(WorldSession* session, std::string const& name);
void HandleUpdateMemberRank(WorldSession* session, std::string const& name, bool demote); void HandleUpdateMemberRank(WorldSession* session, std::string const& name, bool demote);
void HandleAddNewRank(WorldSession* session, std::string const& name); void HandleAddNewRank(WorldSession* session, std::string const& name);
void HandleRemoveRank(WorldSession* session, uint8 rankId);
void HandleRemoveLowestRank(WorldSession* session); void HandleRemoveLowestRank(WorldSession* session);
void HandleMemberDepositMoney(WorldSession* session, uint32 amount); void HandleMemberDepositMoney(WorldSession* session, uint32 amount);
bool HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair = false); bool HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair = false);
void HandleMemberLogout(WorldSession* session); void HandleMemberLogout(WorldSession* session);
void HandleDisband(WorldSession* session); void HandleDisband(WorldSession* session);
void UpdateMemberData(Player* player, uint8 dataid, uint32 value);
void OnPlayerStatusChange(Player* player, uint32 flag, bool state);
// Send info to client // Send info to client
void SendInfo(WorldSession* session) const; void SendInfo(WorldSession* session) const;
void SendEventLog(WorldSession* session) const; void SendEventLog(WorldSession* session) const;
void SendBankLog(WorldSession* session, uint8 tabId) const; void SendBankLog(WorldSession* session, uint8 tabId) const;
void SendBankTabsInfo(WorldSession* session) const; void SendBankTabsInfo(WorldSession* session, bool showTabs = false) const;
void SendBankTabData(WorldSession* session, uint8 tabId) const; void SendBankTabData(WorldSession* session, uint8 tabId) const;
void SendBankTabText(WorldSession* session, uint8 tabId) const; void SendBankTabText(WorldSession* session, uint8 tabId) const;
void SendPermissions(WorldSession* session) const; void SendPermissions(WorldSession* session) const;
void SendMoneyInfo(WorldSession* session) const; void SendMoneyInfo(WorldSession* session) const;
void SendLoginInfo(WorldSession* session) const; void SendLoginInfo(WorldSession* session);
// Load from DB // Load from DB
bool LoadFromDB(Field* fields); bool LoadFromDB(Field* fields);
@@ -635,7 +701,7 @@ public:
bool LoadMemberFromDB(Field* fields); bool LoadMemberFromDB(Field* fields);
bool LoadEventLogFromDB(Field* fields); bool LoadEventLogFromDB(Field* fields);
void LoadBankRightFromDB(Field* fields); void LoadBankRightFromDB(Field* fields);
bool LoadBankTabFromDB(Field* fields); void LoadBankTabFromDB(Field* fields);
bool LoadBankEventLogFromDB(Field* fields); bool LoadBankEventLogFromDB(Field* fields);
bool LoadBankItemFromDB(Field* fields); bool LoadBankItemFromDB(Field* fields);
bool Validate(); bool Validate();
@@ -667,6 +733,8 @@ public:
// Bank tabs // Bank tabs
void SetBankTabText(uint8 tabId, std::string const& text); void SetBankTabText(uint8 tabId, std::string const& text);
void ResetTimes();
protected: protected:
uint32 m_id; uint32 m_id;
std::string m_name; std::string m_name;
@@ -691,7 +759,14 @@ private:
inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); } inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); }
inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; } inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; }
inline RankInfo* GetRankInfo(uint8 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; } inline RankInfo* GetRankInfo(uint8 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; }
inline bool _HasRankRight(Player* player, uint32 right) const { return (_GetRankRights(player->GetRank()) & right) != GR_RIGHT_EMPTY; } inline bool _HasRankRight(Player* player, uint32 right) const
{
if (player)
if (Member const* member = GetMember(player->GetGUID()))
return (_GetRankRights(member->GetRankId()) & right) != GR_RIGHT_EMPTY;
return false;
}
inline uint8 _GetLowestRankId() const { return uint8(m_ranks.size() - 1); } inline uint8 _GetLowestRankId() const { return uint8(m_ranks.size() - 1); }
inline uint8 _GetPurchasedTabsSize() const { return uint8(m_bankTabs.size()); } inline uint8 _GetPurchasedTabsSize() const { return uint8(m_bankTabs.size()); }
@@ -703,20 +778,22 @@ private:
Members::const_iterator itr = m_members.find(GUID_LOPART(guid)); Members::const_iterator itr = m_members.find(GUID_LOPART(guid));
return itr != m_members.end() ? itr->second : NULL; return itr != m_members.end() ? itr->second : NULL;
} }
inline Member* GetMember(uint64 guid) inline Member* GetMember(uint64 guid)
{ {
Members::iterator itr = m_members.find(GUID_LOPART(guid)); Members::iterator itr = m_members.find(GUID_LOPART(guid));
return itr != m_members.end() ? itr->second : NULL; return itr != m_members.end() ? itr->second : NULL;
} }
inline Member* GetMember(WorldSession* session, std::string const& name)
inline Member* GetMember(std::string const& name)
{ {
for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr) for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->second->GetName() == name) if (itr->second->GetName() == name)
return itr->second; return itr->second;
SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD_S, name);
return NULL; return NULL;
} }
inline void _DeleteMemberFromDB(uint32 lowguid) const inline void _DeleteMemberFromDB(uint32 lowguid) const
{ {
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBER); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBER);
@@ -727,11 +804,11 @@ private:
// Creates log holders (either when loading or when creating guild) // Creates log holders (either when loading or when creating guild)
void _CreateLogHolders(); void _CreateLogHolders();
// Tries to create new bank tab // Tries to create new bank tab
bool _CreateNewBankTab(); void _CreateNewBankTab();
// Creates default guild ranks with names in given locale // Creates default guild ranks with names in given locale
void _CreateDefaultGuildRanks(LocaleConstant loc); void _CreateDefaultGuildRanks(LocaleConstant loc);
// Creates new rank // Creates new rank
void _CreateRank(std::string const& name, uint32 rights); bool _CreateRank(std::string const& name, uint32 rights);
// Update account number when member added/removed from guild // Update account number when member added/removed from guild
void _UpdateAccountsNumber(); void _UpdateAccountsNumber();
bool _IsLeader(Player* player) const; bool _IsLeader(Player* player) const;
@@ -740,16 +817,16 @@ private:
void _SetLeaderGUID(Member* pLeader); void _SetLeaderGUID(Member* pLeader);
void _SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay); void _SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay);
void _SetRankBankTabRightsAndSlots(uint8 rankId, uint8 tabId, GuildBankRightsAndSlots rightsAndSlots, bool saveToDB = true); void _SetRankBankTabRightsAndSlots(uint8 rankId, GuildBankRightsAndSlots rightsAndSlots, bool saveToDB = true);
uint8 _GetRankBankTabRights(uint8 rankId, uint8 tabId) const; int8 _GetRankBankTabRights(uint8 rankId, uint8 tabId) const;
uint32 _GetRankRights(uint8 rankId) const; uint32 _GetRankRights(uint8 rankId) const;
uint32 _GetRankBankMoneyPerDay(uint8 rankId) const; int32 _GetRankBankMoneyPerDay(uint8 rankId) const;
uint32 _GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const; int32 _GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const;
std::string _GetRankName(uint8 rankId) const; std::string _GetRankName(uint8 rankId) const;
uint32 _GetMemberRemainingSlots(uint64 guid, uint8 tabId) const; int32 _GetMemberRemainingSlots(Member const* member, uint8 tabId) const;
uint32 _GetMemberRemainingMoney(uint64 guid) const; int32 _GetMemberRemainingMoney(Member const* member) const;
void _DecreaseMemberRemainingSlots(SQLTransaction& trans, uint64 guid, uint8 tabId); void _UpdateMemberWithdrawSlots(SQLTransaction& trans, uint64 guid, uint8 tabId);
bool _MemberHasTabRights(uint64 guid, uint8 tabId, uint32 rights) const; bool _MemberHasTabRights(uint64 guid, uint8 tabId, uint32 rights) const;
void _LogEvent(GuildEventLogTypes eventType, uint32 playerGuid1, uint32 playerGuid2 = 0, uint8 newRank = 0); void _LogEvent(GuildEventLogTypes eventType, uint32 playerGuid1, uint32 playerGuid2 = 0, uint8 newRank = 0);
@@ -764,6 +841,7 @@ private:
void _SendBankMoneyUpdate(WorldSession* session) const; void _SendBankMoneyUpdate(WorldSession* session) const;
void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const; void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const;
void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const; void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const;
void _SendBankList(WorldSession* session = NULL, uint8 tabId = 0, bool sendFullSlots = false, SlotIds *slots = NULL) const;
void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const; void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const;
}; };
+31 -24
View File
@@ -18,10 +18,8 @@
#include "Common.h" #include "Common.h"
#include "GuildMgr.h" #include "GuildMgr.h"
GuildMgr::GuildMgr() GuildMgr::GuildMgr() : NextGuildId(1)
{ { }
NextGuildId = 1;
}
GuildMgr::~GuildMgr() GuildMgr::~GuildMgr()
{ {
@@ -121,6 +119,7 @@ void GuildMgr::LoadGuilds()
delete guild; delete guild;
continue; continue;
} }
AddGuild(guild); AddGuild(guild);
++count; ++count;
@@ -172,21 +171,18 @@ void GuildMgr::LoadGuilds()
// Delete orphaned guild member entries before loading the valid ones // Delete orphaned guild member entries before loading the valid ones
CharacterDatabase.DirectExecute("DELETE gm FROM guild_member gm LEFT JOIN guild g ON gm.guildId = g.guildId WHERE g.guildId IS NULL"); CharacterDatabase.DirectExecute("DELETE gm FROM guild_member gm LEFT JOIN guild g ON gm.guildId = g.guildId WHERE g.guildId IS NULL");
CharacterDatabase.DirectExecute("DELETE gm FROM guild_member_withdraw gm LEFT JOIN guild_member g ON gm.guid = g.guid WHERE g.guid IS NULL");
// 0 1 2 3 4 5 6 // 0 1 2 3 4 5 6 7 8 9 10
QueryResult result = CharacterDatabase.Query("SELECT guildid, gm.guid, rank, pnote, offnote, BankResetTimeMoney, BankRemMoney, " QueryResult result = CharacterDatabase.Query("SELECT guildid, gm.guid, rank, pnote, offnote, w.tab0, w.tab1, w.tab2, w.tab3, w.tab4, w.tab5, "
// 7 8 9 10 11 12 // 11 12 13 14 15 16 17
"BankResetTimeTab0, BankRemSlotsTab0, BankResetTimeTab1, BankRemSlotsTab1, BankResetTimeTab2, BankRemSlotsTab2, " "w.money, c.name, c.level, c.class, c.zone, c.account, c.logout_time "
// 13 14 15 16 17 18 "FROM guild_member gm "
"BankResetTimeTab3, BankRemSlotsTab3, BankResetTimeTab4, BankRemSlotsTab4, BankResetTimeTab5, BankRemSlotsTab5, " "LEFT JOIN guild_member_withdraw w ON gm.guid = w.guid "
// 19 20 21 22 23 24 "LEFT JOIN characters c ON c.guid = gm.guid ORDER BY guildid ASC");
"c.name, c.level, c.class, c.zone, c.account, c.logout_time "
"FROM guild_member gm LEFT JOIN characters c ON c.guid = gm.guid ORDER BY guildid ASC");
if (!result) if (!result)
{
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild members. DB table `guild_member` is empty."); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild members. DB table `guild_member` is empty.");
}
else else
{ {
uint32 count = 0; uint32 count = 0;
@@ -215,7 +211,7 @@ void GuildMgr::LoadGuilds()
// Delete orphaned guild bank right entries before loading the valid ones // Delete orphaned guild bank right entries before loading the valid ones
CharacterDatabase.DirectExecute("DELETE gbr FROM guild_bank_right gbr LEFT JOIN guild g ON gbr.guildId = g.guildId WHERE g.guildId IS NULL"); CharacterDatabase.DirectExecute("DELETE gbr FROM guild_bank_right gbr LEFT JOIN guild g ON gbr.guildId = g.guildId WHERE g.guildId IS NULL");
// 0 1 2 3 4 // 0 1 2 3 4
QueryResult result = CharacterDatabase.Query("SELECT guildid, TabId, rid, gbright, SlotPerDay FROM guild_bank_right ORDER BY guildid ASC, TabId ASC"); QueryResult result = CharacterDatabase.Query("SELECT guildid, TabId, rid, gbright, SlotPerDay FROM guild_bank_right ORDER BY guildid ASC, TabId ASC");
if (!result) if (!result)
@@ -382,20 +378,31 @@ void GuildMgr::LoadGuilds()
sLog->outInfo(LOG_FILTER_GUILD, "Validating data of loaded guilds..."); sLog->outInfo(LOG_FILTER_GUILD, "Validating data of loaded guilds...");
{ {
uint32 oldMSTime = getMSTime(); uint32 oldMSTime = getMSTime();
std::set<Guild*> rm; // temporary storage to avoid modifying GuildStore with RemoveGuild() while iterating
for (GuildContainer::iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr) for (GuildContainer::iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr)
{ {
Guild* guild = itr->second; Guild* guild = itr->second;
if (guild) if (guild && !guild->Validate())
{ rm.insert(guild);
if (!guild->Validate()) }
{
RemoveGuild(guild->GetId()); for (std::set<Guild*>::iterator itr = rm.begin(); itr != rm.end(); ++itr)
delete guild; {
} Guild* guild = *itr;
} RemoveGuild(guild->GetId());
delete guild;
} }
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime)); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime));
} }
} }
void GuildMgr::ResetTimes()
{
for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr)
if (Guild* guild = itr->second)
guild->ResetTimes();
CharacterDatabase.DirectExecute("TRUNCATE guild_member_withdraw");
}
+3 -2
View File
@@ -23,13 +23,12 @@
class GuildMgr class GuildMgr
{ {
friend class ACE_Singleton<GuildMgr, ACE_Null_Mutex>; friend class ACE_Singleton<GuildMgr, ACE_Null_Mutex>;
private: private:
GuildMgr(); GuildMgr();
~GuildMgr(); ~GuildMgr();
public: public:
typedef UNORDERED_MAP<uint32, Guild*> GuildContainer;
Guild* GetGuildByLeader(uint64 guid) const; Guild* GetGuildByLeader(uint64 guid) const;
Guild* GetGuildById(uint32 guildId) const; Guild* GetGuildById(uint32 guildId) const;
Guild* GetGuildByName(std::string const& guildName) const; Guild* GetGuildByName(std::string const& guildName) const;
@@ -42,7 +41,9 @@ public:
uint32 GenerateGuildId(); uint32 GenerateGuildId();
void SetNextGuildId(uint32 Id) { NextGuildId = Id; } void SetNextGuildId(uint32 Id) { NextGuildId = Id; }
void ResetTimes();
protected: protected:
typedef UNORDERED_MAP<uint32, Guild*> GuildContainer;
uint32 NextGuildId; uint32 NextGuildId;
GuildContainer GuildStore; GuildContainer GuildStore;
}; };
@@ -152,7 +152,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recvData)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_INVITE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_INVITE");
} }
void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_ACCEPT"); // empty opcode sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_ACCEPT"); // empty opcode
@@ -185,7 +185,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/)
arenaTeam->BroadcastEvent(ERR_ARENA_TEAM_JOIN_SS, _player->GetGUID(), 2, _player->GetName(), arenaTeam->GetName(), ""); arenaTeam->BroadcastEvent(ERR_ARENA_TEAM_JOIN_SS, _player->GetGUID(), 2, _player->GetName(), arenaTeam->GetName(), "");
} }
void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket & /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DECLINE"); // empty opcode sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DECLINE"); // empty opcode
@@ -33,10 +33,10 @@
//post-incrementation is always slower than pre-incrementation ! //post-incrementation is always slower than pre-incrementation !
//void called when player click on auctioneer npc //void called when player click on auctioneer npc
void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data) void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recvData)
{ {
uint64 guid; //NPC guid uint64 guid; //NPC guid
recv_data >> guid; recvData >> guid;
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!unit) if (!unit)
@@ -113,12 +113,12 @@ void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction)
} }
//this void creates new auction and adds auction to some auctionhouse //this void creates new auction and adds auction to some auctionhouse
void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) void WorldSession::HandleAuctionSellItem(WorldPacket & recvData)
{ {
uint64 auctioneer; uint64 auctioneer;
uint32 itemsCount, etime, bid, buyout; uint32 itemsCount, etime, bid, buyout;
recv_data >> auctioneer; recvData >> auctioneer;
recv_data >> itemsCount; recvData >> itemsCount;
uint64 itemGUIDs[MAX_AUCTION_ITEMS]; // 160 slot = 4x 36 slot bag + backpack 16 slot uint64 itemGUIDs[MAX_AUCTION_ITEMS]; // 160 slot = 4x 36 slot bag + backpack 16 slot
uint32 count[MAX_AUCTION_ITEMS]; uint32 count[MAX_AUCTION_ITEMS];
@@ -131,16 +131,16 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
for (uint32 i = 0; i < itemsCount; ++i) for (uint32 i = 0; i < itemsCount; ++i)
{ {
recv_data >> itemGUIDs[i]; recvData >> itemGUIDs[i];
recv_data >> count[i]; recvData >> count[i];
if (!itemGUIDs[i] || !count[i] || count[i] > 1000 ) if (!itemGUIDs[i] || !count[i] || count[i] > 1000 )
return; return;
} }
recv_data >> bid; recvData >> bid;
recv_data >> buyout; recvData >> buyout;
recv_data >> etime; recvData >> etime;
if (!bid || !etime) if (!bid || !etime)
return; return;
@@ -354,15 +354,15 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
} }
//this function is called when client bids or buys out auction //this function is called when client bids or buys out auction
void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) void WorldSession::HandleAuctionPlaceBid(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_PLACE_BID"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_PLACE_BID");
uint64 auctioneer; uint64 auctioneer;
uint32 auctionId; uint32 auctionId;
uint32 price; uint32 price;
recv_data >> auctioneer; recvData >> auctioneer;
recv_data >> auctionId >> price; recvData >> auctionId >> price;
if (!auctionId || !price) if (!auctionId || !price)
return; //check for cheaters return; //check for cheaters
@@ -481,14 +481,14 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
} }
//this void is called when auction_owner cancels his auction //this void is called when auction_owner cancels his auction
void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_REMOVE_ITEM"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_REMOVE_ITEM");
uint64 auctioneer; uint64 auctioneer;
uint32 auctionId; uint32 auctionId;
recv_data >> auctioneer; recvData >> auctioneer;
recv_data >> auctionId; recvData >> auctionId;
//sLog->outDebug("Cancel AUCTION AuctionID: %u", auctionId); //sLog->outDebug("Cancel AUCTION AuctionID: %u", auctionId);
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
@@ -558,7 +558,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
} }
//called when player lists his bids //called when player lists his bids
void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) void WorldSession::HandleAuctionListBidderItems(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_BIDDER_ITEMS"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_BIDDER_ITEMS");
@@ -566,12 +566,12 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
uint32 listfrom; //page of auctions uint32 listfrom; //page of auctions
uint32 outbiddedCount; //count of outbidded auctions uint32 outbiddedCount; //count of outbidded auctions
recv_data >> guid; recvData >> guid;
recv_data >> listfrom; // not used in fact (this list not have page control in client) recvData >> listfrom; // not used in fact (this list not have page control in client)
recv_data >> outbiddedCount; recvData >> outbiddedCount;
if (recv_data.size() != (16 + outbiddedCount * 4)) if (recvData.size() != (16 + outbiddedCount * 4))
{ {
sLog->outError(LOG_FILTER_NETWORKIO, "Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recv_data.size(), (16 + outbiddedCount * 4)); sLog->outError(LOG_FILTER_NETWORKIO, "Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recvData.size(), (16 + outbiddedCount * 4));
outbiddedCount = 0; outbiddedCount = 0;
} }
@@ -579,7 +579,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
if (!creature) if (!creature)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
recv_data.rfinish(); recvData.rfinish();
return; return;
} }
@@ -598,7 +598,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
{ {
--outbiddedCount; --outbiddedCount;
uint32 outbiddedAuctionId; uint32 outbiddedAuctionId;
recv_data >> outbiddedAuctionId; recvData >> outbiddedAuctionId;
AuctionEntry* auction = auctionHouse->GetAuction(outbiddedAuctionId); AuctionEntry* auction = auctionHouse->GetAuction(outbiddedAuctionId);
if (auction && auction->BuildAuctionInfo(data)) if (auction && auction->BuildAuctionInfo(data))
{ {
@@ -615,15 +615,15 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
} }
//this void sends player info about his auctions //this void sends player info about his auctions
void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS");
uint32 listfrom; uint32 listfrom;
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
recv_data >> listfrom; // not used in fact (this list not have page control in client) recvData >> listfrom; // not used in fact (this list not have page control in client)
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature) if (!creature)
@@ -652,7 +652,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
} }
//this void is called when player clicks on search button //this void is called when player clicks on search button
void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) void WorldSession::HandleAuctionListItems(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_ITEMS"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_ITEMS");
@@ -661,23 +661,23 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
uint32 listfrom, auctionSlotID, auctionMainCategory, auctionSubCategory, quality; uint32 listfrom, auctionSlotID, auctionMainCategory, auctionSubCategory, quality;
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
recv_data >> listfrom; // start, used for page control listing by 50 elements recvData >> listfrom; // start, used for page control listing by 50 elements
recv_data >> searchedname; recvData >> searchedname;
recv_data >> levelmin >> levelmax; recvData >> levelmin >> levelmax;
recv_data >> auctionSlotID >> auctionMainCategory >> auctionSubCategory; recvData >> auctionSlotID >> auctionMainCategory >> auctionSubCategory;
recv_data >> quality >> usable; recvData >> quality >> usable;
recv_data.read_skip<uint8>(); // unk recvData.read_skip<uint8>(); // unk
// this block looks like it uses some lame byte packing or similar... // this block looks like it uses some lame byte packing or similar...
uint8 unkCnt; uint8 unkCnt;
recv_data >> unkCnt; recvData >> unkCnt;
for (uint8 i = 0; i < unkCnt; i++) for (uint8 i = 0; i < unkCnt; i++)
{ {
recv_data.read_skip<uint8>(); recvData.read_skip<uint8>();
recv_data.read_skip<uint8>(); recvData.read_skip<uint8>();
} }
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
@@ -719,11 +719,11 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleAuctionListPendingSales(WorldPacket & recv_data) void WorldSession::HandleAuctionListPendingSales(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_PENDING_SALES"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_PENDING_SALES");
recv_data.read_skip<uint64>(); recvData.read_skip<uint64>();
uint32 count = 0; uint32 count = 0;
@@ -35,10 +35,10 @@
#include "DisableMgr.h" #include "DisableMgr.h"
#include "Group.h" #include "Group.h"
void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data) void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)));
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
@@ -70,7 +70,7 @@ void WorldSession::SendBattleGroundList(uint64 guid, BattlegroundTypeId bgTypeId
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
uint32 bgTypeId_; uint32 bgTypeId_;
@@ -79,10 +79,10 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data)
bool isPremade = false; bool isPremade = false;
Group* grp = NULL; Group* grp = NULL;
recv_data >> guid; // battlemaster guid recvData >> guid; // battlemaster guid
recv_data >> bgTypeId_; // battleground type id (DBC id) recvData >> bgTypeId_; // battleground type id (DBC id)
recv_data >> instanceId; // instance id, 0 if First Available selected recvData >> instanceId; // instance id, 0 if First Available selected
recv_data >> joinAsGroup; // join as group recvData >> joinAsGroup; // join as group
if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) if (!sBattlemasterListStore.LookupEntry(bgTypeId_))
{ {
@@ -245,7 +245,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data)
sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId());
} }
void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message");
@@ -296,7 +296,7 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recv_d
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_PVP_LOG_DATA Message"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_PVP_LOG_DATA Message");
@@ -315,18 +315,18 @@ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_PVP_LOG_DATA Message"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_PVP_LOG_DATA Message");
} }
void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data) void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message");
uint32 bgTypeId; uint32 bgTypeId;
recv_data >> bgTypeId; // id from DBC recvData >> bgTypeId; // id from DBC
uint8 fromWhere; uint8 fromWhere;
recv_data >> fromWhere; // 0 - battlemaster (lua: ShowBattlefieldList), 1 - UI (lua: RequestBattlegroundInstanceInfo) recvData >> fromWhere; // 0 - battlemaster (lua: ShowBattlefieldList), 1 - UI (lua: RequestBattlegroundInstanceInfo)
uint8 canGainXP; uint8 canGainXP;
recv_data >> canGainXP; // players with locked xp have their own bg queue on retail recvData >> canGainXP; // players with locked xp have their own bg queue on retail
BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId); BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId);
if (!bl) if (!bl)
@@ -340,7 +340,7 @@ void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_PORT Message"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_PORT Message");
@@ -350,7 +350,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data)
uint16 unk; // 0x1F90 constant? uint16 unk; // 0x1F90 constant?
uint8 action; // enter battle 0x1, leave queue 0x0 uint8 action; // enter battle 0x1, leave queue 0x0
recv_data >> type >> unk2 >> bgTypeId_ >> unk >> action; recvData >> type >> unk2 >> bgTypeId_ >> unk >> action;
if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) if (!sBattlemasterListStore.LookupEntry(bgTypeId_))
{ {
@@ -492,14 +492,14 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data)
} }
} }
void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data) void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message");
recv_data.read_skip<uint8>(); // unk1 recvData.read_skip<uint8>(); // unk1
recv_data.read_skip<uint8>(); // unk2 recvData.read_skip<uint8>(); // unk2
recv_data.read_skip<uint32>(); // BattlegroundTypeId recvData.read_skip<uint32>(); // BattlegroundTypeId
recv_data.read_skip<uint16>(); // unk3 recvData.read_skip<uint16>(); // unk3
// not allow leave battleground in combat // not allow leave battleground in combat
if (_player->isInCombat()) if (_player->isInCombat())
@@ -510,7 +510,7 @@ void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data)
_player->LeaveBattleground(); _player->LeaveBattleground();
} }
void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/)
{ {
// empty opcode // empty opcode
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Battleground status"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Battleground status");
@@ -574,7 +574,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/)
} }
} }
void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BATTLEMASTER_JOIN_ARENA");
@@ -584,7 +584,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data)
uint8 isRated; // isRated uint8 isRated; // isRated
Group* grp = NULL; Group* grp = NULL;
recv_data >> guid >> arenaslot >> asGroup >> isRated; recvData >> guid >> arenaslot >> asGroup >> isRated;
// ignore if we already in BG or BG queue // ignore if we already in BG or BG queue
if (_player->InBattleground()) if (_player->InBattleground())
@@ -742,10 +742,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data)
sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId());
} }
void WorldSession::HandleReportPvPAFK(WorldPacket & recv_data) void WorldSession::HandleReportPvPAFK(WorldPacket & recvData)
{ {
uint64 playerGuid; uint64 playerGuid;
recv_data >> playerGuid; recvData >> playerGuid;
Player* reportedPlayer = ObjectAccessor::FindPlayer(playerGuid); Player* reportedPlayer = ObjectAccessor::FindPlayer(playerGuid);
if (!reportedPlayer) if (!reportedPlayer)
+60 -60
View File
@@ -230,7 +230,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recvData*/)
{ {
// remove expired bans // remove expired bans
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS);
@@ -249,20 +249,20 @@ void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recv_data*/)
_charEnumCallback = CharacterDatabase.AsyncQuery(stmt); _charEnumCallback = CharacterDatabase.AsyncQuery(stmt);
} }
void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) void WorldSession::HandleCharCreateOpcode(WorldPacket & recvData)
{ {
std::string name; std::string name;
uint8 race_, class_; uint8 race_, class_;
recv_data >> name; recvData >> name;
recv_data >> race_; recvData >> race_;
recv_data >> class_; recvData >> class_;
// extract other data required for player creating // extract other data required for player creating
uint8 gender, skin, face, hairStyle, hairColor, facialHair, outfitId; uint8 gender, skin, face, hairStyle, hairColor, facialHair, outfitId;
recv_data >> gender >> skin >> face; recvData >> gender >> skin >> face;
recv_data >> hairStyle >> hairColor >> facialHair >> outfitId; recvData >> hairStyle >> hairColor >> facialHair >> outfitId;
WorldPacket data(SMSG_CHAR_CREATE, 1); // returned with diff.values in all cases WorldPacket data(SMSG_CHAR_CREATE, 1); // returned with diff.values in all cases
@@ -387,7 +387,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
} }
delete _charCreateCallback.GetParam(); // Delete existing if any, to make the callback chain reset to stage 0 delete _charCreateCallback.GetParam(); // Delete existing if any, to make the callback chain reset to stage 0
_charCreateCallback.SetParam(new CharacterCreateInfo(name, race_, class_, gender, skin, face, hairStyle, hairColor, facialHair, outfitId, recv_data)); _charCreateCallback.SetParam(new CharacterCreateInfo(name, race_, class_, gender, skin, face, hairStyle, hairColor, facialHair, outfitId, recvData));
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME);
stmt->setString(0, name); stmt->setString(0, name);
_charCreateCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt)); _charCreateCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt));
@@ -670,10 +670,10 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
} }
} }
void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) void WorldSession::HandleCharDeleteOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
// can't delete loaded character // can't delete loaded character
if (ObjectAccessor::FindPlayer(guid)) if (ObjectAccessor::FindPlayer(guid))
@@ -733,7 +733,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data) void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recvData)
{ {
if (PlayerLoading() || GetPlayer() != NULL) if (PlayerLoading() || GetPlayer() != NULL)
{ {
@@ -746,7 +746,7 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd Player Logon Message"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd Player Logon Message");
recv_data >> playerGuid; recvData >> playerGuid;
if (!CharCanLogin(GUID_LOPART(playerGuid))) if (!CharCanLogin(GUID_LOPART(playerGuid)))
{ {
@@ -1002,30 +1002,30 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
delete holder; delete holder;
} }
void WorldSession::HandleSetFactionAtWar(WorldPacket & recv_data) void WorldSession::HandleSetFactionAtWar(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_FACTION_ATWAR"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_FACTION_ATWAR");
uint32 repListID; uint32 repListID;
uint8 flag; uint8 flag;
recv_data >> repListID; recvData >> repListID;
recv_data >> flag; recvData >> flag;
GetPlayer()->GetReputationMgr().SetAtWar(repListID, flag); GetPlayer()->GetReputationMgr().SetAtWar(repListID, flag);
} }
//I think this function is never used :/ I dunno, but i guess this opcode not exists //I think this function is never used :/ I dunno, but i guess this opcode not exists
void WorldSession::HandleSetFactionCheat(WorldPacket & /*recv_data*/) void WorldSession::HandleSetFactionCheat(WorldPacket & /*recvData*/)
{ {
sLog->outError(LOG_FILTER_NETWORKIO, "WORLD SESSION: HandleSetFactionCheat, not expected call, please report."); sLog->outError(LOG_FILTER_NETWORKIO, "WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
GetPlayer()->GetReputationMgr().SendStates(); GetPlayer()->GetReputationMgr().SendStates();
} }
void WorldSession::HandleTutorialFlag(WorldPacket & recv_data) void WorldSession::HandleTutorialFlag(WorldPacket & recvData)
{ {
uint32 data; uint32 data;
recv_data >> data; recvData >> data;
uint8 index = uint8(data / 32); uint8 index = uint8(data / 32);
if (index >= MAX_ACCOUNT_TUTORIAL_VALUES) if (index >= MAX_ACCOUNT_TUTORIAL_VALUES)
@@ -1038,57 +1038,57 @@ void WorldSession::HandleTutorialFlag(WorldPacket & recv_data)
SetTutorialInt(index, flag); SetTutorialInt(index, flag);
} }
void WorldSession::HandleTutorialClear(WorldPacket & /*recv_data*/) void WorldSession::HandleTutorialClear(WorldPacket & /*recvData*/)
{ {
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
SetTutorialInt(i, 0xFFFFFFFF); SetTutorialInt(i, 0xFFFFFFFF);
} }
void WorldSession::HandleTutorialReset(WorldPacket & /*recv_data*/) void WorldSession::HandleTutorialReset(WorldPacket & /*recvData*/)
{ {
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
SetTutorialInt(i, 0x00000000); SetTutorialInt(i, 0x00000000);
} }
void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data) void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_WATCHED_FACTION"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_WATCHED_FACTION");
uint32 fact; uint32 fact;
recv_data >> fact; recvData >> fact;
GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fact); GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fact);
} }
void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data) void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_FACTION_INACTIVE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_FACTION_INACTIVE");
uint32 replistid; uint32 replistid;
uint8 inactive; uint8 inactive;
recv_data >> replistid >> inactive; recvData >> replistid >> inactive;
_player->GetReputationMgr().SetInactive(replistid, inactive); _player->GetReputationMgr().SetInactive(replistid, inactive);
} }
void WorldSession::HandleShowingHelmOpcode(WorldPacket& recv_data) void WorldSession::HandleShowingHelmOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SHOWING_HELM for %s", _player->GetName().c_str()); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SHOWING_HELM for %s", _player->GetName().c_str());
recv_data.read_skip<uint8>(); // unknown, bool? recvData.read_skip<uint8>(); // unknown, bool?
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM); _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
} }
void WorldSession::HandleShowingCloakOpcode(WorldPacket& recv_data) void WorldSession::HandleShowingCloakOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SHOWING_CLOAK for %s", _player->GetName().c_str()); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SHOWING_CLOAK for %s", _player->GetName().c_str());
recv_data.read_skip<uint8>(); // unknown, bool? recvData.read_skip<uint8>(); // unknown, bool?
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK); _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
} }
void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data) void WorldSession::HandleCharRenameOpcode(WorldPacket& recvData)
{ {
uint64 guid; uint64 guid;
std::string newName; std::string newName;
recv_data >> guid; recvData >> guid;
recv_data >> newName; recvData >> newName;
// prevent character rename to invalid name // prevent character rename to invalid name
if (!normalizePlayerName(newName)) if (!normalizePlayerName(newName))
@@ -1178,11 +1178,11 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult resu
sWorld->UpdateCharacterNameData(guidLow, newName); sWorld->UpdateCharacterNameData(guidLow, newName);
} }
void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
// not accept declined names for unsupported languages // not accept declined names for unsupported languages
std::string name; std::string name;
@@ -1217,7 +1217,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
std::string name2; std::string name2;
DeclinedName declinedname; DeclinedName declinedname;
recv_data >> name2; recvData >> name2;
if (name2 != name) // character have different name if (name2 != name) // character have different name
{ {
@@ -1230,7 +1230,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i) for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
{ {
recv_data >> declinedname.name[i]; recvData >> declinedname.name[i];
if (!normalizePlayerName(declinedname.name[i])) if (!normalizePlayerName(declinedname.name[i]))
{ {
WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8); WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8);
@@ -1275,12 +1275,12 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) void WorldSession::HandleAlterAppearance(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ALTER_APPEARANCE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ALTER_APPEARANCE");
uint32 Hair, Color, FacialHair, SkinColor; uint32 Hair, Color, FacialHair, SkinColor;
recv_data >> Hair >> Color >> FacialHair >> SkinColor; recvData >> Hair >> Color >> FacialHair >> SkinColor;
BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair); BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair);
@@ -1347,10 +1347,10 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data)
_player->SetStandState(0); // stand up _player->SetStandState(0); // stand up
} }
void WorldSession::HandleRemoveGlyph(WorldPacket & recv_data) void WorldSession::HandleRemoveGlyph(WorldPacket & recvData)
{ {
uint32 slot; uint32 slot;
recv_data >> slot; recvData >> slot;
if (slot >= MAX_GLYPH_SLOT_INDEX) if (slot >= MAX_GLYPH_SLOT_INDEX)
{ {
@@ -1369,16 +1369,16 @@ void WorldSession::HandleRemoveGlyph(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleCharCustomize(WorldPacket& recv_data) void WorldSession::HandleCharCustomize(WorldPacket& recvData)
{ {
uint64 guid; uint64 guid;
std::string newName; std::string newName;
recv_data >> guid; recvData >> guid;
recv_data >> newName; recvData >> newName;
uint8 gender, skin, face, hairStyle, hairColor, facialHair; uint8 gender, skin, face, hairStyle, hairColor, facialHair;
recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face; recvData >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN);
@@ -1485,23 +1485,23 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data) void WorldSession::HandleEquipmentSetSave(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_SAVE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_SAVE");
uint64 setGuid; uint64 setGuid;
recv_data.readPackGUID(setGuid); recvData.readPackGUID(setGuid);
uint32 index; uint32 index;
recv_data >> index; recvData >> index;
if (index >= MAX_EQUIPMENT_SET_INDEX) // client set slots amount if (index >= MAX_EQUIPMENT_SET_INDEX) // client set slots amount
return; return;
std::string name; std::string name;
recv_data >> name; recvData >> name;
std::string iconName; std::string iconName;
recv_data >> iconName; recvData >> iconName;
EquipmentSet eqSet; EquipmentSet eqSet;
@@ -1513,7 +1513,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data)
for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i) for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{ {
uint64 itemGuid; uint64 itemGuid;
recv_data.readPackGUID(itemGuid); recvData.readPackGUID(itemGuid);
// equipment manager sends "1" (as raw GUID) for slots set to "ignore" (don't touch slot at equip set) // equipment manager sends "1" (as raw GUID) for slots set to "ignore" (don't touch slot at equip set)
if (itemGuid == 1) if (itemGuid == 1)
@@ -1537,17 +1537,17 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data)
_player->SetEquipmentSet(index, eqSet); _player->SetEquipmentSet(index, eqSet);
} }
void WorldSession::HandleEquipmentSetDelete(WorldPacket &recv_data) void WorldSession::HandleEquipmentSetDelete(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_DELETE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_DELETE");
uint64 setGuid; uint64 setGuid;
recv_data.readPackGUID(setGuid); recvData.readPackGUID(setGuid);
_player->DeleteEquipmentSet(setGuid); _player->DeleteEquipmentSet(setGuid);
} }
void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data) void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData)
{ {
if (_player->isInCombat()) if (_player->isInCombat())
return; return;
@@ -1557,10 +1557,10 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data)
for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i) for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{ {
uint64 itemGuid; uint64 itemGuid;
recv_data.readPackGUID(itemGuid); recvData.readPackGUID(itemGuid);
uint8 srcbag, srcslot; uint8 srcbag, srcslot;
recv_data >> srcbag >> srcslot; recvData >> srcbag >> srcslot;
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot); sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot);
@@ -1602,14 +1602,14 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
{ {
uint64 guid; uint64 guid;
std::string newname; std::string newname;
uint8 gender, skin, face, hairStyle, hairColor, facialHair, race; uint8 gender, skin, face, hairStyle, hairColor, facialHair, race;
recv_data >> guid; recvData >> guid;
recv_data >> newname; recvData >> newname;
recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face >> race; recvData >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face >> race;
uint32 lowGuid = GUID_LOPART(guid); uint32 lowGuid = GUID_LOPART(guid);
@@ -1634,7 +1634,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data)
Field* fields = result->Fetch(); Field* fields = result->Fetch();
uint32 at_loginFlags = fields[0].GetUInt16(); uint32 at_loginFlags = fields[0].GetUInt16();
char const* knownTitlesStr = fields[1].GetCString(); char const* knownTitlesStr = fields[1].GetCString();
uint32 used_loginFlag = ((recv_data.GetOpcode() == CMSG_CHAR_RACE_CHANGE) ? AT_LOGIN_CHANGE_RACE : AT_LOGIN_CHANGE_FACTION); uint32 used_loginFlag = ((recvData.GetOpcode() == CMSG_CHAR_RACE_CHANGE) ? AT_LOGIN_CHANGE_RACE : AT_LOGIN_CHANGE_FACTION);
if (!sObjectMgr->GetPlayerInfo(race, playerClass)) if (!sObjectMgr->GetPlayerInfo(race, playerClass))
{ {
@@ -1793,7 +1793,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data)
trans->Append(stmt); trans->Append(stmt);
} }
if (recv_data.GetOpcode() == CMSG_CHAR_FACTION_CHANGE) if (recvData.GetOpcode() == CMSG_CHAR_FACTION_CHANGE)
{ {
// Delete all Flypaths // Delete all Flypaths
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXI_PATH); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXI_PATH);
+5 -5
View File
@@ -26,10 +26,10 @@
#include "Vehicle.h" #include "Vehicle.h"
#include "VehicleDefines.h" #include "VehicleDefines.h"
void WorldSession::HandleAttackSwingOpcode(WorldPacket& recv_data) void WorldSession::HandleAttackSwingOpcode(WorldPacket& recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_ATTACKSWING Message guidlow:%u guidhigh:%u", GUID_LOPART(guid), GUID_HIPART(guid)); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_ATTACKSWING Message guidlow:%u guidhigh:%u", GUID_LOPART(guid), GUID_HIPART(guid));
@@ -66,15 +66,15 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recv_data)
_player->Attack(pEnemy, true); _player->Attack(pEnemy, true);
} }
void WorldSession::HandleAttackStopOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleAttackStopOpcode(WorldPacket & /*recvData*/)
{ {
GetPlayer()->AttackStop(); GetPlayer()->AttackStop();
} }
void WorldSession::HandleSetSheathedOpcode(WorldPacket& recv_data) void WorldSession::HandleSetSheathedOpcode(WorldPacket& recvData)
{ {
uint32 sheathed; uint32 sheathed;
recv_data >> sheathed; recvData >> sheathed;
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed); //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed);
+45 -45
View File
@@ -56,13 +56,13 @@ void WorldSession::SendPartyResult(PartyOperation operation, const std::string&
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE");
std::string membername; std::string membername;
recv_data >> membername; recvData >> membername;
recv_data.read_skip<uint32>(); recvData.read_skip<uint32>();
// attempt add selected player // attempt add selected player
@@ -195,11 +195,11 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
SendPartyResult(PARTY_OP_INVITE, membername, ERR_PARTY_RESULT_OK); SendPartyResult(PARTY_OP_INVITE, membername, ERR_PARTY_RESULT_OK);
} }
void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ACCEPT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ACCEPT");
recv_data.read_skip<uint32>(); recvData.read_skip<uint32>();
Group* group = GetPlayer()->GetGroupInvite(); Group* group = GetPlayer()->GetGroupInvite();
if (!group) if (!group)
@@ -247,7 +247,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data)
group->BroadcastGroupUpdate(); group->BroadcastGroupUpdate();
} }
void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE");
@@ -270,14 +270,14 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/)
leader->GetSession()->SendPacket(&data); leader->GetSession()->SendPacket(&data);
} }
void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data) void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE_GUID"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE_GUID");
uint64 guid; uint64 guid;
std::string reason; std::string reason;
recv_data >> guid; recvData >> guid;
recv_data >> reason; recvData >> reason;
//can't uninvite yourself //can't uninvite yourself
if (guid == GetPlayer()->GetGUID()) if (guid == GetPlayer()->GetGUID())
@@ -319,12 +319,12 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
SendPartyResult(PARTY_OP_UNINVITE, "", ERR_TARGET_NOT_IN_GROUP_S); SendPartyResult(PARTY_OP_UNINVITE, "", ERR_TARGET_NOT_IN_GROUP_S);
} }
void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data) void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE");
std::string membername; std::string membername;
recv_data >> membername; recvData >> membername;
// player not found // player not found
if (!normalizePlayerName(membername)) if (!normalizePlayerName(membername))
@@ -364,12 +364,12 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data)
SendPartyResult(PARTY_OP_UNINVITE, membername, ERR_TARGET_NOT_IN_GROUP_S); SendPartyResult(PARTY_OP_UNINVITE, membername, ERR_TARGET_NOT_IN_GROUP_S);
} }
void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data) void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_LEADER"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_LEADER");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
Player* player = ObjectAccessor::FindPlayer(guid); Player* player = ObjectAccessor::FindPlayer(guid);
Group* group = GetPlayer()->GetGroup(); Group* group = GetPlayer()->GetGroup();
@@ -385,7 +385,7 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data)
group->SendUpdate(); group->SendUpdate();
} }
void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND");
@@ -408,14 +408,14 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/)
GetPlayer()->RemoveFromGroup(GROUP_REMOVEMETHOD_LEAVE); GetPlayer()->RemoveFromGroup(GROUP_REMOVEMETHOD_LEAVE);
} }
void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data) void WorldSession::HandleLootMethodOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LOOT_METHOD"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LOOT_METHOD");
uint32 lootMethod; uint32 lootMethod;
uint64 lootMaster; uint64 lootMaster;
uint32 lootThreshold; uint32 lootThreshold;
recv_data >> lootMethod >> lootMaster >> lootThreshold; recvData >> lootMethod >> lootMaster >> lootThreshold;
Group* group = GetPlayer()->GetGroup(); Group* group = GetPlayer()->GetGroup();
if (!group) if (!group)
@@ -459,7 +459,7 @@ void WorldSession::HandleLootRoll(WorldPacket& recvData)
} }
} }
void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data) void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_MINIMAP_PING"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_MINIMAP_PING");
@@ -467,8 +467,8 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
return; return;
float x, y; float x, y;
recv_data >> x; recvData >> x;
recv_data >> y; recvData >> y;
//sLog->outDebug("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y); //sLog->outDebug("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y);
@@ -483,13 +483,13 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)
GetPlayer()->GetGroup()->BroadcastPacket(&data, true, -1, GetPlayer()->GetGUID()); GetPlayer()->GetGroup()->BroadcastPacket(&data, true, -1, GetPlayer()->GetGUID());
} }
void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data) void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RANDOM_ROLL"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RANDOM_ROLL");
uint32 minimum, maximum, roll; uint32 minimum, maximum, roll;
recv_data >> minimum; recvData >> minimum;
recv_data >> maximum; recvData >> maximum;
/** error handling **/ /** error handling **/
if (minimum > maximum || maximum > 10000) // < 32768 for urand call if (minimum > maximum || maximum > 10000) // < 32768 for urand call
@@ -512,7 +512,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data) void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_TARGET_UPDATE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_TARGET_UPDATE");
@@ -521,7 +521,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data)
return; return;
uint8 x; uint8 x;
recv_data >> x; recvData >> x;
/** error handling **/ /** error handling **/
/********************/ /********************/
@@ -537,12 +537,12 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data)
return; return;
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
group->SetTargetIcon(x, _player->GetGUID(), guid); group->SetTargetIcon(x, _player->GetGUID(), guid);
} }
} }
void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT");
@@ -563,7 +563,7 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recv_data*/)
group->ConvertToRaid(); group->ConvertToRaid();
} }
void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP");
@@ -574,8 +574,8 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data)
std::string name; std::string name;
uint8 groupNr; uint8 groupNr;
recv_data >> name; recvData >> name;
recv_data >> groupNr; recvData >> groupNr;
if (groupNr >= MAX_RAID_SUBGROUPS) if (groupNr >= MAX_RAID_SUBGROUPS)
return; return;
@@ -602,7 +602,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data)
group->ChangeMembersGroup(guid, groupNr); group->ChangeMembersGroup(guid, groupNr);
} }
void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data) void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER");
@@ -615,15 +615,15 @@ void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data)
uint64 guid; uint64 guid;
bool apply; bool apply;
recv_data >> guid; recvData >> guid;
recv_data >> apply; recvData >> apply;
group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_ASSISTANT); group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_ASSISTANT);
group->SendUpdate(); group->SendUpdate();
} }
void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data) void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_PARTY_ASSIGNMENT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_PARTY_ASSIGNMENT");
@@ -638,8 +638,8 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data)
uint8 assignment; uint8 assignment;
bool apply; bool apply;
uint64 guid; uint64 guid;
recv_data >> assignment >> apply; recvData >> assignment >> apply;
recv_data >> guid; recvData >> guid;
switch (assignment) switch (assignment)
{ {
@@ -657,7 +657,7 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data)
group->SendUpdate(); group->SendUpdate();
} }
void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data) void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK");
@@ -665,7 +665,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data)
if (!group) if (!group)
return; return;
if (recv_data.empty()) // request if (recvData.empty()) // request
{ {
/** error handling **/ /** error handling **/
if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
@@ -682,7 +682,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data)
else // answer else // answer
{ {
uint8 state; uint8 state;
recv_data >> state; recvData >> state;
// everything's fine, do it // everything's fine, do it
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9); WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
@@ -692,7 +692,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket & /*recvData*/)
{ {
//Group* group = GetPlayer()->GetGroup(); //Group* group = GetPlayer()->GetGroup();
//if (!group) //if (!group)
@@ -872,11 +872,11 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
} }
/*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/ /*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/
void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data) void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS");
uint64 Guid; uint64 Guid;
recv_data >> Guid; recvData >> Guid;
Player* player = HashMapHolder<Player>::Find(Guid); Player* player = HashMapHolder<Player>::Find(Guid);
if (!player) if (!player)
@@ -962,23 +962,23 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data)
SendPacket(&data); SendPacket(&data);
} }
/*!*/void WorldSession::HandleRequestRaidInfoOpcode(WorldPacket & /*recv_data*/) /*!*/void WorldSession::HandleRequestRaidInfoOpcode(WorldPacket & /*recvData*/)
{ {
// every time the player checks the character screen // every time the player checks the character screen
_player->SendRaidInfo(); _player->SendRaidInfo();
} }
/*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recv_data) /*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recvData)
{ {
sLog->outDebug("WORLD: got CMSG_GROUP_CANCEL."); sLog->outDebug("WORLD: got CMSG_GROUP_CANCEL.");
}*/ }*/
void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recv_data) void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_OPT_OUT_OF_LOOT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_OPT_OUT_OF_LOOT");
uint32 passOnLoot; uint32 passOnLoot;
recv_data >> passOnLoot; // 1 always pass, 0 do not pass recvData >> passOnLoot; // 1 always pass, 0 do not pass
// ignore if player not loaded // ignore if player not loaded
if (!GetPlayer()) // needed because STATUS_AUTHED if (!GetPlayer()) // needed because STATUS_AUTHED
+209 -236
View File
@@ -28,29 +28,17 @@
#include "GossipDef.h" #include "GossipDef.h"
#include "SocialMgr.h" #include "SocialMgr.h"
// Helper for getting guild object of session's player.
// If guild does not exist, sends error (if necessary).
inline Guild* _GetPlayerGuild(WorldSession* session, bool sendError = false)
{
if (uint32 guildId = session->GetPlayer()->GetGuildId()) // If guild id = 0, player is not in guild
if (Guild* guild = sGuildMgr->GetGuildById(guildId)) // Find guild by id
return guild;
if (sendError)
Guild::SendCommandResult(session, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD);
return NULL;
}
void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_QUERY");
uint32 guildId; uint32 guildId;
recvPacket >> guildId; recvPacket >> guildId;
// Use received guild id to access guild method (not player's guild id)
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_QUERY [%s]: Guild: %u", GetPlayerInfo().c_str(), guildId);
if (!guildId)
return;
if (Guild* guild = sGuildMgr->GetGuildById(guildId)) if (Guild* guild = sGuildMgr->GetGuildById(guildId))
guild->HandleQuery(this); guild->HandleQuery(this);
else
Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD);
} }
void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
@@ -72,41 +60,39 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket)
void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INVITE");
std::string invitedName; std::string invitedName;
recvPacket >> invitedName; recvPacket >> invitedName;
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INVITE [%s]: Invited: %s", GetPlayerInfo().c_str(), invitedName.c_str());
if (normalizePlayerName(invitedName)) if (normalizePlayerName(invitedName))
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleInviteMember(this, invitedName); guild->HandleInviteMember(this, invitedName);
} }
void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_REMOVE");
std::string playerName; std::string playerName;
recvPacket >> playerName; recvPacket >> playerName;
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_REMOVE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str());
if (normalizePlayerName(playerName)) if (normalizePlayerName(playerName))
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleRemoveMember(this, playerName); guild->HandleRemoveMember(this, playerName);
} }
void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ACCEPT"); sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ACCEPT [%s]", GetPlayer()->GetName().c_str());
// Player cannot be in guild
if (!GetPlayer()->GetGuildId()) if (!GetPlayer()->GetGuildId())
// Guild where player was invited must exist
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildIdInvited())) if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildIdInvited()))
guild->HandleAcceptMember(this); guild->HandleAcceptMember(this);
} }
void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DECLINE"); sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DECLINE [%s]", GetPlayerInfo().c_str());
GetPlayer()->SetGuildIdInvited(0); GetPlayer()->SetGuildIdInvited(0);
GetPlayer()->SetInGuild(0); GetPlayer()->SetInGuild(0);
@@ -114,125 +100,115 @@ void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/)
void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INFO"); sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INFO [%s]", GetPlayerInfo().c_str());
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->SendInfo(this); guild->SendInfo(this);
} }
void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ROSTER"); sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ROSTER [%s]", GetPlayerInfo().c_str());
if (Guild* guild = _GetPlayerGuild(this)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleRoster(this); guild->HandleRoster(this);
else
Guild::SendCommandResult(this, GUILD_COMMAND_ROSTER, ERR_GUILD_PLAYER_NOT_IN_GUILD);
} }
void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_PROMOTE");
std::string playerName; std::string playerName;
recvPacket >> playerName; recvPacket >> playerName;
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_PROMOTE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str());
if (normalizePlayerName(playerName)) if (normalizePlayerName(playerName))
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleUpdateMemberRank(this, playerName, false); guild->HandleUpdateMemberRank(this, playerName, false);
} }
void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DEMOTE");
std::string playerName; std::string playerName;
recvPacket >> playerName; recvPacket >> playerName;
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DEMOTE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str());
if (normalizePlayerName(playerName)) if (normalizePlayerName(playerName))
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleUpdateMemberRank(this, playerName, true); guild->HandleUpdateMemberRank(this, playerName, true);
} }
void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_LEAVE"); sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_LEAVE [%s]", GetPlayerInfo().c_str());
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleLeaveMember(this); guild->HandleLeaveMember(this);
} }
void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DISBAND"); sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DISBAND [%s]", GetPlayerInfo().c_str());
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleDisband(this); guild->HandleDisband(this);
} }
void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_LEADER");
std::string name; std::string name;
recvPacket >> name; recvPacket >> name;
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_LEADER [%s]: Target: %s", GetPlayerInfo().c_str(), name.c_str());
if (normalizePlayerName(name)) if (normalizePlayerName(name))
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleSetLeader(this, name); guild->HandleSetLeader(this, name);
} }
void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_MOTD"); std::string motd;
recvPacket >> motd;
std::string motd; // Empty by default sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_MOTD [%s]: MOTD: %s", GetPlayerInfo().c_str(), motd.c_str());
if (!recvPacket.empty())
recvPacket >> motd;
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleSetMOTD(this, motd); guild->HandleSetMOTD(this, motd);
} }
void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_SET_PUBLIC_NOTE");
std::string playerName; std::string playerName;
recvPacket >> playerName; std::string note;
recvPacket >> playerName >> note;
std::string publicNote; sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_PUBLIC_NOTE [%s]: Target: %s, Note: %s",
recvPacket >> publicNote; GetPlayerInfo().c_str(), playerName.c_str(), note.c_str());
if (normalizePlayerName(playerName)) if (normalizePlayerName(playerName))
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleSetMemberNote(this, playerName, publicNote, false); guild->HandleSetMemberNote(this, playerName, note, true);
} }
void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_SET_OFFICER_NOTE");
std::string playerName; std::string playerName;
recvPacket >> playerName; std::string note;
recvPacket >> playerName >> note;
std::string officerNote; sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_OFFICER_NOTE [%s]: Target: %s, Note: %s",
recvPacket >> officerNote; GetPlayerInfo().c_str(), playerName.c_str(), note.c_str());
if (normalizePlayerName(playerName)) if (normalizePlayerName(playerName))
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleSetMemberNote(this, playerName, officerNote, true); guild->HandleSetMemberNote(this, playerName, note, false);
} }
void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_RANK");
Guild* guild = _GetPlayerGuild(this, true);
if (!guild)
{
recvPacket.rpos(recvPacket.wpos());
return;
}
uint32 rankId; uint32 rankId;
recvPacket >> rankId; recvPacket >> rankId;
@@ -245,7 +221,17 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
uint32 money; uint32 money;
recvPacket >> money; recvPacket >> money;
sLog->outDebug(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); GuildBankRightsAndSlotsVec rightsAndSlots(GUILD_BANK_MAX_TABS);
for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId) for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId)
{ {
uint32 bankRights; uint32 bankRights;
@@ -254,7 +240,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
recvPacket >> bankRights; recvPacket >> bankRights;
recvPacket >> slots; recvPacket >> slots;
rightsAndSlots[tabId] = GuildBankRightsAndSlots(uint8(bankRights), slots); rightsAndSlots[tabId] = GuildBankRightsAndSlots(tabId, bankRights, slots);
} }
guild->HandleSetRankInfo(this, rankId, rankName, rights, money, rightsAndSlots); guild->HandleSetRankInfo(this, rankId, rankName, rights, money, rightsAndSlots);
@@ -262,181 +248,175 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket)
void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ADD_RANK");
std::string rankName; std::string rankName;
recvPacket >> rankName; recvPacket >> rankName;
if (Guild* guild = _GetPlayerGuild(this, true)) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ADD_RANK [%s]: Rank: %s", GetPlayerInfo().c_str(), rankName.c_str());
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleAddNewRank(this, rankName); guild->HandleAddNewRank(this, rankName);
} }
void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DEL_RANK"); sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DEL_RANK [%s]", GetPlayerInfo().c_str());
if (Guild* guild = _GetPlayerGuild(this, true)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleRemoveLowestRank(this); guild->HandleRemoveLowestRank(this);
} }
void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INFO_TEXT");
std::string info; std::string info;
recvPacket >> info; recvPacket >> info;
if (Guild* guild = _GetPlayerGuild(this, true)) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INFO_TEXT [%s]: %s", GetPlayerInfo().c_str(), info.c_str());
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleSetInfo(this, info); guild->HandleSetInfo(this, info);
} }
void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_SAVE_GUILD_EMBLEM");
uint64 vendorGuid; uint64 vendorGuid;
recvPacket >> vendorGuid; recvPacket >> vendorGuid;
EmblemInfo emblemInfo; EmblemInfo emblemInfo;
emblemInfo.ReadPacket(recvPacket); emblemInfo.ReadPacket(recvPacket);
sLog->outDebug(LOG_FILTER_GUILD, "MSG_SAVE_GUILD_EMBLEM [%s]: Guid: [" UI64FMTD
"] Style: %d, Color: %d, BorderStyle: %d, BorderColor: %d, BackgroundColor: %d"
, GetPlayerInfo().c_str(), vendorGuid, emblemInfo.GetStyle()
, emblemInfo.GetColor(), emblemInfo.GetBorderStyle()
, emblemInfo.GetBorderColor(), emblemInfo.GetBackgroundColor());
if (GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_TABARDDESIGNER)) if (GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_TABARDDESIGNER))
{ {
// Remove fake death // Remove fake death
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if (Guild* guild = _GetPlayerGuild(this)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleSetEmblem(this, emblemInfo); guild->HandleSetEmblem(this, emblemInfo);
else else
// "You are not part of a guild!"; Guild::SendSaveEmblemResult(this, ERR_GUILDEMBLEM_NOGUILD); // "You are not part of a guild!";
Guild::SendSaveEmblemResult(this, ERR_GUILDEMBLEM_NOGUILD);
} }
else else
{ Guild::SendSaveEmblemResult(this, ERR_GUILDEMBLEM_INVALIDVENDOR); // "That's not an emblem vendor!"
// "That's not an emblem vendor!"
Guild::SendSaveEmblemResult(this, ERR_GUILDEMBLEM_INVALIDVENDOR);
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSaveGuildEmblemOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(vendorGuid));
}
} }
void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)"); sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_EVENT_LOG_QUERY [%s]", GetPlayerInfo().c_str());
if (Guild* guild = _GetPlayerGuild(this)) if (Guild* guild = GetPlayer()->GetGuild())
guild->SendEventLog(this); guild->SendEventLog(this);
} }
void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */) void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recvData */)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)"); sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_MONEY_WITHDRAWN [%s]", GetPlayerInfo().c_str());
if (Guild* guild = _GetPlayerGuild(this)) if (Guild* guild = GetPlayer()->GetGuild())
guild->SendMoneyInfo(this); guild->SendMoneyInfo(this);
} }
void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */) void WorldSession::HandleGuildPermissions(WorldPacket& /* recvData */)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_PERMISSIONS)"); sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_PERMISSIONS [%s]", GetPlayerInfo().c_str());
if (Guild* guild = _GetPlayerGuild(this)) if (Guild* guild = GetPlayer()->GetGuild())
guild->SendPermissions(this); guild->SendPermissions(this);
} }
// Called when clicking on Guild bank gameobject // Called when clicking on Guild bank gameobject
void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data) void WorldSession::HandleGuildBankerActivate(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANKER_ACTIVATE)"); uint64 guid;
bool sendAllSlots;
recvData >> guid >> sendAllSlots;
uint64 GoGuid; sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANKER_ACTIVATE [%s]: Go: [" UI64FMTD "] AllSlots: %u"
recv_data >> GoGuid; , GetPlayerInfo().c_str(), guid, sendAllSlots);
uint8 fullSlotList; Guild * const guild = GetPlayer()->GetGuild();
recv_data >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated if (!guild)
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
{ {
if (Guild* guild = _GetPlayerGuild(this)) Guild::SendCommandResult(this, GUILD_COMMAND_VIEW_TAB, ERR_GUILD_PLAYER_NOT_IN_GUILD);
guild->SendBankTabsInfo(this);
else
Guild::SendCommandResult(this, GUILD_UNK1, ERR_GUILD_PLAYER_NOT_IN_GUILD);
}
}
// Called when opening guild bank tab only (first one)
void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_QUERY_TAB)");
uint64 GoGuid;
recv_data >> GoGuid;
uint8 tabId;
recv_data >> tabId;
uint8 fullSlotList;
recv_data >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* guild = _GetPlayerGuild(this))
guild->SendBankTabData(this, tabId);
}
void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_DEPOSIT_MONEY)");
uint64 GoGuid;
recv_data >> GoGuid;
uint32 money;
recv_data >> money;
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
if (money && GetPlayer()->HasEnoughMoney(money))
if (Guild* guild = _GetPlayerGuild(this))
guild->HandleMemberDepositMoney(this, money);
}
void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_WITHDRAW_MONEY)");
uint64 GoGuid;
recv_data >> GoGuid;
uint32 money;
recv_data >> money;
if (money)
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* guild = _GetPlayerGuild(this))
guild->HandleMemberWithdrawMoney(this, money);
}
void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_SWAP_ITEMS)");
uint64 GoGuid;
recv_data >> GoGuid;
if (!GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
{
recv_data.rfinish(); // Prevent additional spam at rejected packet
return; return;
} }
Guild* guild = _GetPlayerGuild(this); guild->SendBankTabsInfo(this, sendAllSlots);
}
// Called when opening guild bank tab only (first one)
void WorldSession::HandleGuildBankQueryTab(WorldPacket& recvData)
{
uint64 guid;
uint8 tabId;
bool full;
recvData >> guid >> tabId >> full;
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_QUERY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, ShowTabs: %u"
, GetPlayerInfo().c_str(), guid, tabId, full);
if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* guild = GetPlayer()->GetGuild())
guild->SendBankTabData(this, tabId);
}
void WorldSession::HandleGuildBankDepositMoney(WorldPacket& recvData)
{
uint64 guid;
uint32 money;
recvData >> guid >> money;
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_DEPOSIT_MONEY [%s]: Go: [" UI64FMTD "], money: %u",
GetPlayerInfo().c_str(), guid, money);
if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK))
if (money && GetPlayer()->HasEnoughMoney(money))
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleMemberDepositMoney(this, money);
}
void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvData)
{
uint64 guid;
uint32 money;
recvData >> guid >> money;
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_WITHDRAW_MONEY [%s]: Go: [" UI64FMTD "], money: %u",
GetPlayerInfo().c_str(), guid, money);
if (money && GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleMemberWithdrawMoney(this, money);
}
void WorldSession::HandleGuildBankSwapItems(WorldPacket& recvData)
{
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_SWAP_ITEMS [%s]", GetPlayerInfo().c_str());
uint64 GoGuid;
recvData >> GoGuid;
if (!GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK))
{
recvData.rfinish(); // Prevent additional spam at rejected packet
return;
}
Guild* guild = GetPlayer()->GetGuild();
if (!guild) if (!guild)
{ {
recv_data.rfinish(); // Prevent additional spam at rejected packet recvData.rfinish(); // Prevent additional spam at rejected packet
return; return;
} }
uint8 bankToBank; uint8 bankToBank;
recv_data >> bankToBank; recvData >> bankToBank;
uint8 tabId; uint8 tabId;
uint8 slotId; uint8 slotId;
@@ -446,18 +426,18 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
if (bankToBank) if (bankToBank)
{ {
uint8 destTabId; uint8 destTabId;
recv_data >> destTabId; recvData >> destTabId;
uint8 destSlotId; uint8 destSlotId;
recv_data >> destSlotId; recvData >> destSlotId;
recv_data.read_skip<uint32>(); // Always 0 recvData.read_skip<uint32>(); // Always 0
recv_data >> tabId; recvData >> tabId;
recv_data >> slotId; recvData >> slotId;
recv_data >> itemEntry; recvData >> itemEntry;
recv_data.read_skip<uint8>(); // Always 0 recvData.read_skip<uint8>(); // Always 0
recv_data >> splitedAmount; recvData >> splitedAmount;
guild->SwapItems(GetPlayer(), tabId, slotId, destTabId, destSlotId, splitedAmount); guild->SwapItems(GetPlayer(), tabId, slotId, destTabId, destSlotId, splitedAmount);
} }
@@ -467,24 +447,24 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
uint8 playerSlotId = NULL_SLOT; uint8 playerSlotId = NULL_SLOT;
uint8 toChar = 1; uint8 toChar = 1;
recv_data >> tabId; recvData >> tabId;
recv_data >> slotId; recvData >> slotId;
recv_data >> itemEntry; recvData >> itemEntry;
uint8 autoStore; uint8 autoStore;
recv_data >> autoStore; recvData >> autoStore;
if (autoStore) if (autoStore)
{ {
recv_data.read_skip<uint32>(); // autoStoreCount recvData.read_skip<uint32>(); // autoStoreCount
recv_data.read_skip<uint8>(); // ToChar (?), always and expected to be 1 (autostore only triggered in Bank -> Char) recvData.read_skip<uint8>(); // ToChar (?), always and expected to be 1 (autostore only triggered in Bank -> Char)
recv_data.read_skip<uint32>(); // Always 0 recvData.read_skip<uint32>(); // Always 0
} }
else else
{ {
recv_data >> playerBag; recvData >> playerBag;
recv_data >> playerSlotId; recvData >> playerSlotId;
recv_data >> toChar; recvData >> toChar;
recv_data >> splitedAmount; recvData >> splitedAmount;
} }
// Player <-> Bank // Player <-> Bank
@@ -496,75 +476,68 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleGuildBankBuyTab(WorldPacket & recv_data) void WorldSession::HandleGuildBankBuyTab(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_BUY_TAB)"); uint64 guid;
uint64 GoGuid;
recv_data >> GoGuid;
uint8 tabId; uint8 tabId;
recv_data >> tabId;
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) recvData >> guid >> tabId;
if (Guild* guild = _GetPlayerGuild(this))
sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_BUY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u", GetPlayerInfo().c_str(), guid, tabId);
if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleBuyBankTab(this, tabId); guild->HandleBuyBankTab(this, tabId);
} }
void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data) void WorldSession::HandleGuildBankUpdateTab(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_UPDATE_TAB)"); uint64 guid;
uint64 GoGuid;
recv_data >> GoGuid;
uint8 tabId; uint8 tabId;
recv_data >> tabId; std::string name, icon;
std::string name; recvData >> guid >> tabId >> name >> icon;
recv_data >> name;
std::string icon; sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_UPDATE_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, Name: %s, Icon: %s"
recv_data >> icon; , GetPlayerInfo().c_str(), guid, tabId, name.c_str(), icon.c_str());
if (!name.empty() && !icon.empty()) if (!name.empty() && !icon.empty())
if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK))
if (Guild* guild = _GetPlayerGuild(this)) if (Guild* guild = GetPlayer()->GetGuild())
guild->HandleSetBankTabInfo(this, tabId, name, icon); guild->HandleSetBankTabInfo(this, tabId, name, icon);
} }
void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data) void WorldSession::HandleGuildBankLogQuery(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_BANK_LOG_QUERY)");
uint8 tabId; uint8 tabId;
recv_data >> tabId; recvData >> tabId;
if (Guild* guild = _GetPlayerGuild(this)) sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_LOG_QUERY [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId);
if (Guild* guild = GetPlayer()->GetGuild())
guild->SendBankLog(this, tabId); guild->SendBankLog(this, tabId);
} }
void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data) void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_QUERY_GUILD_BANK_TEXT");
uint8 tabId; uint8 tabId;
recv_data >> tabId; recvData >> tabId;
if (Guild* guild = _GetPlayerGuild(this)) sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId);
if (Guild* guild = GetPlayer()->GetGuild())
guild->SendBankTabText(this, tabId); guild->SendBankTabText(this, tabId);
} }
void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data) void WorldSession::HandleSetGuildBankTabText(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_GUILD_BANK_TEXT");
uint8 tabId; uint8 tabId;
recv_data >> tabId;
std::string text; std::string text;
recv_data >> text; recvData >> tabId >> text;
if (Guild* guild = _GetPlayerGuild(this)) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_SET_GUILD_BANK_TEXT [%s]: TabId: %u, Text: %s", GetPlayerInfo().c_str(), tabId, text.c_str());
if (Guild* guild = GetPlayer()->GetGuild())
guild->SetBankTabText(tabId, text); guild->SetBankTabText(tabId, text);
} }
+49 -49
View File
@@ -28,13 +28,13 @@
#include "ObjectAccessor.h" #include "ObjectAccessor.h"
#include "SpellInfo.h" #include "SpellInfo.h"
void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data) void WorldSession::HandleSplitItemOpcode(WorldPacket & recvData)
{ {
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SPLIT_ITEM"); //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SPLIT_ITEM");
uint8 srcbag, srcslot, dstbag, dstslot; uint8 srcbag, srcslot, dstbag, dstslot;
uint32 count; uint32 count;
recv_data >> srcbag >> srcslot >> dstbag >> dstslot >> count; recvData >> srcbag >> srcslot >> dstbag >> dstslot >> count;
//sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u, count = %u", srcbag, srcslot, dstbag, dstslot, count); //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u, count = %u", srcbag, srcslot, dstbag, dstslot, count);
uint16 src = ((srcbag << 8) | srcslot); uint16 src = ((srcbag << 8) | srcslot);
@@ -61,12 +61,12 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data)
_player->SplitItem(src, dst, count); _player->SplitItem(src, dst, count);
} }
void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recv_data) void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recvData)
{ {
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_INV_ITEM"); //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_INV_ITEM");
uint8 srcslot, dstslot; uint8 srcslot, dstslot;
recv_data >> dstslot >> srcslot; recvData >> dstslot >> srcslot;
//sLog->outDebug("STORAGE: receive srcslot = %u, dstslot = %u", srcslot, dstslot); //sLog->outDebug("STORAGE: receive srcslot = %u, dstslot = %u", srcslot, dstslot);
// prevent attempt swap same item to current position generated by client at special checting sequence // prevent attempt swap same item to current position generated by client at special checting sequence
@@ -91,11 +91,11 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recv_data)
_player->SwapItem(src, dst); _player->SwapItem(src, dst);
} }
void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket & recv_data) void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket & recvData)
{ {
uint64 itemguid; uint64 itemguid;
uint8 dstslot; uint8 dstslot;
recv_data >> itemguid >> dstslot; recvData >> itemguid >> dstslot;
// cheating attempt, client should never send opcode in that case // cheating attempt, client should never send opcode in that case
if (!Player::IsEquipmentPos(INVENTORY_SLOT_BAG_0, dstslot)) if (!Player::IsEquipmentPos(INVENTORY_SLOT_BAG_0, dstslot))
@@ -110,12 +110,12 @@ void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket & recv_data)
_player->SwapItem(item->GetPos(), dstpos); _player->SwapItem(item->GetPos(), dstpos);
} }
void WorldSession::HandleSwapItem(WorldPacket & recv_data) void WorldSession::HandleSwapItem(WorldPacket & recvData)
{ {
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_ITEM"); //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_ITEM");
uint8 dstbag, dstslot, srcbag, srcslot; uint8 dstbag, dstslot, srcbag, srcslot;
recv_data >> dstbag >> dstslot >> srcbag >> srcslot; recvData >> dstbag >> dstslot >> srcbag >> srcslot;
//sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot); //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot);
uint16 src = ((srcbag << 8) | srcslot); uint16 src = ((srcbag << 8) | srcslot);
@@ -140,12 +140,12 @@ void WorldSession::HandleSwapItem(WorldPacket & recv_data)
_player->SwapItem(src, dst); _player->SwapItem(src, dst);
} }
void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recv_data) void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recvData)
{ {
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_AUTOEQUIP_ITEM"); //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_AUTOEQUIP_ITEM");
uint8 srcbag, srcslot; uint8 srcbag, srcslot;
recv_data >> srcbag >> srcslot; recvData >> srcbag >> srcslot;
//sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot);
Item* pSrcItem = _player->GetItemByPos(srcbag, srcslot); Item* pSrcItem = _player->GetItemByPos(srcbag, srcslot);
@@ -234,12 +234,12 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) void WorldSession::HandleDestroyItemOpcode(WorldPacket & recvData)
{ {
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_DESTROYITEM"); //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_DESTROYITEM");
uint8 bag, slot, count, data1, data2, data3; uint8 bag, slot, count, data1, data2, data3;
recv_data >> bag >> slot >> count >> data1 >> data2 >> data3; recvData >> bag >> slot >> count >> data1 >> data2 >> data3;
//sLog->outDebug("STORAGE: receive bag = %u, slot = %u, count = %u", bag, slot, count); //sLog->outDebug("STORAGE: receive bag = %u, slot = %u, count = %u", bag, slot, count);
uint16 pos = (bag << 8) | slot; uint16 pos = (bag << 8) | slot;
@@ -278,11 +278,11 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data)
} }
// Only _static_ data send in this packet !!! // Only _static_ data send in this packet !!!
void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recvData)
{ {
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_ITEM_QUERY_SINGLE"); //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_ITEM_QUERY_SINGLE");
uint32 item; uint32 item;
recv_data >> item; recvData >> item;
sLog->outInfo(LOG_FILTER_NETWORKIO, "STORAGE: Item Query = %u", item); sLog->outInfo(LOG_FILTER_NETWORKIO, "STORAGE: Item Query = %u", item);
@@ -437,12 +437,12 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleReadItem(WorldPacket & recv_data) void WorldSession::HandleReadItem(WorldPacket & recvData)
{ {
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_READ_ITEM"); //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_READ_ITEM");
uint8 bag, slot; uint8 bag, slot;
recv_data >> bag >> slot; recvData >> bag >> slot;
//sLog->outInfo(LOG_FILTER_NETWORKIO, "STORAGE: Read bag = %u, slot = %u", bag, slot); //sLog->outInfo(LOG_FILTER_NETWORKIO, "STORAGE: Read bag = %u, slot = %u", bag, slot);
Item* pItem = _player->GetItemByPos(bag, slot); Item* pItem = _player->GetItemByPos(bag, slot);
@@ -470,26 +470,26 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data)
_player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
} }
void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket & recv_data) void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY");
uint32 itemid; uint32 itemid;
uint64 guid; uint64 guid;
recv_data >> itemid >> guid; recvData >> itemid >> guid;
sLog->outInfo(LOG_FILTER_NETWORKIO, "Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u", sLog->outInfo(LOG_FILTER_NETWORKIO, "Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u",
itemid, GUID_LOPART(guid), GUID_ENPART(guid), GUID_HIPART(guid)); itemid, GUID_LOPART(guid), GUID_ENPART(guid), GUID_HIPART(guid));
} }
void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) void WorldSession::HandleSellItemOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SELL_ITEM"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SELL_ITEM");
uint64 vendorguid, itemguid; uint64 vendorguid, itemguid;
uint32 count; uint32 count;
recv_data >> vendorguid >> itemguid >> count; recvData >> vendorguid >> itemguid >> count;
if (!itemguid) if (!itemguid)
return; return;
@@ -597,13 +597,13 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
return; return;
} }
void WorldSession::HandleBuybackItem(WorldPacket & recv_data) void WorldSession::HandleBuybackItem(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUYBACK_ITEM"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUYBACK_ITEM");
uint64 vendorguid; uint64 vendorguid;
uint32 slot; uint32 slot;
recv_data >> vendorguid >> slot; recvData >> vendorguid >> slot;
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
if (!creature) if (!creature)
@@ -645,14 +645,14 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
_player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, 0, 0); _player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, 0, 0);
} }
void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM_IN_SLOT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM_IN_SLOT");
uint64 vendorguid, bagguid; uint64 vendorguid, bagguid;
uint32 item, slot, count; uint32 item, slot, count;
uint8 bagslot; uint8 bagslot;
recv_data >> vendorguid >> item >> slot >> bagguid >> bagslot >> count; recvData >> vendorguid >> item >> slot >> bagguid >> bagslot >> count;
// client expects count starting at 1, and we send vendorslot+1 to client already // client expects count starting at 1, and we send vendorslot+1 to client already
if (slot > 0) if (slot > 0)
@@ -687,14 +687,14 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data)
GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagslot); GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagslot);
} }
void WorldSession::HandleBuyItemOpcode(WorldPacket & recv_data) void WorldSession::HandleBuyItemOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM");
uint64 vendorguid; uint64 vendorguid;
uint32 item, slot, count; uint32 item, slot, count;
uint8 unk1; uint8 unk1;
recv_data >> vendorguid >> item >> slot >> count >> unk1; recvData >> vendorguid >> item >> slot >> count >> unk1;
// client expects count starting at 1, and we send vendorslot+1 to client already // client expects count starting at 1, and we send vendorslot+1 to client already
if (slot > 0) if (slot > 0)
@@ -705,11 +705,11 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket & recv_data)
GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, NULL_BAG, NULL_SLOT); GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, NULL_BAG, NULL_SLOT);
} }
void WorldSession::HandleListInventoryOpcode(WorldPacket & recv_data) void WorldSession::HandleListInventoryOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
if (!GetPlayer()->isAlive()) if (!GetPlayer()->isAlive())
return; return;
@@ -807,12 +807,12 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recvData)
{ {
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_AUTOSTORE_BAG_ITEM"); //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_AUTOSTORE_BAG_ITEM");
uint8 srcbag, srcslot, dstbag; uint8 srcbag, srcslot, dstbag;
recv_data >> srcbag >> srcslot >> dstbag; recvData >> srcbag >> srcslot >> dstbag;
//sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag);
Item* pItem = _player->GetItemByPos(srcbag, srcslot); Item* pItem = _player->GetItemByPos(srcbag, srcslot);
@@ -983,7 +983,7 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket)
} }
} }
void WorldSession::HandleSetAmmoOpcode(WorldPacket & recv_data) void WorldSession::HandleSetAmmoOpcode(WorldPacket & recvData)
{ {
if (!GetPlayer()->isAlive()) if (!GetPlayer()->isAlive())
{ {
@@ -994,7 +994,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_AMMO"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_AMMO");
uint32 item; uint32 item;
recv_data >> item; recvData >> item;
if (!item) if (!item)
GetPlayer()->RemoveAmmo(); GetPlayer()->RemoveAmmo();
@@ -1024,11 +1024,11 @@ void WorldSession::SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid,
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recvData)
{ {
uint32 itemid; uint32 itemid;
recv_data >> itemid; recvData >> itemid;
recv_data.read_skip<uint64>(); // guid recvData.read_skip<uint64>(); // guid
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_NAME_QUERY %u", itemid);
ItemSetNameEntry const* pName = sObjectMgr->GetItemSetNameEntry(itemid); ItemSetNameEntry const* pName = sObjectMgr->GetItemSetNameEntry(itemid);
@@ -1048,14 +1048,14 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WRAP_ITEM"); sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WRAP_ITEM");
uint8 gift_bag, gift_slot, item_bag, item_slot; uint8 gift_bag, gift_slot, item_bag, item_slot;
recv_data >> gift_bag >> gift_slot; // paper recvData >> gift_bag >> gift_slot; // paper
recv_data >> item_bag >> item_slot; // item recvData >> item_bag >> item_slot; // item
sLog->outDebug(LOG_FILTER_NETWORKIO, "WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot); sLog->outDebug(LOG_FILTER_NETWORKIO, "WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot);
@@ -1159,19 +1159,19 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
_player->DestroyItemCount(gift, count, true); _player->DestroyItemCount(gift, count, true);
} }
void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) void WorldSession::HandleSocketOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SOCKET_GEMS"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SOCKET_GEMS");
uint64 item_guid; uint64 item_guid;
uint64 gem_guids[MAX_GEM_SOCKETS]; uint64 gem_guids[MAX_GEM_SOCKETS];
recv_data >> item_guid; recvData >> item_guid;
if (!item_guid) if (!item_guid)
return; return;
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) for (int i = 0; i < MAX_GEM_SOCKETS; ++i)
recv_data >> gem_guids[i]; recvData >> gem_guids[i];
//cheat -> tried to socket same gem multiple times //cheat -> tried to socket same gem multiple times
if ((gem_guids[0] && (gem_guids[0] == gem_guids[1] || gem_guids[0] == gem_guids[2])) || if ((gem_guids[0] && (gem_guids[0] == gem_guids[1] || gem_guids[0] == gem_guids[2])) ||
@@ -1353,13 +1353,13 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
itemTarget->ClearSoulboundTradeable(_player); // clear tradeable flag itemTarget->ClearSoulboundTradeable(_player); // clear tradeable flag
} }
void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data) void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT");
uint32 eslot; uint32 eslot;
recv_data >> eslot; recvData >> eslot;
// apply only to equipped item // apply only to equipped item
if (!Player::IsEquipmentPos(INVENTORY_SLOT_BAG_0, eslot)) if (!Player::IsEquipmentPos(INVENTORY_SLOT_BAG_0, eslot))
@@ -1377,12 +1377,12 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data)
item->ClearEnchantment(TEMP_ENCHANTMENT_SLOT); item->ClearEnchantment(TEMP_ENCHANTMENT_SLOT);
} }
void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND_INFO"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND_INFO");
uint64 guid; uint64 guid;
recv_data >> guid; // item guid recvData >> guid; // item guid
Item* item = _player->GetItemByGuid(guid); Item* item = _player->GetItemByGuid(guid);
if (!item) if (!item)
@@ -1394,11 +1394,11 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data)
GetPlayer()->SendRefundInfo(item); GetPlayer()->SendRefundInfo(item);
} }
void WorldSession::HandleItemRefund(WorldPacket &recv_data) void WorldSession::HandleItemRefund(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND");
uint64 guid; uint64 guid;
recv_data >> guid; // item guid recvData >> guid; // item guid
Item* item = _player->GetItemByGuid(guid); Item* item = _player->GetItemByGuid(guid);
if (!item) if (!item)
@@ -1415,10 +1415,10 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data)
* *
* This function is called when player clicks on item which has some flag set * This function is called when player clicks on item which has some flag set
*/ */
void WorldSession::HandleItemTextQuery(WorldPacket & recv_data ) void WorldSession::HandleItemTextQuery(WorldPacket & recvData )
{ {
uint64 itemGuid; uint64 itemGuid;
recv_data >> itemGuid; recvData >> itemGuid;
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid));
+28 -28
View File
@@ -44,13 +44,13 @@ void BuildPartyLockDungeonBlock(WorldPacket& data, const LfgLockPartyMap& lockMa
} }
} }
void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData)
{ {
if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER) || if (!sLFGMgr->isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER) ||
(GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID() && (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID() &&
(GetPlayer()->GetGroup()->GetMembersCount() == MAXGROUPSIZE || !GetPlayer()->GetGroup()->isLFGGroup()))) (GetPlayer()->GetGroup()->GetMembersCount() == MAXGROUPSIZE || !GetPlayer()->GetGroup()->isLFGGroup())))
{ {
recv_data.rfinish(); recvData.rfinish();
return; return;
} }
@@ -58,32 +58,32 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data)
uint32 dungeon; uint32 dungeon;
uint32 roles; uint32 roles;
recv_data >> roles; recvData >> roles;
recv_data.read_skip<uint16>(); // uint8 (always 0) - uint8 (always 0) recvData.read_skip<uint16>(); // uint8 (always 0) - uint8 (always 0)
recv_data >> numDungeons; recvData >> numDungeons;
if (!numDungeons) if (!numDungeons)
{ {
sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID()); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID());
recv_data.rfinish(); recvData.rfinish();
return; return;
} }
LfgDungeonSet newDungeons; LfgDungeonSet newDungeons;
for (int8 i = 0; i < numDungeons; ++i) for (int8 i = 0; i < numDungeons; ++i)
{ {
recv_data >> dungeon; recvData >> dungeon;
newDungeons.insert((dungeon & 0x00FFFFFF)); // remove the type from the dungeon entry newDungeons.insert((dungeon & 0x00FFFFFF)); // remove the type from the dungeon entry
} }
recv_data.read_skip<uint32>(); // for 0..uint8 (always 3) { uint8 (always 0) } recvData.read_skip<uint32>(); // for 0..uint8 (always 3) { uint8 (always 0) }
std::string comment; std::string comment;
recv_data >> comment; recvData >> comment;
sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str()); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str());
sLFGMgr->JoinLfg(GetPlayer(), uint8(roles), newDungeons, comment); sLFGMgr->JoinLfg(GetPlayer(), uint8(roles), newDungeons, comment);
} }
void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recvData*/)
{ {
Group* grp = GetPlayer()->GetGroup(); Group* grp = GetPlayer()->GetGroup();
uint64 guid = GetPlayer()->GetGUID(); uint64 guid = GetPlayer()->GetGUID();
@@ -96,21 +96,21 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/)
sLFGMgr->LeaveLfg(gguid); sLFGMgr->LeaveLfg(gguid);
} }
void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recv_data) void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recvData)
{ {
uint32 lfgGroupID; // Internal lfgGroupID uint32 lfgGroupID; // Internal lfgGroupID
bool accept; // Accept to join? bool accept; // Accept to join?
recv_data >> lfgGroupID; recvData >> lfgGroupID;
recv_data >> accept; recvData >> accept;
sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0);
sLFGMgr->UpdateProposal(lfgGroupID, GetPlayer()->GetGUID(), accept); sLFGMgr->UpdateProposal(lfgGroupID, GetPlayer()->GetGUID(), accept);
} }
void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recv_data) void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData)
{ {
uint8 roles; uint8 roles;
recv_data >> roles; // Player Group Roles recvData >> roles; // Player Group Roles
uint64 guid = GetPlayer()->GetGUID(); uint64 guid = GetPlayer()->GetGUID();
Group* grp = GetPlayer()->GetGroup(); Group* grp = GetPlayer()->GetGroup();
if (!grp) if (!grp)
@@ -123,36 +123,36 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recv_data)
sLFGMgr->UpdateRoleCheck(gguid, guid, roles); sLFGMgr->UpdateRoleCheck(gguid, guid, roles);
} }
void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recv_data) void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recvData)
{ {
std::string comment; std::string comment;
recv_data >> comment; recvData >> comment;
uint64 guid = GetPlayer()->GetGUID(); uint64 guid = GetPlayer()->GetGUID();
sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_SET_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_SET_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str());
sLFGMgr->SetComment(guid, comment); sLFGMgr->SetComment(guid, comment);
} }
void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recv_data) void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recvData)
{ {
bool agree; // Agree to kick player bool agree; // Agree to kick player
recv_data >> agree; recvData >> agree;
uint64 guid = GetPlayer()->GetGUID(); uint64 guid = GetPlayer()->GetGUID();
sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", guid, agree ? 1 : 0); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", guid, agree ? 1 : 0);
sLFGMgr->UpdateBoot(guid, agree); sLFGMgr->UpdateBoot(guid, agree);
} }
void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recv_data) void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recvData)
{ {
bool out; bool out;
recv_data >> out; recvData >> out;
sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0);
sLFGMgr->TeleportPlayer(GetPlayer(), out, true); sLFGMgr->TeleportPlayer(GetPlayer(), out, true);
} }
void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*/)
{ {
uint64 guid = GetPlayer()->GetGUID(); uint64 guid = GetPlayer()->GetGUID();
sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_PLAYER_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_PLAYER_LOCK_INFO_REQUEST [" UI64FMTD "]", guid);
@@ -231,7 +231,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData*/)
{ {
uint64 guid = GetPlayer()->GetGUID(); uint64 guid = GetPlayer()->GetGUID();
sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid);
@@ -265,18 +265,18 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleLfrJoinOpcode(WorldPacket& recv_data) void WorldSession::HandleLfrJoinOpcode(WorldPacket& recvData)
{ {
uint32 entry; // Raid id to search uint32 entry; // Raid id to search
recv_data >> entry; recvData >> entry;
sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_LFR_JOIN [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), entry); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_LFR_JOIN [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), entry);
//SendLfrUpdateListOpcode(entry); //SendLfrUpdateListOpcode(entry);
} }
void WorldSession::HandleLfrLeaveOpcode(WorldPacket& recv_data) void WorldSession::HandleLfrLeaveOpcode(WorldPacket& recvData)
{ {
uint32 dungeonId; // Raid id queue to leave uint32 dungeonId; // Raid id queue to leave
recv_data >> dungeonId; recvData >> dungeonId;
sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_LFR_LEAVE [" UI64FMTD "] dungeonId: %u", GetPlayer()->GetGUID(), dungeonId); sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_LFR_LEAVE [" UI64FMTD "] dungeonId: %u", GetPlayer()->GetGUID(), dungeonId);
//sLFGMgr->LeaveLfr(GetPlayer(), dungeonId); //sLFGMgr->LeaveLfr(GetPlayer(), dungeonId);
} }
@@ -617,7 +617,7 @@ void WorldSession::SendLfgTeleportError(uint8 err)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleLfgGetStatus(WorldPacket& /*recv_data*/) void WorldSession::HandleLfgGetStatus(WorldPacket& /*recvData*/)
{ {
uint64 guid = GetPlayer()->GetGUID(); uint64 guid = GetPlayer()->GetGUID();
sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_GET_STATUS [" UI64FMTD "]", guid); sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_GET_STATUS [" UI64FMTD "]", guid);
+7 -7
View File
@@ -30,7 +30,7 @@
#include "World.h" #include "World.h"
#include "Util.h" #include "Util.h"
void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_LOOT_ITEM"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_LOOT_ITEM");
Player* player = GetPlayer(); Player* player = GetPlayer();
@@ -38,7 +38,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data)
Loot* loot = NULL; Loot* loot = NULL;
uint8 lootSlot = 0; uint8 lootSlot = 0;
recv_data >> lootSlot; recvData >> lootSlot;
if (IS_GAMEOBJECT_GUID(lguid)) if (IS_GAMEOBJECT_GUID(lguid))
{ {
@@ -94,7 +94,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data)
player->StoreLootItem(lootSlot, loot); player->StoreLootItem(lootSlot, loot);
} }
void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_MONEY"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_MONEY");
@@ -202,12 +202,12 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/)
} }
} }
void WorldSession::HandleLootOpcode(WorldPacket & recv_data) void WorldSession::HandleLootOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
// Check possible cheat // Check possible cheat
if (!_player->isAlive()) if (!_player->isAlive())
@@ -428,12 +428,12 @@ void WorldSession::DoLootRelease(uint64 lguid)
loot->RemoveLooter(player->GetGUID()); loot->RemoveLooter(player->GetGUID());
} }
void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recvData)
{ {
uint8 slotid; uint8 slotid;
uint64 lootguid, target_playerguid; uint64 lootguid, target_playerguid;
recv_data >> lootguid >> slotid >> target_playerguid; recvData >> lootguid >> slotid >> target_playerguid;
if (!_player->GetGroup() || _player->GetGroup()->GetLooterGuid() != _player->GetGUID()) if (!_player->GetGroup() || _player->GetGroup()->GetLooterGuid() != _player->GetGUID())
{ {
+38 -38
View File
@@ -29,29 +29,29 @@
#include "Item.h" #include "Item.h"
#include "AccountMgr.h" #include "AccountMgr.h"
void WorldSession::HandleSendMail(WorldPacket & recv_data) void WorldSession::HandleSendMail(WorldPacket & recvData)
{ {
uint64 mailbox, unk3; uint64 mailbox, unk3;
std::string receiver, subject, body; std::string receiver, subject, body;
uint32 unk1, unk2, money, COD; uint32 unk1, unk2, money, COD;
uint8 unk4; uint8 unk4;
recv_data >> mailbox; recvData >> mailbox;
recv_data >> receiver; recvData >> receiver;
recv_data >> subject; recvData >> subject;
recv_data >> body; recvData >> body;
recv_data >> unk1; // stationery? recvData >> unk1; // stationery?
recv_data >> unk2; // 0x00000000 recvData >> unk2; // 0x00000000
uint8 items_count; uint8 items_count;
recv_data >> items_count; // attached items count recvData >> items_count; // attached items count
if (items_count > MAX_MAIL_ITEMS) // client limit if (items_count > MAX_MAIL_ITEMS) // client limit
{ {
GetPlayer()->SendMailResult(0, MAIL_SEND, MAIL_ERR_TOO_MANY_ATTACHMENTS); GetPlayer()->SendMailResult(0, MAIL_SEND, MAIL_ERR_TOO_MANY_ATTACHMENTS);
recv_data.rfinish(); // set to end to avoid warnings spam recvData.rfinish(); // set to end to avoid warnings spam
return; return;
} }
@@ -59,13 +59,13 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
for (uint8 i = 0; i < items_count; ++i) for (uint8 i = 0; i < items_count; ++i)
{ {
recv_data.read_skip<uint8>(); // item slot in mail, not used recvData.read_skip<uint8>(); // item slot in mail, not used
recv_data >> itemGUIDs[i]; recvData >> itemGUIDs[i];
} }
recv_data >> money >> COD; // money and cod recvData >> money >> COD; // money and cod
recv_data >> unk3; // const 0 recvData >> unk3; // const 0
recv_data >> unk4; // const 0 recvData >> unk4; // const 0
// packet read complete, now do check // packet read complete, now do check
@@ -302,12 +302,12 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
} }
//called when mail is read //called when mail is read
void WorldSession::HandleMailMarkAsRead(WorldPacket & recv_data) void WorldSession::HandleMailMarkAsRead(WorldPacket & recvData)
{ {
uint64 mailbox; uint64 mailbox;
uint32 mailId; uint32 mailId;
recv_data >> mailbox; recvData >> mailbox;
recv_data >> mailId; recvData >> mailId;
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
return; return;
@@ -325,13 +325,13 @@ void WorldSession::HandleMailMarkAsRead(WorldPacket & recv_data)
} }
//called when client deletes mail //called when client deletes mail
void WorldSession::HandleMailDelete(WorldPacket & recv_data) void WorldSession::HandleMailDelete(WorldPacket & recvData)
{ {
uint64 mailbox; uint64 mailbox;
uint32 mailId; uint32 mailId;
recv_data >> mailbox; recvData >> mailbox;
recv_data >> mailId; recvData >> mailId;
recv_data.read_skip<uint32>(); // mailTemplateId recvData.read_skip<uint32>(); // mailTemplateId
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
return; return;
@@ -353,13 +353,13 @@ void WorldSession::HandleMailDelete(WorldPacket & recv_data)
player->SendMailResult(mailId, MAIL_DELETED, MAIL_OK); player->SendMailResult(mailId, MAIL_DELETED, MAIL_OK);
} }
void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data) void WorldSession::HandleMailReturnToSender(WorldPacket & recvData)
{ {
uint64 mailbox; uint64 mailbox;
uint32 mailId; uint32 mailId;
recv_data >> mailbox; recvData >> mailbox;
recv_data >> mailId; recvData >> mailId;
recv_data.read_skip<uint64>(); // original sender GUID for return to, not used recvData.read_skip<uint64>(); // original sender GUID for return to, not used
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
return; return;
@@ -417,14 +417,14 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data)
} }
//called when player takes item attached in mail //called when player takes item attached in mail
void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) void WorldSession::HandleMailTakeItem(WorldPacket & recvData)
{ {
uint64 mailbox; uint64 mailbox;
uint32 mailId; uint32 mailId;
uint32 itemId; uint32 itemId;
recv_data >> mailbox; recvData >> mailbox;
recv_data >> mailId; recvData >> mailId;
recv_data >> itemId; // item guid low recvData >> itemId; // item guid low
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
return; return;
@@ -513,12 +513,12 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data)
player->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_EQUIP_ERROR, msg); player->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_EQUIP_ERROR, msg);
} }
void WorldSession::HandleMailTakeMoney(WorldPacket & recv_data) void WorldSession::HandleMailTakeMoney(WorldPacket & recvData)
{ {
uint64 mailbox; uint64 mailbox;
uint32 mailId; uint32 mailId;
recv_data >> mailbox; recvData >> mailbox;
recv_data >> mailId; recvData >> mailId;
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
return; return;
@@ -547,10 +547,10 @@ void WorldSession::HandleMailTakeMoney(WorldPacket & recv_data)
} }
//called when player lists his received mails //called when player lists his received mails
void WorldSession::HandleGetMailList(WorldPacket & recv_data) void WorldSession::HandleGetMailList(WorldPacket & recvData)
{ {
uint64 mailbox; uint64 mailbox;
recv_data >> mailbox; recvData >> mailbox;
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
return; return;
@@ -669,13 +669,13 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data)
} }
//used when player copies mail body to his inventory //used when player copies mail body to his inventory
void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) void WorldSession::HandleMailCreateTextItem(WorldPacket & recvData)
{ {
uint64 mailbox; uint64 mailbox;
uint32 mailId; uint32 mailId;
recv_data >> mailbox; recvData >> mailbox;
recv_data >> mailId; recvData >> mailId;
if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX))
return; return;
@@ -735,7 +735,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data)
} }
//TODO Fix me! ... this void has probably bad condition, but good data are sent //TODO Fix me! ... this void has probably bad condition, but good data are sent
void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recv_data*/) void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recvData*/)
{ {
WorldPacket data(MSG_QUERY_NEXT_MAIL_TIME, 8); WorldPacket data(MSG_QUERY_NEXT_MAIL_TIME, 8);
+34 -34
View File
@@ -31,7 +31,7 @@
#include "InstanceSaveMgr.h" #include "InstanceSaveMgr.h"
#include "ObjectMgr.h" #include "ObjectMgr.h"
void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got MSG_MOVE_WORLDPORT_ACK."); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got MSG_MOVE_WORLDPORT_ACK.");
HandleMoveWorldportAckOpcode(); HandleMoveWorldportAckOpcode();
@@ -188,15 +188,15 @@ void WorldSession::HandleMoveWorldportAckOpcode()
GetPlayer()->ProcessDelayedOperations(); GetPlayer()->ProcessDelayedOperations();
} }
void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) void WorldSession::HandleMoveTeleportAck(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_MOVE_TELEPORT_ACK"); sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_MOVE_TELEPORT_ACK");
uint64 guid; uint64 guid;
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
uint32 flags, time; uint32 flags, time;
recv_data >> flags >> time; recvData >> flags >> time;
sLog->outDebug(LOG_FILTER_NETWORKIO, "Guid " UI64FMTD, guid); sLog->outDebug(LOG_FILTER_NETWORKIO, "Guid " UI64FMTD, guid);
sLog->outDebug(LOG_FILTER_NETWORKIO, "Flags %u, time %u", flags, time/IN_MILLISECONDS); sLog->outDebug(LOG_FILTER_NETWORKIO, "Flags %u, time %u", flags, time/IN_MILLISECONDS);
@@ -407,9 +407,9 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData)
} }
} }
void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData)
{ {
uint32 opcode = recv_data.GetOpcode(); uint32 opcode = recvData.GetOpcode();
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode);
/* extract packet */ /* extract packet */
@@ -417,24 +417,24 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
uint32 unk1; uint32 unk1;
float newspeed; float newspeed;
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
// now can skip not our packet // now can skip not our packet
if (_player->GetGUID() != guid) if (_player->GetGUID() != guid)
{ {
recv_data.rfinish(); // prevent warnings spam recvData.rfinish(); // prevent warnings spam
return; return;
} }
// continue parse packet // continue parse packet
recv_data >> unk1; // counter or moveEvent recvData >> unk1; // counter or moveEvent
MovementInfo movementInfo; MovementInfo movementInfo;
movementInfo.guid = guid; movementInfo.guid = guid;
ReadMovementInfo(recv_data, &movementInfo); ReadMovementInfo(recvData, &movementInfo);
recv_data >> newspeed; recvData >> newspeed;
/*----------------*/ /*----------------*/
// client ACK send one packet for mounted/run case and need skip all except last from its // client ACK send one packet for mounted/run case and need skip all except last from its
@@ -486,12 +486,12 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
} }
} }
void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
if (GetPlayer()->IsInWorld()) if (GetPlayer()->IsInWorld())
{ {
@@ -500,22 +500,22 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
} }
} }
void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) void WorldSession::HandleMoveNotActiveMover(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER");
uint64 old_mover_guid; uint64 old_mover_guid;
recv_data.readPackGUID(old_mover_guid); recvData.readPackGUID(old_mover_guid);
MovementInfo mi; MovementInfo mi;
ReadMovementInfo(recv_data, &mi); ReadMovementInfo(recvData, &mi);
mi.guid = old_mover_guid; mi.guid = old_mover_guid;
_player->m_movementInfo = mi; _player->m_movementInfo = mi;
} }
void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvData*/)
{ {
WorldPacket data(SMSG_MOUNTSPECIAL_ANIM, 8); WorldPacket data(SMSG_MOUNTSPECIAL_ANIM, 8);
data << uint64(GetPlayer()->GetGUID()); data << uint64(GetPlayer()->GetGUID());
@@ -523,20 +523,20 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recv_data*/)
GetPlayer()->SendMessageToSet(&data, false); GetPlayer()->SendMessageToSet(&data, false);
} }
void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) void WorldSession::HandleMoveKnockBackAck(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK"); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK");
uint64 guid; uint64 guid;
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
if (_player->m_mover->GetGUID() != guid) if (_player->m_mover->GetGUID() != guid)
return; return;
recv_data.read_skip<uint32>(); // unk recvData.read_skip<uint32>(); // unk
MovementInfo movementInfo; MovementInfo movementInfo;
ReadMovementInfo(recv_data, &movementInfo); ReadMovementInfo(recvData, &movementInfo);
_player->m_movementInfo = movementInfo; _player->m_movementInfo = movementInfo;
@@ -553,45 +553,45 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data)
_player->SendMessageToSet(&data, false); _player->SendMessageToSet(&data, false);
} }
void WorldSession::HandleMoveHoverAck(WorldPacket& recv_data) void WorldSession::HandleMoveHoverAck(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_HOVER_ACK"); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_HOVER_ACK");
uint64 guid; // guid - unused uint64 guid; // guid - unused
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
recv_data.read_skip<uint32>(); // unk recvData.read_skip<uint32>(); // unk
MovementInfo movementInfo; MovementInfo movementInfo;
ReadMovementInfo(recv_data, &movementInfo); ReadMovementInfo(recvData, &movementInfo);
recv_data.read_skip<uint32>(); // unk2 recvData.read_skip<uint32>(); // unk2
} }
void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recv_data) void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_WATER_WALK_ACK"); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_WATER_WALK_ACK");
uint64 guid; // guid - unused uint64 guid; // guid - unused
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
recv_data.read_skip<uint32>(); // unk recvData.read_skip<uint32>(); // unk
MovementInfo movementInfo; MovementInfo movementInfo;
ReadMovementInfo(recv_data, &movementInfo); ReadMovementInfo(recvData, &movementInfo);
recv_data.read_skip<uint32>(); // unk2 recvData.read_skip<uint32>(); // unk2
} }
void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data) void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData)
{ {
if (!_player->isAlive() || _player->isInCombat()) if (!_player->isAlive() || _player->isInCombat())
return; return;
uint64 summoner_guid; uint64 summoner_guid;
bool agree; bool agree;
recv_data >> summoner_guid; recvData >> summoner_guid;
recv_data >> agree; recvData >> agree;
_player->SummonIfPossible(agree); _player->SummonIfPossible(agree);
} }
+30 -30
View File
@@ -47,10 +47,10 @@ enum StableResultCode
STABLE_ERR_EXOTIC = 0x0C // "you are unable to control exotic creatures" STABLE_ERR_EXOTIC = 0x0C // "you are unable to control exotic creatures"
}; };
void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data) void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TABARDDESIGNER); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TABARDDESIGNER);
if (!unit) if (!unit)
@@ -73,13 +73,13 @@ void WorldSession::SendTabardVendorActivate(uint64 guid)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data) void WorldSession::HandleBankerActivateOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BANKER_ACTIVATE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BANKER_ACTIVATE");
recv_data >> guid; recvData >> guid;
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER);
if (!unit) if (!unit)
@@ -102,11 +102,11 @@ void WorldSession::SendShowBank(uint64 guid)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleTrainerListOpcode(WorldPacket & recv_data) void WorldSession::HandleTrainerListOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
SendTrainerList(guid); SendTrainerList(guid);
} }
@@ -234,12 +234,12 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
uint32 spellId = 0; uint32 spellId = 0;
recv_data >> guid >> spellId; recvData >> guid >> spellId;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u", uint32(GUID_LOPART(guid)), spellId); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u", uint32(GUID_LOPART(guid)), spellId);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
@@ -294,12 +294,12 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GOSSIP_HELLO"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GOSSIP_HELLO");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
if (!unit) if (!unit)
@@ -343,7 +343,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
unit->AI()->sGossipHello(_player); unit->AI()->sGossipHello(_player);
} }
/*void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) /*void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION");
@@ -352,12 +352,12 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
uint64 guid; uint64 guid;
std::string code = ""; std::string code = "";
recv_data >> guid >> unk >> option; recvData >> guid >> unk >> option;
if (_player->PlayerTalkClass->GossipOptionCoded(option)) if (_player->PlayerTalkClass->GossipOptionCoded(option))
{ {
sLog->outDebug(LOG_FILTER_PACKETIO, "reading string"); sLog->outDebug(LOG_FILTER_PACKETIO, "reading string");
recv_data >> code; recvData >> code;
sLog->outDebug(LOG_FILTER_PACKETIO, "string read: %s", code.c_str()); sLog->outDebug(LOG_FILTER_PACKETIO, "string read: %s", code.c_str());
} }
@@ -384,13 +384,13 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
} }
}*/ }*/
void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data) void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SPIRIT_HEALER_ACTIVATE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SPIRIT_HEALER_ACTIVATE");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_SPIRITHEALER); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_SPIRITHEALER);
if (!unit) if (!unit)
@@ -439,10 +439,10 @@ void WorldSession::SendSpiritResurrect()
_player->UpdateObjectVisibility(); _player->UpdateObjectVisibility();
} }
void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data) void WorldSession::HandleBinderActivateOpcode(WorldPacket & recvData)
{ {
uint64 npcGUID; uint64 npcGUID;
recv_data >> npcGUID; recvData >> npcGUID;
if (!GetPlayer()->IsInWorld() || !GetPlayer()->isAlive()) if (!GetPlayer()->IsInWorld() || !GetPlayer()->isAlive())
return; return;
@@ -496,12 +496,12 @@ void WorldSession::SendBindPoint(Creature* npc)
_player->PlayerTalkClass->SendCloseGossip(); _player->PlayerTalkClass->SendCloseGossip();
} }
void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data) void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS");
uint64 npcGUID; uint64 npcGUID;
recv_data >> npcGUID; recvData >> npcGUID;
if (!CheckStableMaster(npcGUID)) if (!CheckStableMaster(npcGUID))
return; return;
@@ -589,12 +589,12 @@ void WorldSession::SendStableResult(uint8 res)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleStablePet(WorldPacket & recv_data) void WorldSession::HandleStablePet(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_PET"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_PET");
uint64 npcGUID; uint64 npcGUID;
recv_data >> npcGUID; recvData >> npcGUID;
if (!GetPlayer()->isAlive()) if (!GetPlayer()->isAlive())
{ {
@@ -664,13 +664,13 @@ void WorldSession::HandleStablePetCallback(PreparedQueryResult result)
SendStableResult(STABLE_ERR_STABLE); SendStableResult(STABLE_ERR_STABLE);
} }
void WorldSession::HandleUnstablePet(WorldPacket & recv_data) void WorldSession::HandleUnstablePet(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_UNSTABLE_PET."); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_UNSTABLE_PET.");
uint64 npcGUID; uint64 npcGUID;
uint32 petnumber; uint32 petnumber;
recv_data >> npcGUID >> petnumber; recvData >> npcGUID >> petnumber;
if (!CheckStableMaster(npcGUID)) if (!CheckStableMaster(npcGUID))
{ {
@@ -745,12 +745,12 @@ void WorldSession::HandleUnstablePetCallback(PreparedQueryResult result, uint32
SendStableResult(STABLE_SUCCESS_UNSTABLE); SendStableResult(STABLE_SUCCESS_UNSTABLE);
} }
void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) void WorldSession::HandleBuyStableSlot(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_BUY_STABLE_SLOT."); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_BUY_STABLE_SLOT.");
uint64 npcGUID; uint64 npcGUID;
recv_data >> npcGUID; recvData >> npcGUID;
if (!CheckStableMaster(npcGUID)) if (!CheckStableMaster(npcGUID))
{ {
@@ -778,18 +778,18 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data)
SendStableResult(STABLE_ERR_STABLE); SendStableResult(STABLE_ERR_STABLE);
} }
void WorldSession::HandleStableRevivePet(WorldPacket &/* recv_data */) void WorldSession::HandleStableRevivePet(WorldPacket &/* recvData */)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleStableRevivePet: Not implemented"); sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleStableRevivePet: Not implemented");
} }
void WorldSession::HandleStableSwapPet(WorldPacket & recv_data) void WorldSession::HandleStableSwapPet(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_SWAP_PET."); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_SWAP_PET.");
uint64 npcGUID; uint64 npcGUID;
uint32 petId; uint32 petId;
recv_data >> npcGUID >> petId; recvData >> npcGUID >> petId;
if (!CheckStableMaster(npcGUID)) if (!CheckStableMaster(npcGUID))
{ {
@@ -875,14 +875,14 @@ void WorldSession::HandleStableSwapPetCallback(PreparedQueryResult result, uint3
SendStableResult(STABLE_SUCCESS_UNSTABLE); SendStableResult(STABLE_SUCCESS_UNSTABLE);
} }
void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) void WorldSession::HandleRepairItemOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REPAIR_ITEM"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REPAIR_ITEM");
uint64 npcGUID, itemGUID; uint64 npcGUID, itemGUID;
uint8 guildBank; // new in 2.3.2, bool that means from guild bank money uint8 guildBank; // new in 2.3.2, bool that means from guild bank money
recv_data >> npcGUID >> itemGUID >> guildBank; recvData >> npcGUID >> itemGUID >> guildBank;
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR);
if (!unit) if (!unit)
+29 -29
View File
@@ -32,10 +32,10 @@
#include "Group.h" #include "Group.h"
#include "SpellInfo.h" #include "SpellInfo.h"
void WorldSession::HandleDismissCritter(WorldPacket &recv_data) void WorldSession::HandleDismissCritter(WorldPacket &recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD, guid); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD, guid);
@@ -55,14 +55,14 @@ void WorldSession::HandleDismissCritter(WorldPacket &recv_data)
} }
} }
void WorldSession::HandlePetAction(WorldPacket & recv_data) void WorldSession::HandlePetAction(WorldPacket & recvData)
{ {
uint64 guid1; uint64 guid1;
uint32 data; uint32 data;
uint64 guid2; uint64 guid2;
recv_data >> guid1; //pet guid recvData >> guid1; //pet guid
recv_data >> data; recvData >> data;
recv_data >> guid2; //tag guid recvData >> guid2; //tag guid
uint32 spellid = UNIT_ACTION_BUTTON_ACTION(data); uint32 spellid = UNIT_ACTION_BUTTON_ACTION(data);
uint8 flag = UNIT_ACTION_BUTTON_TYPE(data); //delete = 0x07 CastSpell = C1 uint8 flag = UNIT_ACTION_BUTTON_TYPE(data); //delete = 0x07 CastSpell = C1
@@ -110,10 +110,10 @@ void WorldSession::HandlePetAction(WorldPacket & recv_data)
} }
} }
void WorldSession::HandlePetStopAttack(WorldPacket &recv_data) void WorldSession::HandlePetStopAttack(WorldPacket &recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid);
@@ -402,15 +402,15 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
} }
} }
void WorldSession::HandlePetNameQuery(WorldPacket & recv_data) void WorldSession::HandlePetNameQuery(WorldPacket & recvData)
{ {
sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetNameQuery. CMSG_PET_NAME_QUERY"); sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetNameQuery. CMSG_PET_NAME_QUERY");
uint32 petnumber; uint32 petnumber;
uint64 petguid; uint64 petguid;
recv_data >> petnumber; recvData >> petnumber;
recv_data >> petguid; recvData >> petguid;
SendPetNameQuery(petguid, petnumber); SendPetNameQuery(petguid, petnumber);
} }
@@ -469,14 +469,14 @@ bool WorldSession::CheckStableMaster(uint64 guid)
return true; return true;
} }
void WorldSession::HandlePetSetAction(WorldPacket & recv_data) void WorldSession::HandlePetSetAction(WorldPacket & recvData)
{ {
sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetSetAction. CMSG_PET_SET_ACTION"); sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetSetAction. CMSG_PET_SET_ACTION");
uint64 petguid; uint64 petguid;
uint8 count; uint8 count;
recv_data >> petguid; recvData >> petguid;
Unit* pet = ObjectAccessor::GetUnit(*_player, petguid); Unit* pet = ObjectAccessor::GetUnit(*_player, petguid);
@@ -493,7 +493,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data)
return; return;
} }
count = (recv_data.size() == 24) ? 2 : 1; count = (recvData.size() == 24) ? 2 : 1;
uint32 position[2]; uint32 position[2];
uint32 data[2]; uint32 data[2];
@@ -501,8 +501,8 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data)
for (uint8 i = 0; i < count; ++i) for (uint8 i = 0; i < count; ++i)
{ {
recv_data >> position[i]; recvData >> position[i];
recv_data >> data[i]; recvData >> data[i];
uint8 act_state = UNIT_ACTION_BUTTON_TYPE(data[i]); uint8 act_state = UNIT_ACTION_BUTTON_TYPE(data[i]);
@@ -586,7 +586,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data)
} }
} }
void WorldSession::HandlePetRename(WorldPacket & recv_data) void WorldSession::HandlePetRename(WorldPacket & recvData)
{ {
sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetRename. CMSG_PET_RENAME"); sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetRename. CMSG_PET_RENAME");
@@ -596,9 +596,9 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data)
std::string name; std::string name;
DeclinedName declinedname; DeclinedName declinedname;
recv_data >> petguid; recvData >> petguid;
recv_data >> name; recvData >> name;
recv_data >> isdeclined; recvData >> isdeclined;
Pet* pet = ObjectAccessor::FindPet(petguid); Pet* pet = ObjectAccessor::FindPet(petguid);
// check it! // check it!
@@ -632,7 +632,7 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data)
{ {
for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
{ {
recv_data >> declinedname.name[i]; recvData >> declinedname.name[i];
} }
std::wstring wname; std::wstring wname;
@@ -671,10 +671,10 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data)
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped
} }
void WorldSession::HandlePetAbandon(WorldPacket & recv_data) void WorldSession::HandlePetAbandon(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; //pet guid recvData >> guid; //pet guid
sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid)); sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid));
if (!_player->IsInWorld()) if (!_player->IsInWorld())
@@ -855,33 +855,33 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandlePetLearnTalent(WorldPacket & recv_data) void WorldSession::HandlePetLearnTalent(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_LEARN_TALENT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_LEARN_TALENT");
uint64 guid; uint64 guid;
uint32 talent_id, requested_rank; uint32 talent_id, requested_rank;
recv_data >> guid >> talent_id >> requested_rank; recvData >> guid >> talent_id >> requested_rank;
_player->LearnPetTalent(guid, talent_id, requested_rank); _player->LearnPetTalent(guid, talent_id, requested_rank);
_player->SendTalentsInfoData(true); _player->SendTalentsInfoData(true);
} }
void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket & recv_data) void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS_PET"); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS_PET");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
uint32 talentsCount; uint32 talentsCount;
recv_data >> talentsCount; recvData >> talentsCount;
uint32 talentId, talentRank; uint32 talentId, talentRank;
for (uint32 i = 0; i < talentsCount; ++i) for (uint32 i = 0; i < talentsCount; ++i)
{ {
recv_data >> talentId >> talentRank; recvData >> talentId >> talentRank;
_player->LearnPetTalent(guid, talentId, talentRank); _player->LearnPetTalent(guid, talentId, talentRank);
} }
+61 -66
View File
@@ -33,12 +33,6 @@
#define CHARTER_DISPLAY_ID 16161 #define CHARTER_DISPLAY_ID 16161
/*enum PetitionType // dbc data
{
PETITION_TYPE_GUILD = 1,
PETITION_TYPE_ARENA_TEAM = 3
};*/
// Charters ID in item_template // Charters ID in item_template
enum CharterItemIDs enum CharterItemIDs
{ {
@@ -56,7 +50,7 @@ enum CharterCosts
ARENA_TEAM_CHARTER_5v5_COST = 2000000 ARENA_TEAM_CHARTER_5v5_COST = 2000000
}; };
void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_BUY"); sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_BUY");
@@ -64,28 +58,28 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
uint32 clientIndex; // 1 for guild and arenaslot+1 for arenas in client uint32 clientIndex; // 1 for guild and arenaslot+1 for arenas in client
std::string name; std::string name;
recv_data >> guidNPC; // NPC GUID recvData >> guidNPC; // NPC GUID
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
recv_data.read_skip<uint64>(); // 0 recvData.read_skip<uint64>(); // 0
recv_data >> name; // name recvData >> name; // name
recv_data.read_skip<std::string>(); // some string recvData.read_skip<std::string>(); // some string
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
recv_data.read_skip<uint16>(); // 0 recvData.read_skip<uint16>(); // 0
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
for (int i = 0; i < 10; ++i) for (int i = 0; i < 10; ++i)
recv_data.read_skip<std::string>(); recvData.read_skip<std::string>();
recv_data >> clientIndex; // index recvData >> clientIndex; // index
recv_data.read_skip<uint32>(); // 0 recvData.read_skip<uint32>(); // 0
sLog->outDebug(LOG_FILTER_NETWORKIO, "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str()); sLog->outDebug(LOG_FILTER_NETWORKIO, "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str());
@@ -157,12 +151,13 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
{ {
if (sGuildMgr->GetGuildByName(name)) if (sGuildMgr->GetGuildByName(name))
{ {
Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, name); Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_NAME_EXISTS_S, name);
return; return;
} }
if (sObjectMgr->IsReservedName(name) || !ObjectMgr::IsValidCharterName(name)) if (sObjectMgr->IsReservedName(name) || !ObjectMgr::IsValidCharterName(name))
{ {
Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_INVALID, name); Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_NAME_INVALID, name);
return; return;
} }
} }
@@ -250,13 +245,13 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
CharacterDatabase.CommitTransaction(trans); CharacterDatabase.CommitTransaction(trans);
} }
void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SHOW_SIGNATURES"); sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SHOW_SIGNATURES");
uint8 signs = 0; uint8 signs = 0;
uint64 petitionguid; uint64 petitionguid;
recv_data >> petitionguid; // petition guid recvData >> petitionguid; // petition guid
// solve (possible) some strange compile problems with explicit use GUID_LOPART(petitionguid) at some GCC versions (wrong code optimization in compiler?) // solve (possible) some strange compile problems with explicit use GUID_LOPART(petitionguid) at some GCC versions (wrong code optimization in compiler?)
uint32 petitionGuidLow = GUID_LOPART(petitionguid); uint32 petitionGuidLow = GUID_LOPART(petitionguid);
@@ -310,14 +305,14 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_QUERY"); // ok sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_QUERY"); // ok
uint32 guildguid; uint32 guildguid;
uint64 petitionguid; uint64 petitionguid;
recv_data >> guildguid; // in Trinity always same as GUID_LOPART(petitionguid) recvData >> guildguid; // in Trinity always same as GUID_LOPART(petitionguid)
recv_data >> petitionguid; // petition guid recvData >> petitionguid; // petition guid
sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid);
SendPetitionQueryOpcode(petitionguid); SendPetitionQueryOpcode(petitionguid);
@@ -355,8 +350,9 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid)
data << uint8(0); // some string data << uint8(0); // some string
if (type == GUILD_CHARTER_TYPE) if (type == GUILD_CHARTER_TYPE)
{ {
data << uint32(9); uint32 needed = sWorld->getIntConfig(CONFIG_MIN_PETITION_SIGNS);
data << uint32(9); data << uint32(needed);
data << uint32(needed);
data << uint32(0); // bypass client - side limitation, a different value is needed here for each petition data << uint32(0); // bypass client - side limitation, a different value is needed here for each petition
} }
else else
@@ -379,15 +375,12 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid)
data << uint32(0); // 14 data << uint32(0); // 14
if (type == GUILD_CHARTER_TYPE) data << uint32(type != GUILD_CHARTER_TYPE); // 15 0 - guild, 1 - arena team
data << uint32(0); // 15 0 - guild, 1 - arena team
else
data << uint32(1);
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_RENAME"); // ok sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_RENAME"); // ok
@@ -395,8 +388,8 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
uint32 type; uint32 type;
std::string newName; std::string newName;
recv_data >> petitionGuid; // guid recvData >> petitionGuid; // guid
recv_data >> newName; // new name recvData >> newName; // new name
Item* item = _player->GetItemByGuid(petitionGuid); Item* item = _player->GetItemByGuid(petitionGuid);
if (!item) if (!item)
@@ -423,12 +416,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
{ {
if (sGuildMgr->GetGuildByName(newName)) if (sGuildMgr->GetGuildByName(newName))
{ {
Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, newName); Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_NAME_EXISTS_S, newName);
return; return;
} }
if (sObjectMgr->IsReservedName(newName) || !ObjectMgr::IsValidCharterName(newName)) if (sObjectMgr->IsReservedName(newName) || !ObjectMgr::IsValidCharterName(newName))
{ {
Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_INVALID, newName); Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_NAME_INVALID, newName);
return; return;
} }
} }
@@ -460,15 +453,15 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SIGN"); // ok sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SIGN"); // ok
Field* fields; Field* fields;
uint64 petitionGuid; uint64 petitionGuid;
uint8 unk; uint8 unk;
recv_data >> petitionGuid; // petition guid recvData >> petitionGuid; // petition guid
recv_data >> unk; recvData >> unk;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURES); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURES);
@@ -498,7 +491,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
if (type != GUILD_CHARTER_TYPE) if (type != GUILD_CHARTER_TYPE)
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
else else
Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NOT_ALLIED); Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_NOT_ALLIED);
return; return;
} }
@@ -530,12 +523,12 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
{ {
if (_player->GetGuildId()) if (_player->GetGuildId())
{ {
Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_IN_GUILD_S, _player->GetName().c_str()); Guild::SendCommandResult(this, GUILD_COMMAND_INVITE, ERR_ALREADY_IN_GUILD_S, _player->GetName());
return; return;
} }
if (_player->GetGuildIdInvited()) if (_player->GetGuildIdInvited())
{ {
Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName().c_str()); Guild::SendCommandResult(this, GUILD_COMMAND_INVITE, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName());
return; return;
} }
} }
@@ -597,13 +590,13 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
owner->GetSession()->SendPacket(&data); owner->GetSession()->SendPacket(&data);
} }
void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_DECLINE"); // ok sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_DECLINE"); // ok
uint64 petitionguid; uint64 petitionguid;
uint64 ownerguid; uint64 ownerguid;
recv_data >> petitionguid; // petition guid recvData >> petitionguid; // petition guid
sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow());
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID);
@@ -627,7 +620,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_OFFER_PETITION"); // ok sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_OFFER_PETITION"); // ok
@@ -635,9 +628,9 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
uint64 petitionguid, plguid; uint64 petitionguid, plguid;
uint32 type, junk; uint32 type, junk;
Player* player; Player* player;
recv_data >> junk; // this is not petition type! recvData >> junk; // this is not petition type!
recv_data >> petitionguid; // petition guid recvData >> petitionguid; // petition guid
recv_data >> plguid; // player guid recvData >> plguid; // player guid
player = ObjectAccessor::FindPlayer(plguid); player = ObjectAccessor::FindPlayer(plguid);
if (!player) if (!player)
@@ -662,7 +655,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
if (type != GUILD_CHARTER_TYPE) if (type != GUILD_CHARTER_TYPE)
SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED);
else else
Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NOT_ALLIED); Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_NOT_ALLIED);
return; return;
} }
@@ -696,13 +689,13 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
{ {
if (player->GetGuildId()) if (player->GetGuildId())
{ {
Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_IN_GUILD_S, _player->GetName().c_str()); Guild::SendCommandResult(this, GUILD_COMMAND_INVITE, ERR_ALREADY_IN_GUILD_S, _player->GetName());
return; return;
} }
if (player->GetGuildIdInvited()) if (player->GetGuildIdInvited())
{ {
Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName().c_str()); Guild::SendCommandResult(this, GUILD_COMMAND_INVITE, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName());
return; return;
} }
} }
@@ -736,7 +729,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
player->GetSession()->SendPacket(&data); player->GetSession()->SendPacket(&data);
} }
void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_TURN_IN_PETITION"); sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_TURN_IN_PETITION");
@@ -744,7 +737,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
WorldPacket data; WorldPacket data;
uint64 petitionGuid; uint64 petitionGuid;
recv_data >> petitionGuid; recvData >> petitionGuid;
// Check if player really has the required petition charter // Check if player really has the required petition charter
Item* item = _player->GetItemByGuid(petitionGuid); Item* item = _player->GetItemByGuid(petitionGuid);
@@ -794,7 +787,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
// Check if guild name is already taken // Check if guild name is already taken
if (sGuildMgr->GetGuildByName(name)) if (sGuildMgr->GetGuildByName(name))
{ {
Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, name); Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_NAME_EXISTS_S, name);
return; return;
} }
} }
@@ -866,6 +859,8 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
// Register guild and add guild master // Register guild and add guild master
sGuildMgr->AddGuild(guild); sGuildMgr->AddGuild(guild);
Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_COMMAND_SUCCESS, name);
// Add members from signatures // Add members from signatures
for (uint8 i = 0; i < signatures; ++i) for (uint8 i = 0; i < signatures; ++i)
{ {
@@ -878,7 +873,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
{ {
// Receive the rest of the packet in arena team creation case // Receive the rest of the packet in arena team creation case
uint32 background, icon, iconcolor, border, bordercolor; uint32 background, icon, iconcolor, border, bordercolor;
recv_data >> background >> icon >> iconcolor >> border >> bordercolor; recvData >> background >> icon >> iconcolor >> border >> bordercolor;
// Create arena team // Create arena team
ArenaTeam* arenaTeam = new ArenaTeam(); ArenaTeam* arenaTeam = new ArenaTeam();
@@ -924,12 +919,12 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "Received CMSG_PETITION_SHOWLIST"); sLog->outDebug(LOG_FILTER_NETWORKIO, "Received CMSG_PETITION_SHOWLIST");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
SendPetitionShowList(guid); SendPetitionShowList(guid);
} }
@@ -954,7 +949,7 @@ void WorldSession::SendPetitionShowList(uint64 guid)
data << uint32(CHARTER_DISPLAY_ID); // charter display id data << uint32(CHARTER_DISPLAY_ID); // charter display id
data << uint32(GUILD_CHARTER_COST); // charter cost data << uint32(GUILD_CHARTER_COST); // charter cost
data << uint32(0); // unknown data << uint32(0); // unknown
data << uint32(9); // required signs? data << uint32(sWorld->getIntConfig(CONFIG_MIN_PETITION_SIGNS)); // required signs
} }
else else
{ {
+22 -22
View File
@@ -64,10 +64,10 @@ void WorldSession::SendNameQueryOpcode(uint64 guid)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleNameQueryOpcode(WorldPacket& recv_data) void WorldSession::HandleNameQueryOpcode(WorldPacket& recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
// This is disable by default to prevent lots of console spam // This is disable by default to prevent lots of console spam
// sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleNameQueryOpcode %u", guid); // sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleNameQueryOpcode %u", guid);
@@ -75,7 +75,7 @@ void WorldSession::HandleNameQueryOpcode(WorldPacket& recv_data)
SendNameQueryOpcode(guid); SendNameQueryOpcode(guid);
} }
void WorldSession::HandleQueryTimeOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleQueryTimeOpcode(WorldPacket & /*recvData*/)
{ {
SendQueryTimeResponse(); SendQueryTimeResponse();
} }
@@ -89,12 +89,12 @@ void WorldSession::SendQueryTimeResponse()
} }
/// Only _static_ data is sent in this packet !!! /// Only _static_ data is sent in this packet !!!
void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recvData)
{ {
uint32 entry; uint32 entry;
recv_data >> entry; recvData >> entry;
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(entry); CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(entry);
if (ci) if (ci)
@@ -152,12 +152,12 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data)
} }
/// Only _static_ data is sent in this packet !!! /// Only _static_ data is sent in this packet !!!
void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recvData)
{ {
uint32 entry; uint32 entry;
recv_data >> entry; recvData >> entry;
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
const GameObjectTemplate* info = sObjectMgr->GetGameObjectTemplate(entry); const GameObjectTemplate* info = sObjectMgr->GetGameObjectTemplate(entry);
if (info) if (info)
@@ -207,7 +207,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_CORPSE_QUERY"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_CORPSE_QUERY");
@@ -258,15 +258,15 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
{ {
uint32 textID; uint32 textID;
uint64 guid; uint64 guid;
recv_data >> textID; recvData >> textID;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID);
recv_data >> guid; recvData >> guid;
GetPlayer()->SetSelection(guid); GetPlayer()->SetSelection(guid);
GossipText const* pGossip = sObjectMgr->GetGossipText(textID); GossipText const* pGossip = sObjectMgr->GetGossipText(textID);
@@ -342,13 +342,13 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data)
} }
/// Only _static_ data is sent in this packet !!! /// Only _static_ data is sent in this packet !!!
void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data) void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY");
uint32 pageID; uint32 pageID;
recv_data >> pageID; recvData >> pageID;
recv_data.read_skip<uint64>(); // guid recvData.read_skip<uint64>(); // guid
while (pageID) while (pageID)
{ {
@@ -382,12 +382,12 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recv_data) void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY");
uint32 unk; uint32 unk;
recv_data >> unk; recvData >> unk;
WorldPacket data(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, 4+4+4+4); WorldPacket data(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, 4+4+4+4);
data << float(0); data << float(0);
@@ -397,14 +397,14 @@ void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recv_data)
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) void WorldSession::HandleQuestPOIQuery(WorldPacket& recvData)
{ {
uint32 count; uint32 count;
recv_data >> count; // quest count, max=25 recvData >> count; // quest count, max=25
if (count >= MAX_QUEST_LOG_SIZE) if (count >= MAX_QUEST_LOG_SIZE)
{ {
recv_data.rfinish(); recvData.rfinish();
return; return;
} }
@@ -414,7 +414,7 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data)
for (uint32 i = 0; i < count; ++i) for (uint32 i = 0; i < count; ++i)
{ {
uint32 questId; uint32 questId;
recv_data >> questId; // quest id recvData >> questId; // quest id
bool questOk = false; bool questOk = false;
+24 -24
View File
@@ -33,10 +33,10 @@
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "GameObjectAI.h" #include "GameObjectAI.h"
void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
uint8 questStatus = DIALOG_STATUS_NONE; uint8 questStatus = DIALOG_STATUS_NONE;
uint8 defstatus = DIALOG_STATUS_NONE; uint8 defstatus = DIALOG_STATUS_NONE;
@@ -79,10 +79,10 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data)
_player->PlayerTalkClass->SendQuestGiverStatus(questStatus, guid); _player->PlayerTalkClass->SendQuestGiverStatus(questStatus, guid);
} }
void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid)); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid));
@@ -109,12 +109,12 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data)
creature->AI()->sGossipHello(_player); creature->AI()->sGossipHello(_player);
} }
void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
uint32 questId; uint32 questId;
uint32 unk1; uint32 unk1;
recv_data >> guid >> questId >> unk1; recvData >> guid >> questId >> unk1;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1);
@@ -230,12 +230,12 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
_player->PlayerTalkClass->SendCloseGossip(); _player->PlayerTalkClass->SendCloseGossip();
} }
void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
uint32 questId; uint32 questId;
uint8 unk1; uint8 unk1;
recv_data >> guid >> questId >> unk1; recvData >> guid >> questId >> unk1;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1);
// Verify that the guid is valid and is a questgiver or involved in the requested quest // Verify that the guid is valid and is a questgiver or involved in the requested quest
@@ -268,24 +268,24 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleQuestQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestQueryOpcode(WorldPacket & recvData)
{ {
if (!_player) if (!_player)
return; return;
uint32 questId; uint32 questId;
recv_data >> questId; recvData >> questId;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", questId); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", questId);
if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId))
_player->PlayerTalkClass->SendQuestQueryResponse(quest); _player->PlayerTalkClass->SendQuestQueryResponse(quest);
} }
void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recvData)
{ {
uint32 questId, reward; uint32 questId, reward;
uint64 guid; uint64 guid;
recv_data >> guid >> questId >> reward; recvData >> guid >> questId >> reward;
if (reward >= QUEST_REWARD_CHOICES_COUNT) if (reward >= QUEST_REWARD_CHOICES_COUNT)
{ {
@@ -365,11 +365,11 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data)
} }
} }
void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recvData)
{ {
uint32 questId; uint32 questId;
uint64 guid; uint64 guid;
recv_data >> guid >> questId; recvData >> guid >> questId;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId);
@@ -391,17 +391,17 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data)
_player->PlayerTalkClass->SendQuestGiverOfferReward(quest, guid, true); _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, guid, true);
} }
void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recv_data*/) void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CANCEL"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CANCEL");
_player->PlayerTalkClass->SendCloseGossip(); _player->PlayerTalkClass->SendCloseGossip();
} }
void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recv_data) void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recvData)
{ {
uint8 slot1, slot2; uint8 slot1, slot2;
recv_data >> slot1 >> slot2; recvData >> slot1 >> slot2;
if (slot1 == slot2 || slot1 >= MAX_QUEST_LOG_SIZE || slot2 >= MAX_QUEST_LOG_SIZE) if (slot1 == slot2 || slot1 >= MAX_QUEST_LOG_SIZE || slot2 >= MAX_QUEST_LOG_SIZE)
return; return;
@@ -411,10 +411,10 @@ void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recv_data)
GetPlayer()->SwapQuestSlot(slot1, slot2); GetPlayer()->SwapQuestSlot(slot1, slot2);
} }
void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
{ {
uint8 slot; uint8 slot;
recv_data >> slot; recvData >> slot;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u", slot); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u", slot);
@@ -444,10 +444,10 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data)
} }
} }
void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData)
{ {
uint32 questId; uint32 questId;
recv_data >> questId; recvData >> questId;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", questId); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", questId);
@@ -479,12 +479,12 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
} }
} }
void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData)
{ {
uint32 questId; uint32 questId;
uint64 guid; uint64 guid;
recv_data >> guid >> questId; recvData >> guid >> questId;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId);
@@ -760,7 +760,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
SendPacket(&data); SendPacket(&data);
} }
void WorldSession::HandleQueryQuestsCompleted(WorldPacket & /*recv_data*/) void WorldSession::HandleQueryQuestsCompleted(WorldPacket & /*recvData*/)
{ {
size_t rew_count = _player->GetRewardedQuestCount(); size_t rew_count = _player->GetRewardedQuestCount();
@@ -21,12 +21,12 @@
#include "Opcodes.h" #include "Opcodes.h"
#include "Log.h" #include "Log.h"
void WorldSession::HandleGrantLevel(WorldPacket& recv_data) void WorldSession::HandleGrantLevel(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GRANT_LEVEL"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GRANT_LEVEL");
uint64 guid; uint64 guid;
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
Player* target = ObjectAccessor::GetObjectInWorld(guid, _player); Player* target = ObjectAccessor::GetObjectInWorld(guid, _player);
@@ -63,12 +63,12 @@ void WorldSession::HandleGrantLevel(WorldPacket& recv_data)
target->GetSession()->SendPacket(&data2); target->GetSession()->SendPacket(&data2);
} }
void WorldSession::HandleAcceptGrantLevel(WorldPacket& recv_data) void WorldSession::HandleAcceptGrantLevel(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ACCEPT_LEVEL_GRANT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ACCEPT_LEVEL_GRANT");
uint64 guid; uint64 guid;
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
Player* other = ObjectAccessor::GetObjectInWorld(guid, _player); Player* other = ObjectAccessor::GetObjectInWorld(guid, _player);
if (!(other && other->GetSession())) if (!(other && other->GetSession()))
+4 -4
View File
@@ -26,10 +26,10 @@
#include "ObjectAccessor.h" #include "ObjectAccessor.h"
#include "UpdateMask.h" #include "UpdateMask.h"
void WorldSession::HandleLearnTalentOpcode(WorldPacket & recv_data) void WorldSession::HandleLearnTalentOpcode(WorldPacket & recvData)
{ {
uint32 talent_id, requested_rank; uint32 talent_id, requested_rank;
recv_data >> talent_id >> requested_rank; recvData >> talent_id >> requested_rank;
_player->LearnTalent(talent_id, requested_rank); _player->LearnTalent(talent_id, requested_rank);
_player->SendTalentsInfoData(false); _player->SendTalentsInfoData(false);
@@ -54,11 +54,11 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
_player->SendTalentsInfoData(false); _player->SendTalentsInfoData(false);
} }
void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_TALENT_WIPE_CONFIRM"); sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_TALENT_WIPE_CONFIRM");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
if (!unit) if (!unit)
+9 -9
View File
@@ -269,11 +269,11 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
pUser->SendLoot(item->GetGUID(), LOOT_CORPSE); pUser->SendLoot(item->GetGUID(), LOOT_CORPSE);
} }
void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recv_data) void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid));
@@ -485,9 +485,9 @@ void WorldSession::HandleCancelAutoRepeatSpellOpcode(WorldPacket& /*recvPacket*/
_player->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); _player->InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
} }
void WorldSession::HandleCancelChanneling(WorldPacket & recv_data) void WorldSession::HandleCancelChanneling(WorldPacket & recvData)
{ {
recv_data.read_skip<uint32>(); // spellid, not used recvData.read_skip<uint32>(); // spellid, not used
// ignore for remote control state (for player case) // ignore for remote control state (for player case)
Unit* mover = _player->m_mover; Unit* mover = _player->m_mover;
@@ -520,7 +520,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket)
totem->ToTotem()->UnSummon(); totem->ToTotem()->UnSummon();
} }
void WorldSession::HandleSelfResOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleSelfResOpcode(WorldPacket & /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SELF_RES"); // empty opcode sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SELF_RES"); // empty opcode
@@ -537,10 +537,10 @@ void WorldSession::HandleSelfResOpcode(WorldPacket & /*recv_data*/)
} }
} }
void WorldSession::HandleSpellClick(WorldPacket& recv_data) void WorldSession::HandleSpellClick(WorldPacket& recvData)
{ {
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
// this will get something not in world. crash // this will get something not in world. crash
Creature* unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); Creature* unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
@@ -555,11 +555,11 @@ void WorldSession::HandleSpellClick(WorldPacket& recv_data)
unit->HandleSpellClick(_player); unit->HandleSpellClick(_player);
} }
void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recv_data) void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GET_MIRRORIMAGE_DATA"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GET_MIRRORIMAGE_DATA");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
// Get unit for which data is needed by client // Get unit for which data is needed by client
Unit* unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)NULL); Unit* unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)NULL);
+13 -13
View File
@@ -28,13 +28,13 @@
#include "Path.h" #include "Path.h"
#include "WaypointMovementGenerator.h" #include "WaypointMovementGenerator.h"
void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXINODE_STATUS_QUERY"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXINODE_STATUS_QUERY");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
SendTaxiStatus(guid); SendTaxiStatus(guid);
} }
@@ -63,12 +63,12 @@ void WorldSession::SendTaxiStatus(uint64 guid)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_TAXINODE_STATUS"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_TAXINODE_STATUS");
} }
void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES");
uint64 guid; uint64 guid;
recv_data >> guid; recvData >> guid;
// cheating checks // cheating checks
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
@@ -163,14 +163,14 @@ void WorldSession::SendDiscoverNewTaxiNode(uint32 nodeid)
} }
} }
void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS");
uint64 guid; uint64 guid;
uint32 node_count; uint32 node_count;
recv_data >> guid >> node_count; recvData >> guid >> node_count;
Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
if (!npc) if (!npc)
@@ -183,7 +183,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data)
for (uint32 i = 0; i < node_count; ++i) for (uint32 i = 0; i < node_count; ++i)
{ {
uint32 node; uint32 node;
recv_data >> node; recvData >> node;
nodes.push_back(node); nodes.push_back(node);
} }
@@ -195,17 +195,17 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data)
GetPlayer()->ActivateTaxiPathTo(nodes, npc); GetPlayer()->ActivateTaxiPathTo(nodes, npc);
} }
void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_SPLINE_DONE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_SPLINE_DONE");
uint64 guid; // used only for proper packet read uint64 guid; // used only for proper packet read
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
MovementInfo movementInfo; // used only for proper packet read MovementInfo movementInfo; // used only for proper packet read
ReadMovementInfo(recv_data, &movementInfo); ReadMovementInfo(recvData, &movementInfo);
recv_data.read_skip<uint32>(); // unk recvData.read_skip<uint32>(); // unk
// in taxi flight packet received in 2 case: // in taxi flight packet received in 2 case:
// 1) end taxi path in far (multi-node) flight // 1) end taxi path in far (multi-node) flight
@@ -273,7 +273,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data)
GetPlayer()->CastSpell(GetPlayer(), 2479, true); GetPlayer()->CastSpell(GetPlayer(), 2479, true);
} }
void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recv_data) void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI");
@@ -281,7 +281,7 @@ void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recv_data)
std::vector<uint32> nodes; std::vector<uint32> nodes;
nodes.resize(2); nodes.resize(2);
recv_data >> guid >> nodes[0] >> nodes[1]; recvData >> guid >> nodes[0] >> nodes[1];
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI from %d to %d", nodes[0], nodes[1]); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI from %d to %d", nodes[0], nodes[1]);
Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
if (!npc) if (!npc)
+16 -16
View File
@@ -23,7 +23,7 @@
#include "Log.h" #include "Log.h"
#include "ObjectAccessor.h" #include "ObjectAccessor.h"
void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE");
@@ -31,44 +31,44 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data)
if (!vehicleGUID) // something wrong here... if (!vehicleGUID) // something wrong here...
{ {
recv_data.rfinish(); // prevent warnings spam recvData.rfinish(); // prevent warnings spam
return; return;
} }
uint64 guid; uint64 guid;
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
MovementInfo mi; MovementInfo mi;
mi.guid = guid; mi.guid = guid;
ReadMovementInfo(recv_data, &mi); ReadMovementInfo(recvData, &mi);
_player->m_movementInfo = mi; _player->m_movementInfo = mi;
_player->ExitVehicle(); _player->ExitVehicle();
} }
void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE");
Unit* vehicle_base = GetPlayer()->GetVehicleBase(); Unit* vehicle_base = GetPlayer()->GetVehicleBase();
if (!vehicle_base) if (!vehicle_base)
{ {
recv_data.rfinish(); // prevent warnings spam recvData.rfinish(); // prevent warnings spam
return; return;
} }
VehicleSeatEntry const* seat = GetPlayer()->GetVehicle()->GetSeatForPassenger(GetPlayer()); VehicleSeatEntry const* seat = GetPlayer()->GetVehicle()->GetSeatForPassenger(GetPlayer());
if (!seat->CanSwitchFromSeat()) if (!seat->CanSwitchFromSeat())
{ {
recv_data.rfinish(); // prevent warnings spam recvData.rfinish(); // prevent warnings spam
sLog->outError(LOG_FILTER_NETWORKIO, "HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.", sLog->outError(LOG_FILTER_NETWORKIO, "HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.",
recv_data.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags); recvData.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags);
return; return;
} }
switch (recv_data.GetOpcode()) switch (recvData.GetOpcode())
{ {
case CMSG_REQUEST_VEHICLE_PREV_SEAT: case CMSG_REQUEST_VEHICLE_PREV_SEAT:
GetPlayer()->ChangeSeat(-1, false); GetPlayer()->ChangeSeat(-1, false);
@@ -79,17 +79,17 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
case CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE: case CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE:
{ {
uint64 guid; // current vehicle guid uint64 guid; // current vehicle guid
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
MovementInfo movementInfo; MovementInfo movementInfo;
ReadMovementInfo(recv_data, &movementInfo); ReadMovementInfo(recvData, &movementInfo);
vehicle_base->m_movementInfo = movementInfo; vehicle_base->m_movementInfo = movementInfo;
uint64 accessory; // accessory guid uint64 accessory; // accessory guid
recv_data.readPackGUID(accessory); recvData.readPackGUID(accessory);
int8 seatId; int8 seatId;
recv_data >> seatId; recvData >> seatId;
if (vehicle_base->GetGUID() != guid) if (vehicle_base->GetGUID() != guid)
return; return;
@@ -107,10 +107,10 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
case CMSG_REQUEST_VEHICLE_SWITCH_SEAT: case CMSG_REQUEST_VEHICLE_SWITCH_SEAT:
{ {
uint64 guid; // current vehicle guid uint64 guid; // current vehicle guid
recv_data.readPackGUID(guid); recvData.readPackGUID(guid);
int8 seatId; int8 seatId;
recv_data >> seatId; recvData >> seatId;
if (vehicle_base->GetGUID() == guid) if (vehicle_base->GetGUID() == guid)
GetPlayer()->ChangeSeat(seatId); GetPlayer()->ChangeSeat(seatId);
@@ -209,7 +209,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
sLog->outError(LOG_FILTER_NETWORKIO, "HandleEjectPassenger: Player %u tried to eject invalid GUID "UI64FMTD, GetPlayer()->GetGUIDLow(), guid); sLog->outError(LOG_FILTER_NETWORKIO, "HandleEjectPassenger: Player %u tried to eject invalid GUID "UI64FMTD, GetPlayer()->GetGUIDLow(), guid);
} }
void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recv_data*/) void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT");
@@ -22,24 +22,24 @@
#include "Opcodes.h" #include "Opcodes.h"
#include "Log.h" #include "Log.h"
void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recv_data) void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_VOICE_SESSION_ENABLE"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_VOICE_SESSION_ENABLE");
// uint8 isVoiceEnabled, uint8 isMicrophoneEnabled // uint8 isVoiceEnabled, uint8 isMicrophoneEnabled
recv_data.read_skip<uint8>(); recvData.read_skip<uint8>();
recv_data.read_skip<uint8>(); recvData.read_skip<uint8>();
} }
void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket& /*recvData*/)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CHANNEL_VOICE_ON"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CHANNEL_VOICE_ON");
// Enable Voice button in channel context menu // Enable Voice button in channel context menu
} }
void WorldSession::HandleSetActiveVoiceChannel(WorldPacket& recv_data) void WorldSession::HandleSetActiveVoiceChannel(WorldPacket& recvData)
{ {
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL"); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL");
recv_data.read_skip<uint32>(); recvData.read_skip<uint32>();
recv_data.read_skip<char*>(); recvData.read_skip<char*>();
} }
+164 -164
View File
@@ -418,7 +418,7 @@ class WorldSession
void HandlePlayerLoginOpcode(WorldPacket& recvPacket); void HandlePlayerLoginOpcode(WorldPacket& recvPacket);
void HandleCharEnum(PreparedQueryResult result); void HandleCharEnum(PreparedQueryResult result);
void HandlePlayerLogin(LoginQueryHolder * holder); void HandlePlayerLogin(LoginQueryHolder * holder);
void HandleCharFactionOrRaceChange(WorldPacket& recv_data); void HandleCharFactionOrRaceChange(WorldPacket& recvData);
// played time // played time
void HandlePlayedTime(WorldPacket& recvPacket); void HandlePlayedTime(WorldPacket& recvPacket);
@@ -435,15 +435,15 @@ class WorldSession
void HandleInspectHonorStatsOpcode(WorldPacket& recvPacket); void HandleInspectHonorStatsOpcode(WorldPacket& recvPacket);
void HandleMoveWaterWalkAck(WorldPacket& recvPacket); void HandleMoveWaterWalkAck(WorldPacket& recvPacket);
void HandleFeatherFallAck(WorldPacket& recv_data); void HandleFeatherFallAck(WorldPacket& recvData);
void HandleMoveHoverAck(WorldPacket& recv_data); void HandleMoveHoverAck(WorldPacket& recvData);
void HandleMountSpecialAnimOpcode(WorldPacket& recvdata); void HandleMountSpecialAnimOpcode(WorldPacket& recvdata);
// character view // character view
void HandleShowingHelmOpcode(WorldPacket& recv_data); void HandleShowingHelmOpcode(WorldPacket& recvData);
void HandleShowingCloakOpcode(WorldPacket& recv_data); void HandleShowingCloakOpcode(WorldPacket& recvData);
// repair // repair
void HandleRepairItemOpcode(WorldPacket& recvPacket); void HandleRepairItemOpcode(WorldPacket& recvPacket);
@@ -452,7 +452,7 @@ class WorldSession
void HandleMoveKnockBackAck(WorldPacket& recvPacket); void HandleMoveKnockBackAck(WorldPacket& recvPacket);
void HandleMoveTeleportAck(WorldPacket& recvPacket); void HandleMoveTeleportAck(WorldPacket& recvPacket);
void HandleForceSpeedChangeAck(WorldPacket& recv_data); void HandleForceSpeedChangeAck(WorldPacket& recvData);
void HandlePingOpcode(WorldPacket& recvPacket); void HandlePingOpcode(WorldPacket& recvPacket);
void HandleAuthSessionOpcode(WorldPacket& recvPacket); void HandleAuthSessionOpcode(WorldPacket& recvPacket);
@@ -497,10 +497,10 @@ class WorldSession
void HandleAreaTriggerOpcode(WorldPacket& recvPacket); void HandleAreaTriggerOpcode(WorldPacket& recvPacket);
void HandleSetFactionAtWar(WorldPacket& recv_data); void HandleSetFactionAtWar(WorldPacket& recvData);
void HandleSetFactionCheat(WorldPacket& recv_data); void HandleSetFactionCheat(WorldPacket& recvData);
void HandleSetWatchedFactionOpcode(WorldPacket& recv_data); void HandleSetWatchedFactionOpcode(WorldPacket& recvData);
void HandleSetFactionInactiveOpcode(WorldPacket& recv_data); void HandleSetFactionInactiveOpcode(WorldPacket& recvData);
void HandleUpdateAccountData(WorldPacket& recvPacket); void HandleUpdateAccountData(WorldPacket& recvPacket);
void HandleRequestAccountData(WorldPacket& recvPacket); void HandleRequestAccountData(WorldPacket& recvPacket);
@@ -522,17 +522,17 @@ class WorldSession
void HandleMoveWorldportAckOpcode(); // for server-side calls void HandleMoveWorldportAckOpcode(); // for server-side calls
void HandleMovementOpcodes(WorldPacket& recvPacket); void HandleMovementOpcodes(WorldPacket& recvPacket);
void HandleSetActiveMoverOpcode(WorldPacket& recv_data); void HandleSetActiveMoverOpcode(WorldPacket& recvData);
void HandleMoveNotActiveMover(WorldPacket& recv_data); void HandleMoveNotActiveMover(WorldPacket& recvData);
void HandleDismissControlledVehicle(WorldPacket& recv_data); void HandleDismissControlledVehicle(WorldPacket& recvData);
void HandleRequestVehicleExit(WorldPacket& recv_data); void HandleRequestVehicleExit(WorldPacket& recvData);
void HandleChangeSeatsOnControlledVehicle(WorldPacket& recv_data); void HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData);
void HandleMoveTimeSkippedOpcode(WorldPacket& recv_data); void HandleMoveTimeSkippedOpcode(WorldPacket& recvData);
void HandleRequestRaidInfoOpcode(WorldPacket& recv_data); void HandleRequestRaidInfoOpcode(WorldPacket& recvData);
void HandleBattlefieldStatusOpcode(WorldPacket& recv_data); void HandleBattlefieldStatusOpcode(WorldPacket& recvData);
void HandleBattleMasterHelloOpcode(WorldPacket& recv_data); void HandleBattleMasterHelloOpcode(WorldPacket& recvData);
void HandleGroupInviteOpcode(WorldPacket& recvPacket); void HandleGroupInviteOpcode(WorldPacket& recvPacket);
//void HandleGroupCancelOpcode(WorldPacket& recvPacket); //void HandleGroupCancelOpcode(WorldPacket& recvPacket);
@@ -542,26 +542,26 @@ class WorldSession
void HandleGroupUninviteGuidOpcode(WorldPacket& recvPacket); void HandleGroupUninviteGuidOpcode(WorldPacket& recvPacket);
void HandleGroupSetLeaderOpcode(WorldPacket& recvPacket); void HandleGroupSetLeaderOpcode(WorldPacket& recvPacket);
void HandleGroupDisbandOpcode(WorldPacket& recvPacket); void HandleGroupDisbandOpcode(WorldPacket& recvPacket);
void HandleOptOutOfLootOpcode(WorldPacket& recv_data); void HandleOptOutOfLootOpcode(WorldPacket& recvData);
void HandleLootMethodOpcode(WorldPacket& recvPacket); void HandleLootMethodOpcode(WorldPacket& recvPacket);
void HandleLootRoll(WorldPacket& recv_data); void HandleLootRoll(WorldPacket& recvData);
void HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data); void HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData);
void HandleRaidTargetUpdateOpcode(WorldPacket& recv_data); void HandleRaidTargetUpdateOpcode(WorldPacket& recvData);
void HandleRaidReadyCheckOpcode(WorldPacket& recv_data); void HandleRaidReadyCheckOpcode(WorldPacket& recvData);
void HandleRaidReadyCheckFinishedOpcode(WorldPacket& recv_data); void HandleRaidReadyCheckFinishedOpcode(WorldPacket& recvData);
void HandleGroupRaidConvertOpcode(WorldPacket& recv_data); void HandleGroupRaidConvertOpcode(WorldPacket& recvData);
void HandleGroupChangeSubGroupOpcode(WorldPacket& recv_data); void HandleGroupChangeSubGroupOpcode(WorldPacket& recvData);
void HandleGroupAssistantLeaderOpcode(WorldPacket& recv_data); void HandleGroupAssistantLeaderOpcode(WorldPacket& recvData);
void HandlePartyAssignmentOpcode(WorldPacket& recv_data); void HandlePartyAssignmentOpcode(WorldPacket& recvData);
void HandlePetitionBuyOpcode(WorldPacket& recv_data); void HandlePetitionBuyOpcode(WorldPacket& recvData);
void HandlePetitionShowSignOpcode(WorldPacket& recv_data); void HandlePetitionShowSignOpcode(WorldPacket& recvData);
void HandlePetitionQueryOpcode(WorldPacket& recv_data); void HandlePetitionQueryOpcode(WorldPacket& recvData);
void HandlePetitionRenameOpcode(WorldPacket& recv_data); void HandlePetitionRenameOpcode(WorldPacket& recvData);
void HandlePetitionSignOpcode(WorldPacket& recv_data); void HandlePetitionSignOpcode(WorldPacket& recvData);
void HandlePetitionDeclineOpcode(WorldPacket& recv_data); void HandlePetitionDeclineOpcode(WorldPacket& recvData);
void HandleOfferPetitionOpcode(WorldPacket& recv_data); void HandleOfferPetitionOpcode(WorldPacket& recvData);
void HandleTurnInPetitionOpcode(WorldPacket& recv_data); void HandleTurnInPetitionOpcode(WorldPacket& recvData);
void HandleGuildQueryOpcode(WorldPacket& recvPacket); void HandleGuildQueryOpcode(WorldPacket& recvPacket);
void HandleGuildCreateOpcode(WorldPacket& recvPacket); void HandleGuildCreateOpcode(WorldPacket& recvPacket);
@@ -629,25 +629,25 @@ class WorldSession
void HandleUnacceptTradeOpcode(WorldPacket& recvPacket); void HandleUnacceptTradeOpcode(WorldPacket& recvPacket);
void HandleAuctionHelloOpcode(WorldPacket& recvPacket); void HandleAuctionHelloOpcode(WorldPacket& recvPacket);
void HandleAuctionListItems(WorldPacket& recv_data); void HandleAuctionListItems(WorldPacket& recvData);
void HandleAuctionListBidderItems(WorldPacket& recv_data); void HandleAuctionListBidderItems(WorldPacket& recvData);
void HandleAuctionSellItem(WorldPacket& recv_data); void HandleAuctionSellItem(WorldPacket& recvData);
void HandleAuctionRemoveItem(WorldPacket& recv_data); void HandleAuctionRemoveItem(WorldPacket& recvData);
void HandleAuctionListOwnerItems(WorldPacket& recv_data); void HandleAuctionListOwnerItems(WorldPacket& recvData);
void HandleAuctionPlaceBid(WorldPacket& recv_data); void HandleAuctionPlaceBid(WorldPacket& recvData);
void HandleAuctionListPendingSales(WorldPacket& recv_data); void HandleAuctionListPendingSales(WorldPacket& recvData);
void HandleGetMailList(WorldPacket& recv_data); void HandleGetMailList(WorldPacket& recvData);
void HandleSendMail(WorldPacket& recv_data); void HandleSendMail(WorldPacket& recvData);
void HandleMailTakeMoney(WorldPacket& recv_data); void HandleMailTakeMoney(WorldPacket& recvData);
void HandleMailTakeItem(WorldPacket& recv_data); void HandleMailTakeItem(WorldPacket& recvData);
void HandleMailMarkAsRead(WorldPacket& recv_data); void HandleMailMarkAsRead(WorldPacket& recvData);
void HandleMailReturnToSender(WorldPacket& recv_data); void HandleMailReturnToSender(WorldPacket& recvData);
void HandleMailDelete(WorldPacket& recv_data); void HandleMailDelete(WorldPacket& recvData);
void HandleItemTextQuery(WorldPacket& recv_data); void HandleItemTextQuery(WorldPacket& recvData);
void HandleMailCreateTextItem(WorldPacket& recv_data); void HandleMailCreateTextItem(WorldPacket& recvData);
void HandleQueryNextMailTime(WorldPacket& recv_data); void HandleQueryNextMailTime(WorldPacket& recvData);
void HandleCancelChanneling(WorldPacket& recv_data); void HandleCancelChanneling(WorldPacket& recvData);
void SendItemPageInfo(ItemTemplate* itemProto); void SendItemPageInfo(ItemTemplate* itemProto);
void HandleSplitItemOpcode(WorldPacket& recvPacket); void HandleSplitItemOpcode(WorldPacket& recvPacket);
@@ -693,11 +693,11 @@ class WorldSession
void HandleQuestgiverChooseRewardOpcode(WorldPacket& recvPacket); void HandleQuestgiverChooseRewardOpcode(WorldPacket& recvPacket);
void HandleQuestgiverRequestRewardOpcode(WorldPacket& recvPacket); void HandleQuestgiverRequestRewardOpcode(WorldPacket& recvPacket);
void HandleQuestQueryOpcode(WorldPacket& recvPacket); void HandleQuestQueryOpcode(WorldPacket& recvPacket);
void HandleQuestgiverCancel(WorldPacket& recv_data); void HandleQuestgiverCancel(WorldPacket& recvData);
void HandleQuestLogSwapQuest(WorldPacket& recv_data); void HandleQuestLogSwapQuest(WorldPacket& recvData);
void HandleQuestLogRemoveQuest(WorldPacket& recv_data); void HandleQuestLogRemoveQuest(WorldPacket& recvData);
void HandleQuestConfirmAccept(WorldPacket& recv_data); void HandleQuestConfirmAccept(WorldPacket& recvData);
void HandleQuestgiverCompleteQuest(WorldPacket& recv_data); void HandleQuestgiverCompleteQuest(WorldPacket& recvData);
void HandleQuestgiverQuestAutoLaunch(WorldPacket& recvPacket); void HandleQuestgiverQuestAutoLaunch(WorldPacket& recvPacket);
void HandlePushQuestToParty(WorldPacket& recvPacket); void HandlePushQuestToParty(WorldPacket& recvPacket);
void HandleQuestPushResult(WorldPacket& recvPacket); void HandleQuestPushResult(WorldPacket& recvPacket);
@@ -714,7 +714,7 @@ class WorldSession
void HandleCorpseQueryOpcode(WorldPacket& recvPacket); void HandleCorpseQueryOpcode(WorldPacket& recvPacket);
void HandleCorpseMapPositionQuery(WorldPacket& recvPacket); void HandleCorpseMapPositionQuery(WorldPacket& recvPacket);
void HandleResurrectResponseOpcode(WorldPacket& recvPacket); void HandleResurrectResponseOpcode(WorldPacket& recvPacket);
void HandleSummonResponseOpcode(WorldPacket& recv_data); void HandleSummonResponseOpcode(WorldPacket& recvData);
void HandleJoinChannel(WorldPacket& recvPacket); void HandleJoinChannel(WorldPacket& recvPacket);
void HandleLeaveChannel(WorldPacket& recvPacket); void HandleLeaveChannel(WorldPacket& recvPacket);
@@ -743,58 +743,58 @@ class WorldSession
void HandlePageQuerySkippedOpcode(WorldPacket& recvPacket); void HandlePageQuerySkippedOpcode(WorldPacket& recvPacket);
void HandlePageTextQueryOpcode(WorldPacket& recvPacket); void HandlePageTextQueryOpcode(WorldPacket& recvPacket);
void HandleTutorialFlag (WorldPacket& recv_data); void HandleTutorialFlag (WorldPacket& recvData);
void HandleTutorialClear(WorldPacket& recv_data); void HandleTutorialClear(WorldPacket& recvData);
void HandleTutorialReset(WorldPacket& recv_data); void HandleTutorialReset(WorldPacket& recvData);
//Pet //Pet
void HandlePetAction(WorldPacket& recv_data); void HandlePetAction(WorldPacket& recvData);
void HandlePetStopAttack(WorldPacket& recv_data); void HandlePetStopAttack(WorldPacket& recvData);
void HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2); void HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2);
void HandlePetNameQuery(WorldPacket& recv_data); void HandlePetNameQuery(WorldPacket& recvData);
void HandlePetSetAction(WorldPacket& recv_data); void HandlePetSetAction(WorldPacket& recvData);
void HandlePetAbandon(WorldPacket& recv_data); void HandlePetAbandon(WorldPacket& recvData);
void HandlePetRename(WorldPacket& recv_data); void HandlePetRename(WorldPacket& recvData);
void HandlePetCancelAuraOpcode(WorldPacket& recvPacket); void HandlePetCancelAuraOpcode(WorldPacket& recvPacket);
void HandlePetSpellAutocastOpcode(WorldPacket& recvPacket); void HandlePetSpellAutocastOpcode(WorldPacket& recvPacket);
void HandlePetCastSpellOpcode(WorldPacket& recvPacket); void HandlePetCastSpellOpcode(WorldPacket& recvPacket);
void HandlePetLearnTalent(WorldPacket& recvPacket); void HandlePetLearnTalent(WorldPacket& recvPacket);
void HandleLearnPreviewTalentsPet(WorldPacket& recvPacket); void HandleLearnPreviewTalentsPet(WorldPacket& recvPacket);
void HandleSetActionBarToggles(WorldPacket& recv_data); void HandleSetActionBarToggles(WorldPacket& recvData);
void HandleCharRenameOpcode(WorldPacket& recv_data); void HandleCharRenameOpcode(WorldPacket& recvData);
void HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult result, std::string const& newName); void HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult result, std::string const& newName);
void HandleSetPlayerDeclinedNames(WorldPacket& recv_data); void HandleSetPlayerDeclinedNames(WorldPacket& recvData);
void HandleTotemDestroyed(WorldPacket& recv_data); void HandleTotemDestroyed(WorldPacket& recvData);
void HandleDismissCritter(WorldPacket& recv_data); void HandleDismissCritter(WorldPacket& recvData);
//Battleground //Battleground
void HandleBattlemasterHelloOpcode(WorldPacket& recv_data); void HandleBattlemasterHelloOpcode(WorldPacket& recvData);
void HandleBattlemasterJoinOpcode(WorldPacket& recv_data); void HandleBattlemasterJoinOpcode(WorldPacket& recvData);
void HandleBattlegroundPlayerPositionsOpcode(WorldPacket& recv_data); void HandleBattlegroundPlayerPositionsOpcode(WorldPacket& recvData);
void HandlePVPLogDataOpcode(WorldPacket& recv_data); void HandlePVPLogDataOpcode(WorldPacket& recvData);
void HandleBattleFieldPortOpcode(WorldPacket& recv_data); void HandleBattleFieldPortOpcode(WorldPacket& recvData);
void HandleBattlefieldListOpcode(WorldPacket& recv_data); void HandleBattlefieldListOpcode(WorldPacket& recvData);
void HandleLeaveBattlefieldOpcode(WorldPacket& recv_data); void HandleLeaveBattlefieldOpcode(WorldPacket& recvData);
void HandleBattlemasterJoinArena(WorldPacket& recv_data); void HandleBattlemasterJoinArena(WorldPacket& recvData);
void HandleReportPvPAFK(WorldPacket& recv_data); void HandleReportPvPAFK(WorldPacket& recvData);
void HandleWardenDataOpcode(WorldPacket& recv_data); void HandleWardenDataOpcode(WorldPacket& recvData);
void HandleWorldTeleportOpcode(WorldPacket& recv_data); void HandleWorldTeleportOpcode(WorldPacket& recvData);
void HandleMinimapPingOpcode(WorldPacket& recv_data); void HandleMinimapPingOpcode(WorldPacket& recvData);
void HandleRandomRollOpcode(WorldPacket& recv_data); void HandleRandomRollOpcode(WorldPacket& recvData);
void HandleFarSightOpcode(WorldPacket& recv_data); void HandleFarSightOpcode(WorldPacket& recvData);
void HandleSetDungeonDifficultyOpcode(WorldPacket& recv_data); void HandleSetDungeonDifficultyOpcode(WorldPacket& recvData);
void HandleSetRaidDifficultyOpcode(WorldPacket& recv_data); void HandleSetRaidDifficultyOpcode(WorldPacket& recvData);
void HandleMoveSetCanFlyAckOpcode(WorldPacket& recv_data); void HandleMoveSetCanFlyAckOpcode(WorldPacket& recvData);
void HandleSetTitleOpcode(WorldPacket& recv_data); void HandleSetTitleOpcode(WorldPacket& recvData);
void HandleRealmSplitOpcode(WorldPacket& recv_data); void HandleRealmSplitOpcode(WorldPacket& recvData);
void HandleTimeSyncResp(WorldPacket& recv_data); void HandleTimeSyncResp(WorldPacket& recvData);
void HandleWhoisOpcode(WorldPacket& recv_data); void HandleWhoisOpcode(WorldPacket& recvData);
void HandleResetInstancesOpcode(WorldPacket& recv_data); void HandleResetInstancesOpcode(WorldPacket& recvData);
void HandleHearthAndResurrect(WorldPacket& recv_data); void HandleHearthAndResurrect(WorldPacket& recvData);
void HandleInstanceLockResponse(WorldPacket& recvPacket); void HandleInstanceLockResponse(WorldPacket& recvPacket);
// Battlefield // Battlefield
@@ -803,23 +803,23 @@ class WorldSession
void SendBfQueueInviteResponse(uint32 BattleId,uint32 ZoneId, bool CanQueue = true, bool Full = false); void SendBfQueueInviteResponse(uint32 BattleId,uint32 ZoneId, bool CanQueue = true, bool Full = false);
void SendBfEntered(uint32 BattleId); void SendBfEntered(uint32 BattleId);
void SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason = BF_LEAVE_REASON_EXITED); void SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason = BF_LEAVE_REASON_EXITED);
void HandleBfQueueInviteResponse(WorldPacket &recv_data); void HandleBfQueueInviteResponse(WorldPacket &recvData);
void HandleBfEntryInviteResponse(WorldPacket &recv_data); void HandleBfEntryInviteResponse(WorldPacket &recvData);
void HandleBfExitRequest(WorldPacket &recv_data); void HandleBfExitRequest(WorldPacket &recvData);
// Looking for Dungeon/Raid // Looking for Dungeon/Raid
void HandleLfgSetCommentOpcode(WorldPacket& recv_data); void HandleLfgSetCommentOpcode(WorldPacket& recvData);
void HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& recv_data); void HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& recvData);
void HandleLfgPartyLockInfoRequestOpcode(WorldPacket& recv_data); void HandleLfgPartyLockInfoRequestOpcode(WorldPacket& recvData);
void HandleLfgJoinOpcode(WorldPacket& recv_data); void HandleLfgJoinOpcode(WorldPacket& recvData);
void HandleLfgLeaveOpcode(WorldPacket& recv_data); void HandleLfgLeaveOpcode(WorldPacket& recvData);
void HandleLfgSetRolesOpcode(WorldPacket& recv_data); void HandleLfgSetRolesOpcode(WorldPacket& recvData);
void HandleLfgProposalResultOpcode(WorldPacket& recv_data); void HandleLfgProposalResultOpcode(WorldPacket& recvData);
void HandleLfgSetBootVoteOpcode(WorldPacket& recv_data); void HandleLfgSetBootVoteOpcode(WorldPacket& recvData);
void HandleLfgTeleportOpcode(WorldPacket& recv_data); void HandleLfgTeleportOpcode(WorldPacket& recvData);
void HandleLfrJoinOpcode(WorldPacket& recv_data); void HandleLfrJoinOpcode(WorldPacket& recvData);
void HandleLfrLeaveOpcode(WorldPacket& recv_data); void HandleLfrLeaveOpcode(WorldPacket& recvData);
void HandleLfgGetStatus(WorldPacket& recv_data); void HandleLfgGetStatus(WorldPacket& recvData);
void SendLfgUpdatePlayer(const LfgUpdateData& updateData); void SendLfgUpdatePlayer(const LfgUpdateData& updateData);
void SendLfgUpdateParty(const LfgUpdateData& updateData); void SendLfgUpdateParty(const LfgUpdateData& updateData);
@@ -836,55 +836,55 @@ class WorldSession
void SendLfgTeleportError(uint8 err); void SendLfgTeleportError(uint8 err);
// Arena Team // Arena Team
void HandleInspectArenaTeamsOpcode(WorldPacket& recv_data); void HandleInspectArenaTeamsOpcode(WorldPacket& recvData);
void HandleArenaTeamQueryOpcode(WorldPacket& recv_data); void HandleArenaTeamQueryOpcode(WorldPacket& recvData);
void HandleArenaTeamRosterOpcode(WorldPacket& recv_data); void HandleArenaTeamRosterOpcode(WorldPacket& recvData);
void HandleArenaTeamInviteOpcode(WorldPacket& recv_data); void HandleArenaTeamInviteOpcode(WorldPacket& recvData);
void HandleArenaTeamAcceptOpcode(WorldPacket& recv_data); void HandleArenaTeamAcceptOpcode(WorldPacket& recvData);
void HandleArenaTeamDeclineOpcode(WorldPacket& recv_data); void HandleArenaTeamDeclineOpcode(WorldPacket& recvData);
void HandleArenaTeamLeaveOpcode(WorldPacket& recv_data); void HandleArenaTeamLeaveOpcode(WorldPacket& recvData);
void HandleArenaTeamRemoveOpcode(WorldPacket& recv_data); void HandleArenaTeamRemoveOpcode(WorldPacket& recvData);
void HandleArenaTeamDisbandOpcode(WorldPacket& recv_data); void HandleArenaTeamDisbandOpcode(WorldPacket& recvData);
void HandleArenaTeamLeaderOpcode(WorldPacket& recv_data); void HandleArenaTeamLeaderOpcode(WorldPacket& recvData);
void HandleAreaSpiritHealerQueryOpcode(WorldPacket& recv_data); void HandleAreaSpiritHealerQueryOpcode(WorldPacket& recvData);
void HandleAreaSpiritHealerQueueOpcode(WorldPacket& recv_data); void HandleAreaSpiritHealerQueueOpcode(WorldPacket& recvData);
void HandleCancelMountAuraOpcode(WorldPacket& recv_data); void HandleCancelMountAuraOpcode(WorldPacket& recvData);
void HandleSelfResOpcode(WorldPacket& recv_data); void HandleSelfResOpcode(WorldPacket& recvData);
void HandleComplainOpcode(WorldPacket& recv_data); void HandleComplainOpcode(WorldPacket& recvData);
void HandleRequestPetInfoOpcode(WorldPacket& recv_data); void HandleRequestPetInfoOpcode(WorldPacket& recvData);
// Socket gem // Socket gem
void HandleSocketOpcode(WorldPacket& recv_data); void HandleSocketOpcode(WorldPacket& recvData);
void HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data); void HandleCancelTempEnchantmentOpcode(WorldPacket& recvData);
void HandleItemRefundInfoRequest(WorldPacket& recv_data); void HandleItemRefundInfoRequest(WorldPacket& recvData);
void HandleItemRefund(WorldPacket& recv_data); void HandleItemRefund(WorldPacket& recvData);
void HandleChannelVoiceOnOpcode(WorldPacket& recv_data); void HandleChannelVoiceOnOpcode(WorldPacket& recvData);
void HandleVoiceSessionEnableOpcode(WorldPacket& recv_data); void HandleVoiceSessionEnableOpcode(WorldPacket& recvData);
void HandleSetActiveVoiceChannel(WorldPacket& recv_data); void HandleSetActiveVoiceChannel(WorldPacket& recvData);
void HandleSetTaxiBenchmarkOpcode(WorldPacket& recv_data); void HandleSetTaxiBenchmarkOpcode(WorldPacket& recvData);
// Guild Bank // Guild Bank
void HandleGuildPermissions(WorldPacket& recv_data); void HandleGuildPermissions(WorldPacket& recvData);
void HandleGuildBankMoneyWithdrawn(WorldPacket& recv_data); void HandleGuildBankMoneyWithdrawn(WorldPacket& recvData);
void HandleGuildBankerActivate(WorldPacket& recv_data); void HandleGuildBankerActivate(WorldPacket& recvData);
void HandleGuildBankQueryTab(WorldPacket& recv_data); void HandleGuildBankQueryTab(WorldPacket& recvData);
void HandleGuildBankLogQuery(WorldPacket& recv_data); void HandleGuildBankLogQuery(WorldPacket& recvData);
void HandleGuildBankDepositMoney(WorldPacket& recv_data); void HandleGuildBankDepositMoney(WorldPacket& recvData);
void HandleGuildBankWithdrawMoney(WorldPacket& recv_data); void HandleGuildBankWithdrawMoney(WorldPacket& recvData);
void HandleGuildBankSwapItems(WorldPacket& recv_data); void HandleGuildBankSwapItems(WorldPacket& recvData);
void HandleGuildBankUpdateTab(WorldPacket& recv_data); void HandleGuildBankUpdateTab(WorldPacket& recvData);
void HandleGuildBankBuyTab(WorldPacket& recv_data); void HandleGuildBankBuyTab(WorldPacket& recvData);
void HandleQueryGuildBankTabText(WorldPacket& recv_data); void HandleQueryGuildBankTabText(WorldPacket& recvData);
void HandleSetGuildBankTabText(WorldPacket& recv_data); void HandleSetGuildBankTabText(WorldPacket& recvData);
// Refer-a-Friend // Refer-a-Friend
void HandleGrantLevel(WorldPacket& recv_data); void HandleGrantLevel(WorldPacket& recvData);
void HandleAcceptGrantLevel(WorldPacket& recv_data); void HandleAcceptGrantLevel(WorldPacket& recvData);
// Calendar // Calendar
void HandleCalendarGetCalendar(WorldPacket& recvData); void HandleCalendarGetCalendar(WorldPacket& recvData);
@@ -918,19 +918,19 @@ class WorldSession
void SendCalendarRaidLockoutUpdated(InstanceSave const* save); void SendCalendarRaidLockoutUpdated(InstanceSave const* save);
void SendCalendarCommandResult(CalendarError err, char const* param = NULL); void SendCalendarCommandResult(CalendarError err, char const* param = NULL);
void HandleSpellClick(WorldPacket& recv_data); void HandleSpellClick(WorldPacket& recvData);
void HandleMirrorImageDataRequest(WorldPacket& recv_data); void HandleMirrorImageDataRequest(WorldPacket& recvData);
void HandleAlterAppearance(WorldPacket& recv_data); void HandleAlterAppearance(WorldPacket& recvData);
void HandleRemoveGlyph(WorldPacket& recv_data); void HandleRemoveGlyph(WorldPacket& recvData);
void HandleCharCustomize(WorldPacket& recv_data); void HandleCharCustomize(WorldPacket& recvData);
void HandleQueryInspectAchievements(WorldPacket& recv_data); void HandleQueryInspectAchievements(WorldPacket& recvData);
void HandleEquipmentSetSave(WorldPacket& recv_data); void HandleEquipmentSetSave(WorldPacket& recvData);
void HandleEquipmentSetDelete(WorldPacket& recv_data); void HandleEquipmentSetDelete(WorldPacket& recvData);
void HandleEquipmentSetUse(WorldPacket& recv_data); void HandleEquipmentSetUse(WorldPacket& recvData);
void HandleWorldStateUITimerUpdate(WorldPacket& recv_data); void HandleWorldStateUITimerUpdate(WorldPacket& recvData);
void HandleReadyForAccountDataTimes(WorldPacket& recv_data); void HandleReadyForAccountDataTimes(WorldPacket& recvData);
void HandleQueryQuestsCompleted(WorldPacket& recv_data); void HandleQueryQuestsCompleted(WorldPacket& recvData);
void HandleQuestPOIQuery(WorldPacket& recv_data); void HandleQuestPOIQuery(WorldPacket& recvData);
void HandleEjectPassenger(WorldPacket& data); void HandleEjectPassenger(WorldPacket& data);
void HandleEnterPlayerVehicle(WorldPacket& data); void HandleEnterPlayerVehicle(WorldPacket& data);
void HandleUpdateProjectilePosition(WorldPacket& recvPacket); void HandleUpdateProjectilePosition(WorldPacket& recvPacket);
+49
View File
@@ -980,6 +980,13 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = 6; m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = 6;
} }
m_int_configs[CONFIG_GUILD_RESET_HOUR] = ConfigMgr::GetIntDefault("Guild.ResetHour", 6);
if (m_int_configs[CONFIG_GUILD_RESET_HOUR] > 23)
{
sLog->outError(LOG_FILTER_GENERAL, "Guild.ResetHour (%i) can't be load. Set to 6.", m_int_configs[CONFIG_GUILD_RESET_HOUR]);
m_int_configs[CONFIG_GUILD_RESET_HOUR] = 6;
}
m_bool_configs[CONFIG_DETECT_POS_COLLISION] = ConfigMgr::GetBoolDefault("DetectPosCollision", true); m_bool_configs[CONFIG_DETECT_POS_COLLISION] = ConfigMgr::GetBoolDefault("DetectPosCollision", true);
m_bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = ConfigMgr::GetBoolDefault("Channel.RestrictedLfg", true); m_bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = ConfigMgr::GetBoolDefault("Channel.RestrictedLfg", true);
@@ -1771,6 +1778,9 @@ void World::SetInitialWorldSettings()
sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Calculate random battleground reset time..."); sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Calculate random battleground reset time...");
InitRandomBGResetTime(); InitRandomBGResetTime();
sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Calculate Guild cap reset time...");
InitGuildResetTime();
LoadCharacterNameData(); LoadCharacterNameData();
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin); uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
@@ -1926,6 +1936,9 @@ void World::Update(uint32 diff)
if (m_gameTime > m_NextRandomBGReset) if (m_gameTime > m_NextRandomBGReset)
ResetRandomBG(); ResetRandomBG();
if (m_gameTime > m_NextGuildReset)
ResetGuildCap();
/// <ul><li> Handle auctions when the timer has passed /// <ul><li> Handle auctions when the timer has passed
if (m_timers[WUPDATE_AUCTIONS].Passed()) if (m_timers[WUPDATE_AUCTIONS].Passed())
{ {
@@ -2736,6 +2749,33 @@ void World::InitRandomBGResetTime()
sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, uint64(m_NextRandomBGReset)); sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, uint64(m_NextRandomBGReset));
} }
void World::InitGuildResetTime()
{
time_t gtime = uint64(getWorldState(WS_GUILD_DAILY_RESET_TIME));
if (!gtime)
m_NextGuildReset = time_t(time(NULL)); // game time not yet init
// generate time by config
time_t curTime = time(NULL);
tm localTm = *localtime(&curTime);
localTm.tm_hour = getIntConfig(CONFIG_GUILD_RESET_HOUR);
localTm.tm_min = 0;
localTm.tm_sec = 0;
// current day reset time
time_t nextDayResetTime = mktime(&localTm);
// next reset time before current moment
if (curTime >= nextDayResetTime)
nextDayResetTime += DAY;
// normalize reset time
m_NextGuildReset = gtime < curTime ? nextDayResetTime - DAY : nextDayResetTime;
if (!gtime)
sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, uint64(m_NextGuildReset));
}
void World::ResetDailyQuests() void World::ResetDailyQuests()
{ {
sLog->outInfo(LOG_FILTER_GENERAL, "Daily quests reset for all characters."); sLog->outInfo(LOG_FILTER_GENERAL, "Daily quests reset for all characters.");
@@ -2812,6 +2852,15 @@ void World::ResetRandomBG()
sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, uint64(m_NextRandomBGReset)); sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, uint64(m_NextRandomBGReset));
} }
void World::ResetGuildCap()
{
sLog->outInfo(LOG_FILTER_GENERAL, "Guild Daily Cap reset.");
m_NextGuildReset = time_t(m_NextGuildReset + DAY);
sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, uint64(m_NextGuildReset));
sGuildMgr->ResetTimes();
}
void World::UpdateMaxSessionCounters() void World::UpdateMaxSessionCounters()
{ {
m_maxActiveSessionCount = std::max(m_maxActiveSessionCount, uint32(m_sessions.size()-m_QueuedPlayer.size())); m_maxActiveSessionCount = std::max(m_maxActiveSessionCount, uint32(m_sessions.size()-m_QueuedPlayer.size()));
+7 -2
View File
@@ -303,6 +303,7 @@ enum WorldIntConfigs
CONFIG_GUILD_BANK_EVENT_LOG_COUNT, CONFIG_GUILD_BANK_EVENT_LOG_COUNT,
CONFIG_MIN_LEVEL_STAT_SAVE, CONFIG_MIN_LEVEL_STAT_SAVE,
CONFIG_RANDOM_BG_RESET_HOUR, CONFIG_RANDOM_BG_RESET_HOUR,
CONFIG_GUILD_RESET_HOUR,
CONFIG_CHARDELETE_KEEP_DAYS, CONFIG_CHARDELETE_KEEP_DAYS,
CONFIG_CHARDELETE_METHOD, CONFIG_CHARDELETE_METHOD,
CONFIG_CHARDELETE_MIN_LEVEL, CONFIG_CHARDELETE_MIN_LEVEL,
@@ -468,8 +469,9 @@ enum RealmZone
enum WorldStates enum WorldStates
{ {
WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time
WS_BG_DAILY_RESET_TIME = 20003 // Next daily BG reset time WS_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time
WS_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time
}; };
// DB scripting commands // DB scripting commands
@@ -776,9 +778,11 @@ class World
void InitDailyQuestResetTime(); void InitDailyQuestResetTime();
void InitWeeklyQuestResetTime(); void InitWeeklyQuestResetTime();
void InitRandomBGResetTime(); void InitRandomBGResetTime();
void InitGuildResetTime();
void ResetDailyQuests(); void ResetDailyQuests();
void ResetWeeklyQuests(); void ResetWeeklyQuests();
void ResetRandomBG(); void ResetRandomBG();
void ResetGuildCap();
private: private:
static ACE_Atomic_Op<ACE_Thread_Mutex, bool> m_stopEvent; static ACE_Atomic_Op<ACE_Thread_Mutex, bool> m_stopEvent;
static uint8 m_ExitCode; static uint8 m_ExitCode;
@@ -839,6 +843,7 @@ class World
time_t m_NextDailyQuestReset; time_t m_NextDailyQuestReset;
time_t m_NextWeeklyQuestReset; time_t m_NextWeeklyQuestReset;
time_t m_NextRandomBGReset; time_t m_NextRandomBGReset;
time_t m_NextGuildReset;
//Player Queue //Player Queue
Queue m_QueuedPlayer; Queue m_QueuedPlayer;
@@ -169,10 +169,9 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_ITEM, "INSERT INTO guild_bank_item (guildid, TabId, SlotId, item_guid) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_ITEM, "INSERT INTO guild_bank_item (guildid, TabId, SlotId, item_guid) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint8 PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint8
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_ITEMS, "DELETE FROM guild_bank_item WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_ITEMS, "DELETE FROM guild_bank_item WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32
PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_RIGHT_DEFAULT, "INSERT INTO guild_bank_right (guildid, TabId, rid) VALUES (?, ?, ?)", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint8
// 0: uint32, 1: uint8, 2: uint8, 3: uint8, 4: uint32 // 0: uint32, 1: uint8, 2: uint8, 3: uint8, 4: uint32
PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_RIGHT, "INSERT INTO guild_bank_right (guildid, TabId, rid, gbright, SlotPerDay) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_RIGHT, "INSERT INTO guild_bank_right (guildid, TabId, rid, gbright, SlotPerDay) VALUES (?, ?, ?, ?, ?) "
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_RIGHT, "DELETE FROM guild_bank_right WHERE guildid = ? AND TabId = ? AND rid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint8 "ON DUPLICATE KEY UPDATE gbright = VALUES(gbright), SlotPerDay = VALUES(SlotPerDay)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_RIGHTS, "DELETE FROM guild_bank_right WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_RIGHTS, "DELETE FROM guild_bank_right WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32
PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK, "DELETE FROM guild_bank_right WHERE guildid = ? AND rid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8 PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK, "DELETE FROM guild_bank_right WHERE guildid = ? AND rid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8
// 0-1: uint32, 2-3: uint8, 4-5: uint32, 6: uint16, 7: uint8, 8: uint64 // 0-1: uint32, 2-3: uint8, 4-5: uint32, 6: uint16, 7: uint8, 8: uint64
@@ -198,32 +197,15 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_MONEY, "UPDATE guild SET BankMoney = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint64, 1: uint32 PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_MONEY, "UPDATE guild SET BankMoney = ? WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint64, 1: uint32
// 0: uint8, 1: uint32, 2: uint8, 3: uint32 // 0: uint8, 1: uint32, 2: uint8, 3: uint32
PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_EVENTLOG_TAB, "UPDATE guild_bank_eventlog SET TabId = ? WHERE guildid = ? AND TabId = ? AND LogGuid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_EVENTLOG_TAB, "UPDATE guild_bank_eventlog SET TabId = ? WHERE guildid = ? AND TabId = ? AND LogGuid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_MONEY, "UPDATE guild_member SET BankRemMoney = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32, 2: uint32
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_MONEY, "UPDATE guild_member SET BankResetTimeMoney = ?, BankRemMoney = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32, 2: uint32, 3: uint32
PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_RESET_TIME, "UPDATE guild_member SET BankResetTimeMoney = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8
PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_MONEY, "UPDATE guild_rank SET BankMoneyPerDay = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint32 PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_MONEY, "UPDATE guild_rank SET BankMoneyPerDay = ? WHERE rid = ? AND guildid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8, 2: uint32
PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_TAB_TEXT, "UPDATE guild_bank_tab SET TabText = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: string, 1: uint32, 2: uint8 PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_TAB_TEXT, "UPDATE guild_bank_tab SET TabText = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: string, 1: uint32, 2: uint8
PREPARE_STATEMENT(CHAR_INS_GUILD_MEMBER_WITHDRAW,
"INSERT INTO guild_member_withdraw (guid, tab0, tab1, tab2, tab3, tab4, tab5, money) VALUES (?, ?, ?, ?, ?, ?, ?, ?) "
"ON DUPLICATE KEY UPDATE tab0 = VALUES (tab0), tab1 = VALUES (tab1), tab2 = VALUES (tab2), tab3 = VALUES (tab3), tab4 = VALUES (tab4), tab5 = VALUES (tab5)", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_DEL_GUILD_MEMBER_WITHDRAW, "TRUNCATE guild_member_withdraw", CONNECTION_ASYNC)
// 0: uint32, 1: uint32, 2: uint32 // 0: uint32, 1: uint32, 2: uint32
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS0, "UPDATE guild_member SET BankRemSlotsTab0 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS1, "UPDATE guild_member SET BankRemSlotsTab1 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS2, "UPDATE guild_member SET BankRemSlotsTab2 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS3, "UPDATE guild_member SET BankRemSlotsTab3 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS4, "UPDATE guild_member SET BankRemSlotsTab4 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS5, "UPDATE guild_member SET BankRemSlotsTab5 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
// 0: uint32, 1: uint32, 2: uint32, 3: uint32
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS0, "UPDATE guild_member SET BankResetTimeTab0 = ?, BankRemSlotsTab0 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS1, "UPDATE guild_member SET BankResetTimeTab1 = ?, BankRemSlotsTab1 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS2, "UPDATE guild_member SET BankResetTimeTab2 = ?, BankRemSlotsTab2 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS3, "UPDATE guild_member SET BankResetTimeTab3 = ?, BankRemSlotsTab3 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS4, "UPDATE guild_member SET BankResetTimeTab4 = ?, BankRemSlotsTab4 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS5, "UPDATE guild_member SET BankResetTimeTab5 = ?, BankRemSlotsTab5 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC)
// 0: uint32, 1: uint8
PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME0, "UPDATE guild_member SET BankResetTimeTab0 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME1, "UPDATE guild_member SET BankResetTimeTab1 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME2, "UPDATE guild_member SET BankResetTimeTab2 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME3, "UPDATE guild_member SET BankResetTimeTab3 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME4, "UPDATE guild_member SET BankResetTimeTab4 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME5, "UPDATE guild_member SET BankResetTimeTab5 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC)
PREPARE_STATEMENT(CHAR_SEL_CHAR_DATA_FOR_GUILD, "SELECT name, level, class, zone, account FROM characters WHERE guid = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_CHAR_DATA_FOR_GUILD, "SELECT name, level, class, zone, account FROM characters WHERE guid = ?", CONNECTION_SYNCH)
// Chat channel handling // Chat channel handling
@@ -173,9 +173,7 @@ enum CharacterDatabaseStatements
CHAR_INS_GUILD_BANK_ITEM, CHAR_INS_GUILD_BANK_ITEM,
CHAR_DEL_GUILD_BANK_ITEM, CHAR_DEL_GUILD_BANK_ITEM,
CHAR_DEL_GUILD_BANK_ITEMS, CHAR_DEL_GUILD_BANK_ITEMS,
CHAR_INS_GUILD_BANK_RIGHT_DEFAULT,
CHAR_INS_GUILD_BANK_RIGHT, CHAR_INS_GUILD_BANK_RIGHT,
CHAR_DEL_GUILD_BANK_RIGHT,
CHAR_DEL_GUILD_BANK_RIGHTS, CHAR_DEL_GUILD_BANK_RIGHTS,
CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK, CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK,
CHAR_INS_GUILD_BANK_EVENTLOG, CHAR_INS_GUILD_BANK_EVENTLOG,
@@ -196,29 +194,10 @@ enum CharacterDatabaseStatements
CHAR_UPD_GUILD_BANK_TAB_INFO, CHAR_UPD_GUILD_BANK_TAB_INFO,
CHAR_UPD_GUILD_BANK_MONEY, CHAR_UPD_GUILD_BANK_MONEY,
CHAR_UPD_GUILD_BANK_EVENTLOG_TAB, CHAR_UPD_GUILD_BANK_EVENTLOG_TAB,
CHAR_UPD_GUILD_MEMBER_BANK_REM_MONEY,
CHAR_UPD_GUILD_MEMBER_BANK_TIME_MONEY,
CHAR_UPD_GUILD_RANK_BANK_RESET_TIME,
CHAR_UPD_GUILD_RANK_BANK_MONEY, CHAR_UPD_GUILD_RANK_BANK_MONEY,
CHAR_UPD_GUILD_BANK_TAB_TEXT, CHAR_UPD_GUILD_BANK_TAB_TEXT,
CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS0, CHAR_INS_GUILD_MEMBER_WITHDRAW,
CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS1, CHAR_DEL_GUILD_MEMBER_WITHDRAW,
CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS2,
CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS3,
CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS4,
CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS5,
CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS0,
CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS1,
CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS2,
CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS3,
CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS4,
CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS5,
CHAR_UPD_GUILD_RANK_BANK_TIME0,
CHAR_UPD_GUILD_RANK_BANK_TIME1,
CHAR_UPD_GUILD_RANK_BANK_TIME2,
CHAR_UPD_GUILD_RANK_BANK_TIME3,
CHAR_UPD_GUILD_RANK_BANK_TIME4,
CHAR_UPD_GUILD_RANK_BANK_TIME5,
CHAR_SEL_CHAR_DATA_FOR_GUILD, CHAR_SEL_CHAR_DATA_FOR_GUILD,
CHAR_SEL_CHANNEL, CHAR_SEL_CHANNEL,
@@ -975,6 +975,14 @@ Quests.IgnoreAutoComplete = 0
Guild.EventLogRecordsCount = 100 Guild.EventLogRecordsCount = 100
#
# Guild.ResetHour
# Description: Hour of the day when the daily cap resets occur.
# Range: 0-23
# Default: 6 - (06:00 AM)
Guild.ResetHour = 6
# #
# Guild.BankEventLogRecordsCount # Guild.BankEventLogRecordsCount
# Description: Number of log entries for guild bank events that are stored per guild. Old # Description: Number of log entries for guild bank events that are stored per guild. Old