diff options
author | Kaelima <kaelima@live.se> | 2012-07-25 06:53:26 -0700 |
---|---|---|
committer | Kaelima <kaelima@live.se> | 2012-07-25 06:53:26 -0700 |
commit | 49d8836f9d42f17409c5cc11a813af44202ebf37 (patch) | |
tree | 379738a9ea1ca6f1daf9bd6310ee432cf01376da | |
parent | 443f1e71d8660307ebf17f20abc954bf4b9eba74 (diff) | |
parent | 2b8ea938774f55cc6e7798a2f86ef9f937e48fae (diff) |
Merge pull request #7182 from horn/4.3.4
[4.3.4] Core/PacketIO: Fix and enable few speed changes related opcodes
-rwxr-xr-x | src/server/game/Entities/Creature/Creature.cpp | 4 | ||||
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 173 | ||||
-rw-r--r-- | src/server/game/Server/Protocol/Opcodes.cpp | 15 | ||||
-rwxr-xr-x | src/server/game/Server/Protocol/Opcodes.h | 16 |
4 files changed, 103 insertions, 105 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 6d0dee92e38..aa538437491 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2509,9 +2509,9 @@ bool Creature::SetWalk(bool enable) data.WriteBit(guid[5]); data.WriteBit(guid[6]); data.WriteBit(guid[3]); + data.WriteBit(guid[7]); data.WriteBit(guid[2]); data.WriteBit(guid[0]); - data.WriteBit(guid[7]); data.WriteBit(guid[4]); data.WriteBit(guid[1]); data.FlushBits(); @@ -2631,10 +2631,10 @@ bool Creature::SetHover(bool enable) WorldPacket data(SMSG_SPLINE_MOVE_UNSET_HOVER, 9); data.WriteBit(guid[6]); data.WriteBit(guid[7]); + data.WriteBit(guid[4]); data.WriteBit(guid[0]); data.WriteBit(guid[3]); data.WriteBit(guid[1]); - data.WriteBit(guid[4]); data.WriteBit(guid[5]); data.WriteBit(guid[2]); data.FlushBits(); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ad8510a2775..a41d5ddaa0c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12751,174 +12751,171 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_RUN: data.Initialize(SMSG_SPLINE_MOVE_SET_RUN_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[6]); data.WriteBit(bytes[4]); data.WriteBit(bytes[0]); - - data.WriteByteSeq(bytes[6]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[2]); + data.FlushBits(); + data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[4]); + data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[1]); - - data << float(GetSpeed(mtype)); break; case MOVE_RUN_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[0]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[2]); data.WriteBit(bytes[6]); + data.WriteBit(bytes[0]); data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[1]); data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); - + data.WriteBit(bytes[5]); + data.WriteBit(bytes[4]); + data.FlushBits(); data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[6]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[2]); data.WriteByteSeq(bytes[4]); data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[2]); - - data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[7]); break; case MOVE_SWIM: data.Initialize(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[7]); data.WriteBit(bytes[4]); data.WriteBit(bytes[2]); + data.WriteBit(bytes[5]); data.WriteBit(bytes[0]); - data.WriteBit(bytes[1]); + data.WriteBit(bytes[7]); data.WriteBit(bytes[6]); - - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[3]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[1]); + data.FlushBits(); + data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[3]); break; case MOVE_SWIM_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[4]); data.WriteBit(bytes[0]); - data.WriteBit(bytes[2]); data.WriteBit(bytes[1]); + data.WriteBit(bytes[3]); data.WriteBit(bytes[6]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[5]); data.WriteBit(bytes[7]); - + data.WriteBit(bytes[2]); + data.FlushBits(); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[1]); data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[2]); - data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[6]); + data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[2]); break; case MOVE_TURN_RATE: data.Initialize(SMSG_SPLINE_MOVE_SET_TURN_RATE, 1 + 8 + 4); - data.WriteBit(bytes[0]); + data.WriteBit(bytes[2]); data.WriteBit(bytes[4]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[1]); data.WriteBit(bytes[6]); + data.WriteBit(bytes[1]); data.WriteBit(bytes[3]); + data.WriteBit(bytes[5]); data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); - - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[0]); + data.WriteBit(bytes[0]); + data.FlushBits(); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[0]); break; case MOVE_FLIGHT: data.Initialize(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[0]); data.WriteBit(bytes[7]); data.WriteBit(bytes[4]); - data.WriteBit(bytes[6]); + data.WriteBit(bytes[0]); data.WriteBit(bytes[1]); - - data << float(GetSpeed(mtype)); - - data.WriteByteSeq(bytes[1]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[2]); + data.FlushBits(); data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[4]); data.WriteByteSeq(bytes[7]); data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[6]); + data << float(GetSpeed(mtype)); break; case MOVE_FLIGHT_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4); + data.WriteBit(bytes[2]); data.WriteBit(bytes[1]); data.WriteBit(bytes[6]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[7]); data.WriteBit(bytes[5]); - data.WriteBit(bytes[4]); + data.WriteBit(bytes[0]); data.WriteBit(bytes[3]); - + data.WriteBit(bytes[4]); + data.WriteBit(bytes[7]); + data.FlushBits(); data.WriteByteSeq(bytes[5]); + data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[1]); data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[4]); data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[7]); - data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); break; case MOVE_PITCH_RATE: data.Initialize(SMSG_SPLINE_MOVE_SET_PITCH_RATE, 1 + 8 + 4); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); data.WriteBit(bytes[3]); data.WriteBit(bytes[5]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[0]); data.WriteBit(bytes[6]); data.WriteBit(bytes[1]); - - data.WriteByteSeq(bytes[0]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[2]); + data.FlushBits(); data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[2]); data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[4]); break; default: sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 5a53b637a99..a8cf654d028 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1296,18 +1296,19 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 4bbe2f70712..5b7cd63a2a7 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1076,19 +1076,19 @@ enum Opcodes SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x3CA6, SMSG_SPLINE_MOVE_ROOT = 0x51B4, SMSG_SPLINE_MOVE_SET_FEATHER_FALL = 0x3DA5, - SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x38B3, + SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x39A0, SMSG_SPLINE_MOVE_SET_FLYING = 0x31B5, SMSG_SPLINE_MOVE_SET_HOVER = 0x14B6, SMSG_SPLINE_MOVE_SET_LAND_WALK = 0x3DA7, SMSG_SPLINE_MOVE_SET_NORMAL_FALL = 0x38B2, - SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x0000, - SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x14B0, + SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x3DB3, SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x75A7, - SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x51B7, - SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x0000, + SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x51B7, + SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x59A1, + SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x39A4, + SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x78B5, SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x54B6, SMSG_SPLINE_MOVE_SET_WALK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_WATER_WALK = 0x0000, |