Skip to content

Commit

Permalink
Updatefields cleanup, missing byte for loot response, fixed twoopcode…
Browse files Browse the repository at this point in the history
… definitions, read talentTabId in MSG_LEARN_PREVIEW, read glyphIndex in castspell.
  • Loading branch information
Fabian committed Jun 20, 2012
1 parent 46a1364 commit bd8586b
Show file tree
Hide file tree
Showing 5 changed files with 512 additions and 510 deletions.
1 change: 1 addition & 0 deletions src/game/LootMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)

size_t count_pos = b.wpos(); // pos of item count byte
b << uint8(0); // item count placeholder
b << uint8(0);

if (lv.permission == NONE_PERMISSION)
return b; // nothing output more
Expand Down
14 changes: 7 additions & 7 deletions src/game/Opcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void InitOpcodeTable()
OPCODE(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode );
OPCODE(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(CMSG_BUY_TRAINER_SERVICE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode );
OPCODE(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(CMSG_NPC_CACHE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode );
OPCODE(SMSG_NPC_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
Expand All @@ -269,7 +269,7 @@ void InitOpcodeTable()
OPCODE(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode);
//OPCODE(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_EQUIPMENT_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_EQUIPMENT_SET_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_EQUIPMENT_SET_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
Expand Down Expand Up @@ -312,9 +312,9 @@ void InitOpcodeTable()
OPCODE(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveTimeSkippedOpcode );
OPCODE(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_TALENT_UPDATE ,STATUS_LOGGEDIN,PROCESS_THREADUNSAFE, &WorldSession::HandleServerSide );
OPCODE(SMSG_LEVELUP_INFO ,STATUS_LOGGEDIN,PROCESS_THREADUNSAFE, &WorldSession::HandleServerSide );
OPCODE(CMSG_LEARN_TALENT ,STATUS_LOGGEDIN,PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode );
OPCODE(CMSG_LEARN_PREVIEW_TALENTS ,STATUS_LOGGEDIN,PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents );
OPCODE(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_TALENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleServerSide );
OPCODE(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode );
OPCODE(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents );
};
8 changes: 4 additions & 4 deletions src/game/SkillHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket)
{
DEBUG_LOG("CMSG_LEARN_PREVIEW_TALENTS");

uint32 talentsCount;
recvPacket.read_skip<uint32>();
recvPacket >> talentsCount ;
uint32 talentsCount, talentTabId;
recvPacket >> talentTabId;
recvPacket >> talentsCount;

sLog.outDebug("Number of talents sent with CMSG_LEARN_PREVIEW_TALENTS : %u",talentsCount);
sLog.outDebug("Number of talents, tabId sent with CMSG_LEARN_PREVIEW_TALENTS : %u, %u",talentsCount, talentTabId);

uint32 talentId, talentRank;

Expand Down
5 changes: 3 additions & 2 deletions src/game/SpellHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,11 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)

void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
{
uint32 spellId;
uint32 spellId, glyphIndex;
uint8 cast_count, unk_flags;
recvPacket >> cast_count;
recvPacket >> spellId;
recvPacket.read_skip<uint32>();
recvPacket >> glyphIndex;
recvPacket >> unk_flags; // flags (if 0x02 - some additional data are received)

// ignore for remote control state (for player case)
Expand Down Expand Up @@ -440,6 +440,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)

Spell *spell = new Spell(mover, spellInfo, false);
spell->m_cast_count = cast_count; // set count of casts
spell->m_glyphIndex = glyphIndex;
spell->prepare(&targets);
}

Expand Down
Loading

0 comments on commit bd8586b

Please sign in to comment.