Changeset 12 for trunk/src/game

Show
Ignore:
Timestamp:
11/19/08 13:22:59 (17 years ago)
Author:
yumileroy
Message:

[svn] * PlaySound? changed to SendPlaySound?, moved to WorldObject? and used everywhere instead of hard-coding packet

Original author: Neo2003
Date: 2008-10-05 11:38:24-05:00

Location:
trunk/src/game
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Object.cpp

    r2 r12  
    11671167} 
    11681168 
     1169void WorldObject::SendPlaySound(uint32 Sound, bool OnlySelf) 
     1170{ 
     1171    WorldPacket data(SMSG_PLAY_SOUND, 4); 
     1172    data << Sound; 
     1173    if (OnlySelf && GetTypeId() == TYPEID_PLAYER ) 
     1174        ((Player*)this)->GetSession()->SendPacket( &data ); 
     1175    else 
     1176        SendMessageToSet( &data, true ); // ToSelf ignored in this case 
     1177} 
     1178 
    11691179namespace MaNGOS 
    11701180{ 
  • trunk/src/game/Object.h

    r2 r12  
    438438        virtual bool isVisibleForInState(Player const* u, bool inVisibleList) const = 0; 
    439439 
     440        // Low Level Packets 
     441        void SendPlaySound(uint32 Sound, bool OnlySelf); 
     442 
    440443        Map      * GetMap() const; 
    441444        Map const* GetBaseMap() const; 
  • trunk/src/game/Player.cpp

    r9 r12  
    1538115381} 
    1538215382 
    15383 void Player::PlaySound(uint32 Sound, bool OnlySelf) 
    15384 { 
    15385     WorldPacket data(SMSG_PLAY_SOUND, 4); 
    15386     data << Sound; 
    15387     if (OnlySelf) 
    15388         GetSession()->SendPacket( &data ); 
    15389     else 
    15390         SendMessageToSet( &data, true ); 
    15391 } 
    15392  
    1539315383void Player::SendExplorationExperience(uint32 Area, uint32 Experience) 
    1539415384{ 
  • trunk/src/game/Player.h

    r9 r12  
    15931593        void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP); 
    15941594 
    1595         //Low Level Packets 
    1596         void PlaySound(uint32 Sound, bool OnlySelf); 
    15971595        //notifiers 
    15981596        void SendAttackSwingCantAttack(); 
  • trunk/src/game/debugcmds.cpp

    r9 r12  
    217217 
    218218    uint32 soundid = atoi(args); 
    219     m_session->GetPlayer()->PlaySound(soundid, false); 
     219    m_session->GetPlayer()->SendPlaySound(soundid, false); 
    220220    return true; 
    221221}