From fdc20af337ff12fcdf0a995af0e6ccd4c6f73d6f Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Fri, 28 Aug 2009 22:33:52 +0400 Subject: [PATCH] Some fixes. --- sql/320/5_bugreport.sql | 3 ++ src/game/DynamicObject.h | 1 - src/game/MiscHandler.cpp | 4 ++- src/game/MovementHandler.cpp | 9 +++-- src/game/Opcodes.cpp | 4 +-- src/game/Opcodes.h | 4 +-- src/game/Player.cpp | 11 +++--- src/game/Player.h | 2 -- src/game/QueryHandler.cpp | 13 +++++++ src/game/SharedDefines.h | 68 +++++++++++++++++++----------------- src/game/Spell.cpp | 18 +++++++++- src/game/Spell.h | 3 +- src/game/SpellHandler.cpp | 14 +++++--- src/game/WorldSession.h | 1 + 14 files changed, 99 insertions(+), 56 deletions(-) create mode 100644 sql/320/5_bugreport.sql diff --git a/sql/320/5_bugreport.sql b/sql/320/5_bugreport.sql new file mode 100644 index 000000000..8677da13a --- /dev/null +++ b/sql/320/5_bugreport.sql @@ -0,0 +1,3 @@ +alter table `characters`.`bugreport` + change `type` `type` longtext NOT NULL, + change `content` `content` longtext NOT NULL; diff --git a/src/game/DynamicObject.h b/src/game/DynamicObject.h index 066361b8c..089175f3c 100644 --- a/src/game/DynamicObject.h +++ b/src/game/DynamicObject.h @@ -61,7 +61,6 @@ class DynamicObject : public WorldObject uint32 m_spellId; uint32 m_effIndex; int32 m_aliveDuration; - time_t m_nextThinkTime; float m_radius; // radius apply persistent effect, 0 = no persistent effect AffectedSet m_affected; private: diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index eabc8f0a6..459bb2111 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -40,10 +40,12 @@ #include "Pet.h" #include "SocialMgr.h" -void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ ) +void WorldSession::HandleRepopRequestOpcode( WorldPacket & recv_data ) { sLog.outDebug( "WORLD: Recvd CMSG_REPOP_REQUEST Message" ); + recv_data.read_skip(); + if(GetPlayer()->isAlive() || GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) return; diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index cddb39594..67951bab9 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -515,7 +515,8 @@ void WorldSession::HandleMoveKnockBackAck( WorldPacket & recv_data ) { sLog.outDebug("CMSG_MOVE_KNOCK_BACK_ACK"); - recv_data.read_skip(); // guid + uint64 guid; + recv_data.readPackGUID(guid); recv_data.read_skip(); // unk MovementInfo movementInfo; @@ -526,7 +527,8 @@ void WorldSession::HandleMoveHoverAck( WorldPacket& recv_data ) { sLog.outDebug("CMSG_MOVE_HOVER_ACK"); - recv_data.read_skip(); // guid + uint64 guid; + recv_data.readPackGUID(guid); recv_data.read_skip(); // unk MovementInfo movementInfo; @@ -539,7 +541,8 @@ void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recv_data) { sLog.outDebug("CMSG_MOVE_WATER_WALK_ACK"); - recv_data.read_skip(); // guid + uint64 guid; + recv_data.readPackGUID(guid); recv_data.read_skip(); // unk MovementInfo movementInfo; diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 682039af2..964c14dd7 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1232,8 +1232,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4B3*/ { "CMSG_ITEM_REFUND_INFO_REQUEST", STATUS_LOGGEDIN, &WorldSession::HandleItemRefundInfoRequest }, /*0x4B4*/ { "CMSG_UNKNOWN_1204", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4B5*/ { "SMSG_UNKNOWN_1205", STATUS_NEVER, &WorldSession::Handle_ServerSide }, - /*0x4B6*/ { "CMSG_UNKNOWN_1206", STATUS_NEVER, &WorldSession::Handle_NULL }, - /*0x4B7*/ { "SMSG_UNKNOWN_1207", STATUS_NEVER, &WorldSession::Handle_ServerSide }, + /*0x4B6*/ { "CMSG_CORPSE_MAP_POSITION_QUERY", STATUS_LOGGEDIN, &WorldSession::HandleCorpseMapPositionQuery }, + /*0x4B7*/ { "CMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x4B8*/ { "CMSG_LFG_SET_ROLES", STATUS_LOGGEDIN, &WorldSession::HandleLfgSetRoles }, /*0x4B9*/ { "UMSG_UNKNOWN_1209", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x4BA*/ { "CMSG_UNKNOWN_1210", STATUS_NEVER, &WorldSession::Handle_NULL }, diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index f34c82b24..fafccb09b 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1240,8 +1240,8 @@ enum Opcodes CMSG_ITEM_REFUND_INFO_REQUEST = 0x4B3, // refund request? CMSG_UNKNOWN_1204 = 0x4B4, // lua: ContainerRefundItemPurchase SMSG_UNKNOWN_1205 = 0x4B5, // refund something - CMSG_UNKNOWN_1206 = 0x4B6, // CMSG, uint32 - SMSG_UNKNOWN_1207 = 0x4B7, // SMSG, string+float + CMSG_CORPSE_MAP_POSITION_QUERY = 0x4B6, // CMSG, uint32 + CMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x4B7, // SMSG, 3*float+float CMSG_LFG_SET_ROLES = 0x4B8, // CMSG, empty, lua: SetLFGRoles UMSG_UNKNOWN_1209 = 0x4B9, // not found CMSG_UNKNOWN_1210 = 0x4BA, // CMSG, uint64, lua: CalendarContextEventSignUp diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 660c2b1af..dc5027151 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1444,10 +1444,9 @@ bool Player::BuildEnumData( QueryResult * result, WorldPacket * p_data ) char_flags |= CHARACTER_FLAG_DECLINED; *p_data << uint32(char_flags); // character flags - // character customize (flags?) + // character customize flags *p_data << uint32(atLoginFlags & AT_LOGIN_CUSTOMIZE ? 1 : 0);// 0x00010000 - faction change *p_data << uint8(1); // unknown - *p_data << uint8(0); // 3.2 // Pets info { @@ -4236,17 +4235,17 @@ void Player::CreateCorpse() corpse->SetUInt32Value( CORPSE_FIELD_GUILD, GetGuildId() ); uint32 iDisplayID; - uint16 iIventoryType; + uint32 iIventoryType; uint32 _cfi; for (int i = 0; i < EQUIPMENT_SLOT_END; ++i) { if(m_items[i]) { iDisplayID = m_items[i]->GetProto()->DisplayInfoID; - iIventoryType = (uint16)m_items[i]->GetProto()->InventoryType; + iIventoryType = m_items[i]->GetProto()->InventoryType; - _cfi = (uint16(iDisplayID)) | (iIventoryType)<< 24; - corpse->SetUInt32Value(CORPSE_FIELD_ITEM + i,_cfi); + _cfi = iDisplayID | (iIventoryType << 24); + corpse->SetUInt32Value(CORPSE_FIELD_ITEM + i, _cfi); } } diff --git a/src/game/Player.h b/src/game/Player.h index 2a1d1eb42..d9fde7a0b 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2390,8 +2390,6 @@ class MANGOS_DLL_SPEC Player : public Unit uint16 tradeItems[TRADE_SLOT_COUNT]; uint32 tradeGold; - time_t m_nextThinkTime; - bool m_DailyQuestChanged; time_t m_lastDailyQuestTime; diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index 81104f70a..38c6ee096 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -457,3 +457,16 @@ void WorldSession::HandlePageTextQueryOpcode( WorldPacket & recv_data ) sLog.outDebug( "WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE" ); } } + +void WorldSession::HandleCorpseMapPositionQuery( WorldPacket & recv_data ) +{ + uint32 unk; + recv_data >> unk; + + WorldPacket data(CMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, 4+4+4+4); + data << float(0); + data << float(0); + data << float(0); + data << float(0); + SendPacket(&data); +} diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 096aa775d..a8638378f 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2518,42 +2518,44 @@ enum ResponseCodes CHAR_CREATE_CHARACTER_CHOOSE_RACE = 0x3F, CHAR_CREATE_CHARACTER_ARENA_LEADER = 0x40, CHAR_CREATE_CHARACTER_DELETE_MAIL = 0x41, + CHAR_CREATE_CHARACTER_SWAP_FACTION = 0x42, + CHAR_CREATE_CHARACTER_RACE_ONLY = 0x43, - CHAR_DELETE_IN_PROGRESS = 0x42, - CHAR_DELETE_SUCCESS = 0x43, - CHAR_DELETE_FAILED = 0x44, - CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 0x45, - CHAR_DELETE_FAILED_GUILD_LEADER = 0x46, - CHAR_DELETE_FAILED_ARENA_CAPTAIN = 0x47, + CHAR_DELETE_IN_PROGRESS = 0x44, + CHAR_DELETE_SUCCESS = 0x45, + CHAR_DELETE_FAILED = 0x46, + CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 0x47, + CHAR_DELETE_FAILED_GUILD_LEADER = 0x48, + CHAR_DELETE_FAILED_ARENA_CAPTAIN = 0x49, - CHAR_LOGIN_IN_PROGRESS = 0x48, - CHAR_LOGIN_SUCCESS = 0x49, - CHAR_LOGIN_NO_WORLD = 0x4A, - CHAR_LOGIN_DUPLICATE_CHARACTER = 0x4B, - CHAR_LOGIN_NO_INSTANCES = 0x4C, - CHAR_LOGIN_FAILED = 0x4D, - CHAR_LOGIN_DISABLED = 0x4E, - CHAR_LOGIN_NO_CHARACTER = 0x4F, - CHAR_LOGIN_LOCKED_FOR_TRANSFER = 0x50, - CHAR_LOGIN_LOCKED_BY_BILLING = 0x51, + CHAR_LOGIN_IN_PROGRESS = 0x4A, + CHAR_LOGIN_SUCCESS = 0x4B, + CHAR_LOGIN_NO_WORLD = 0x4C, + CHAR_LOGIN_DUPLICATE_CHARACTER = 0x4D, + CHAR_LOGIN_NO_INSTANCES = 0x4E, + CHAR_LOGIN_FAILED = 0x4F, + CHAR_LOGIN_DISABLED = 0x50, + CHAR_LOGIN_NO_CHARACTER = 0x51, + CHAR_LOGIN_LOCKED_FOR_TRANSFER = 0x52, + CHAR_LOGIN_LOCKED_BY_BILLING = 0x53, - CHAR_NAME_SUCCESS = 0x52, - CHAR_NAME_FAILURE = 0x53, - CHAR_NAME_NO_NAME = 0x54, - CHAR_NAME_TOO_SHORT = 0x55, - CHAR_NAME_TOO_LONG = 0x56, - CHAR_NAME_INVALID_CHARACTER = 0x57, - CHAR_NAME_MIXED_LANGUAGES = 0x58, - CHAR_NAME_PROFANE = 0x59, - CHAR_NAME_RESERVED = 0x5A, - CHAR_NAME_INVALID_APOSTROPHE = 0x5B, - CHAR_NAME_MULTIPLE_APOSTROPHES = 0x5C, - CHAR_NAME_THREE_CONSECUTIVE = 0x5D, - CHAR_NAME_INVALID_SPACE = 0x5E, - CHAR_NAME_CONSECUTIVE_SPACES = 0x5F, - CHAR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 0x60, - CHAR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 0x61, - CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x62 + CHAR_NAME_SUCCESS = 0x54, + CHAR_NAME_FAILURE = 0x55, + CHAR_NAME_NO_NAME = 0x56, + CHAR_NAME_TOO_SHORT = 0x57, + CHAR_NAME_TOO_LONG = 0x58, + CHAR_NAME_INVALID_CHARACTER = 0x59, + CHAR_NAME_MIXED_LANGUAGES = 0x5A, + CHAR_NAME_PROFANE = 0x5B, + CHAR_NAME_RESERVED = 0x5C, + CHAR_NAME_INVALID_APOSTROPHE = 0x5D, + CHAR_NAME_MULTIPLE_APOSTROPHES = 0x5E, + CHAR_NAME_THREE_CONSECUTIVE = 0x5F, + CHAR_NAME_INVALID_SPACE = 0x60, + CHAR_NAME_CONSECUTIVE_SPACES = 0x61, + CHAR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 0x62, + CHAR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 0x63, + CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x64 }; /// Ban function modes diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 2d894fbca..68052b5ae 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -239,7 +239,10 @@ bool SpellCastTargets::read ( WorldPacket * data, Unit *caster ) if( m_targetMask & TARGET_FLAG_SOURCE_LOCATION ) { - if(data->rpos() + 4 + 4 + 4 > data->size()) + if(data->rpos() + 1 + 4 + 4 + 4 > data->size()) + return false; + + if(!data->readPackGUID(m_unitTargetGUID)) return false; *data >> m_srcX >> m_srcY >> m_srcZ; @@ -308,7 +311,14 @@ void SpellCastTargets::write ( WorldPacket * data ) } if( m_targetMask & TARGET_FLAG_SOURCE_LOCATION ) + { + if(m_unitTarget) + data->append(m_unitTarget->GetPackGUID()); + else + *data << uint8(0); + *data << m_srcX << m_srcY << m_srcZ; + } if( m_targetMask & TARGET_FLAG_DEST_LOCATION ) { @@ -2973,6 +2983,12 @@ void Spell::SendSpellStart() if ( castFlags & CAST_FLAG_AMMO ) WriteAmmoToPacket(&data); + if ( castFlags & CAST_FLAG_UNKNOWN21 ) + { + data << uint32(0); + data << uint32(0); + } + m_caster->SendMessageToSet(&data, true); } diff --git a/src/game/Spell.h b/src/game/Spell.h index d3092c895..17fbdbe80 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -77,7 +77,8 @@ enum SpellCastFlags CAST_FLAG_UNKNOWN10 = 0x00040000, CAST_FLAG_UNKNOWN5 = 0x00080000, // wotlk CAST_FLAG_UNKNOWN20 = 0x00100000, - CAST_FLAG_UNKNOWN7 = 0x00200000 // wotlk, rune cooldown list + CAST_FLAG_UNKNOWN7 = 0x00200000, // wotlk, rune cooldown list + CAST_FLAG_UNKNOWN21 = 0x04000000 }; enum SpellNotifyPushType diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index 2112325f2..2372dfd4b 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -340,10 +340,16 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) { recvPacket.read_skip(); // unk1, coords? recvPacket.read_skip(); // unk1, coords? - recvPacket.read_skip(); // >> 1 - recvPacket.read_skip(); // >> MSG_MOVE_STOP - MovementInfo movementInfo; - ReadMovementInfo(recvPacket, &movementInfo); + uint8 unk1; + recvPacket >> unk1; // >> 1 or 0 + if(unk1) + { + recvPacket.read_skip(); // >> MSG_MOVE_STOP + uint64 guid; + recvPacket.readPackGUID(guid); + MovementInfo movementInfo; + ReadMovementInfo(recvPacket, &movementInfo); + } } // auto-selection buff level base at target level (in spellInfo) diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index df4765695..0e9ef4faa 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -570,6 +570,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleReclaimCorpseOpcode( WorldPacket& recvPacket ); void HandleCorpseQueryOpcode( WorldPacket& recvPacket ); + void HandleCorpseMapPositionQuery( WorldPacket& recvPacket ); void HandleResurrectResponseOpcode(WorldPacket& recvPacket); void HandleSummonResponseOpcode(WorldPacket& recv_data);