*Some fix of vehicles. Thanks to Seizerkiller.
--HG-- branch : trunk
This commit is contained in:
@@ -135,7 +135,7 @@ MessageDistDeliverer::Visit(PlayerMapType &m)
|
||||
SendPacket(*i);
|
||||
}
|
||||
|
||||
if(target->m_seer == target)
|
||||
if(target->m_seer == target || target->m_Vehicle)
|
||||
SendPacket(target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,6 +346,9 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
|
||||
return;
|
||||
mover->GetMap()->CreatureRelocation((Creature*)mover, movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
|
||||
}
|
||||
|
||||
//sLog.outString("Receive Movement Packet %s:", opcodeTable[recv_data.GetOpcode()]);
|
||||
//mover->OutMovementInfo();
|
||||
}
|
||||
|
||||
void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data)
|
||||
|
||||
+18
-94
@@ -119,7 +119,20 @@ void Object::_Create( uint32 guidlow, uint32 entry, HighGuid guidhigh )
|
||||
|
||||
uint64 guid = MAKE_NEW_GUID(guidlow, entry, guidhigh);
|
||||
SetUInt64Value( OBJECT_FIELD_GUID, guid );
|
||||
SetUInt32Value( OBJECT_FIELD_TYPE, m_objectType );
|
||||
uint32 type = 0;
|
||||
switch(m_objectType)
|
||||
{
|
||||
//case TYPEID_ITEM: type = 3; break;
|
||||
//case TYPEID_CONTAINER: type = 7; break; //+4
|
||||
//case TYPEID_UNIT: type = 9; break; //+2
|
||||
//case TYPEID_PLAYER: type = 25; break; //+16
|
||||
//case TYPEID_GAMEOBJECT: type = 33; break; //+8
|
||||
case TYPEID_DYNAMICOBJECT: type = 65; break; //+32
|
||||
//case TYPEID_CORPSE: type = 129; break; //+64
|
||||
default: type = m_objectType; break;
|
||||
}
|
||||
SetUInt32Value( OBJECT_FIELD_TYPE, type );
|
||||
//SetUInt32Value( OBJECT_FIELD_TYPE, m_objectType );
|
||||
m_PackGUID.wpos(0);
|
||||
m_PackGUID.appendPackGUID(GetGUID());
|
||||
}
|
||||
@@ -258,42 +271,6 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
|
||||
// 0x20
|
||||
if (flags & UPDATEFLAG_LIVING)
|
||||
{
|
||||
uint32 flags2 = ((Unit*)this)->GetUnitMovementFlags();
|
||||
switch(GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
{
|
||||
if(((Creature*)this)->isVehicle())
|
||||
((Unit*)this)->m_movementInfo.unk1 |= 0x20; // always allow pitch
|
||||
if(((Unit*)this)->isInFlight())
|
||||
flags2 |= (MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_LEVITATING);
|
||||
}
|
||||
break;
|
||||
case TYPEID_PLAYER:
|
||||
{
|
||||
// remove unknown, unused etc flags for now
|
||||
flags2 &= ~MOVEMENTFLAG_SPLINE2; // will be set manually
|
||||
|
||||
if(((Player*)this)->isInFlight())
|
||||
{
|
||||
WPAssert(((Player*)this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
|
||||
flags2 = (MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_SPLINE2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
*data << uint32(flags2); // movement flags
|
||||
*data << uint16(((Unit*)this)->m_movementInfo.unk1);// unknown 2.3.0
|
||||
*data << uint32(getMSTime()); // time (in milliseconds)
|
||||
|
||||
// position
|
||||
*data << ((WorldObject*)this)->GetPositionX();
|
||||
*data << ((WorldObject*)this)->GetPositionY();
|
||||
*data << ((WorldObject*)this)->GetPositionZ();
|
||||
*data << ((WorldObject*)this)->GetOrientation();
|
||||
|
||||
// 0x00000200
|
||||
((Unit*)this)->BuildMovementPacket(data);
|
||||
|
||||
*data << ((Unit*)this)->GetSpeed( MOVE_WALK );
|
||||
@@ -444,29 +421,8 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
|
||||
// 0x10
|
||||
if(flags & UPDATEFLAG_HIGHGUID)
|
||||
{
|
||||
switch(GetTypeId())
|
||||
{
|
||||
case TYPEID_OBJECT:
|
||||
case TYPEID_ITEM:
|
||||
case TYPEID_CONTAINER:
|
||||
case TYPEID_GAMEOBJECT:
|
||||
case TYPEID_DYNAMICOBJECT:
|
||||
case TYPEID_CORPSE:
|
||||
*data << uint32(GetGUIDHigh()); // GetGUIDHigh()
|
||||
break;
|
||||
case TYPEID_UNIT:
|
||||
*data << uint32(0x0000000B); // unk, can be 0xB or 0xC
|
||||
break;
|
||||
case TYPEID_PLAYER:
|
||||
if(flags & UPDATEFLAG_SELF)
|
||||
*data << uint32(0x0000002F); // unk, can be 0x15 or 0x22
|
||||
else
|
||||
*data << uint32(0x00000008); // unk, can be 0x7 or 0x8
|
||||
break;
|
||||
default:
|
||||
*data << uint32(0x00000000); // unk
|
||||
break;
|
||||
}
|
||||
// not high guid
|
||||
*data << uint32(0x00000000); // unk
|
||||
}
|
||||
|
||||
// 0x4
|
||||
@@ -1681,43 +1637,11 @@ void WorldObject::BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const*
|
||||
*data << (uint8)0; // ChatTag
|
||||
}
|
||||
|
||||
void WorldObject::BuildHeartBeatMsg(WorldPacket *data) const
|
||||
void Unit::BuildHeartBeatMsg(WorldPacket *data) const
|
||||
{
|
||||
//Heartbeat message cannot be used for non-units
|
||||
if (!isType(TYPEMASK_UNIT))
|
||||
return;
|
||||
|
||||
data->Initialize(MSG_MOVE_HEARTBEAT, 32);
|
||||
data->append(GetPackGUID());
|
||||
*data << uint32(((Unit*)this)->GetUnitMovementFlags()); // movement flags
|
||||
*data << uint16(((Unit*)this)->m_movementInfo.unk1); // 2.3.0
|
||||
*data << uint32(getMSTime()); // time
|
||||
*data << m_positionX;
|
||||
*data << m_positionY;
|
||||
*data << m_positionZ;
|
||||
*data << m_orientation;
|
||||
|
||||
((Unit*)this)->BuildMovementPacket(data);
|
||||
}
|
||||
|
||||
void WorldObject::BuildTeleportAckMsg(WorldPacket *data, float x, float y, float z, float ang) const
|
||||
{
|
||||
//TeleportAck message cannot be used for non-units
|
||||
if (!isType(TYPEMASK_UNIT))
|
||||
return;
|
||||
|
||||
data->Initialize(MSG_MOVE_TELEPORT_ACK, 41);
|
||||
data->append(GetPackGUID());
|
||||
*data << uint32(0); // this value increments every time
|
||||
*data << uint32(((Unit*)this)->GetUnitMovementFlags()); // movement flags
|
||||
*data << uint16(((Unit*)this)->m_movementInfo.unk1); // 2.3.0
|
||||
*data << uint32(getMSTime()); // time
|
||||
*data << x;
|
||||
*data << y;
|
||||
*data << z;
|
||||
*data << ang;
|
||||
|
||||
((Unit*)this)->BuildMovementPacket(data);
|
||||
BuildMovementPacket(data);
|
||||
}
|
||||
|
||||
void WorldObject::SendMessageToSet(WorldPacket *data, bool /*fake*/)
|
||||
|
||||
@@ -499,8 +499,6 @@ class TRINITY_DLL_SPEC WorldObject : public Object
|
||||
|
||||
virtual void SendMessageToSet(WorldPacket *data, bool self);
|
||||
virtual void SendMessageToSetInRange(WorldPacket *data, float dist, bool self);
|
||||
void BuildHeartBeatMsg( WorldPacket *data ) const;
|
||||
void BuildTeleportAckMsg( WorldPacket *data, float x, float y, float z, float ang) const;
|
||||
|
||||
void MonsterSay(const char* text, uint32 language, uint64 TargetGuid);
|
||||
void MonsterYell(const char* text, uint32 language, uint64 TargetGuid);
|
||||
|
||||
+14
-3
@@ -1602,6 +1602,15 @@ uint8 Player::chatTag() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Player::SendTeleportAckMsg()
|
||||
{
|
||||
WorldPacket data(MSG_MOVE_TELEPORT_ACK, 41);
|
||||
data.append(GetPackGUID());
|
||||
data << uint32(0); // this value increments every time
|
||||
BuildMovementPacket(&data);
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options)
|
||||
{
|
||||
if(!MapManager::IsValidMapCoord(mapid, x, y, z, orientation))
|
||||
@@ -1695,9 +1704,11 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
// near teleport, triggering send MSG_MOVE_TELEPORT_ACK from client at landing
|
||||
if(!GetSession()->PlayerLogout())
|
||||
{
|
||||
WorldPacket data;
|
||||
BuildTeleportAckMsg(&data, x, y, z, orientation);
|
||||
GetSession()->SendPacket(&data);
|
||||
WorldLocation oldLoc;
|
||||
GetPosition(oldLoc);
|
||||
Relocate(x, y, z, orientation);
|
||||
SendTeleportAckMsg();
|
||||
Relocate(oldLoc);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1629,6 +1629,8 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
void SendMessageToSetInRange(WorldPacket *data, float fist, bool self);// overwrite Object::SendMessageToSetInRange
|
||||
void SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool own_team_only);
|
||||
|
||||
void SendTeleportAckMsg();
|
||||
|
||||
static void DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmChars = true);
|
||||
|
||||
Corpse *GetCorpse() const;
|
||||
|
||||
@@ -2823,7 +2823,6 @@ void Spell::EffectPersistentAA(uint32 i)
|
||||
delete dynObj;
|
||||
return;
|
||||
}
|
||||
dynObj->SetUInt32Value(OBJECT_FIELD_TYPE, 65);
|
||||
dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x01eeeeee);
|
||||
caster->AddDynObject(dynObj);
|
||||
dynObj->GetMap()->Add(dynObj);
|
||||
@@ -3569,10 +3568,8 @@ void Spell::EffectDistract(uint32 /*i*/)
|
||||
if ( unitTarget->GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
// For players just turn them
|
||||
WorldPacket data;
|
||||
((Player*)unitTarget)->BuildTeleportAckMsg(&data, unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), angle);
|
||||
((Player*)unitTarget)->GetSession()->SendPacket( &data );
|
||||
((Player*)unitTarget)->SetPosition(unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), angle, false);
|
||||
((Player*)unitTarget)->SendTeleportAckMsg();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3625,7 +3622,6 @@ void Spell::EffectAddFarsight(uint32 i)
|
||||
delete dynObj;
|
||||
return;
|
||||
}
|
||||
dynObj->SetUInt32Value(OBJECT_FIELD_TYPE, 65);
|
||||
dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x80000002);
|
||||
m_caster->AddDynObject(dynObj);
|
||||
|
||||
|
||||
+73
-12
@@ -417,6 +417,27 @@ void Unit::SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end)
|
||||
addUnitState(UNIT_STAT_MOVE);
|
||||
}
|
||||
|
||||
void Unit::SendMonsterMoveTransport(Vehicle *vehicle, bool apply)
|
||||
{
|
||||
WorldPacket data(SMSG_MONSTER_MOVE_TRANSPORT, GetPackGUID().size()+vehicle->GetPackGUID().size());
|
||||
data.append(GetPackGUID());
|
||||
data.append(vehicle->GetPackGUID());
|
||||
data << int8(GetTransSeat());
|
||||
data << uint8(0);
|
||||
data << GetPositionX() - vehicle->GetPositionX();
|
||||
data << GetPositionY() - vehicle->GetPositionY();
|
||||
data << GetPositionZ() - vehicle->GetPositionZ();
|
||||
data << uint32(getMSTime());
|
||||
data << uint8(4);
|
||||
data << GetTransOffsetO();
|
||||
data << uint32(MOVEFLAG_ENTER_TRANSPORT);
|
||||
data << uint32(0); // move time
|
||||
data << GetTransOffsetX();
|
||||
data << GetTransOffsetY();
|
||||
data << GetTransOffsetZ();
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
void Unit::resetAttackTimer(WeaponAttackType type)
|
||||
{
|
||||
m_attackTimer[type] = uint32(GetAttackTime(type) * m_modAttackSpeedPct[type]);
|
||||
@@ -14371,9 +14392,12 @@ void Unit::ExitVehicle()
|
||||
m_Vehicle->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);
|
||||
//setFaction((GetTeam() == ALLIANCE) ? GetCreatureInfo()->faction_A : GetCreatureInfo()->faction_H);
|
||||
|
||||
clearUnitState(UNIT_STAT_ONVEHICLE);
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
// This should be done before dismiss, because there may be some aura removal
|
||||
Vehicle *vehicle = m_Vehicle;
|
||||
m_Vehicle = NULL;
|
||||
|
||||
clearUnitState(UNIT_STAT_ONVEHICLE);
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_FLY_UNK1);
|
||||
m_movementInfo.t_x = 0;
|
||||
m_movementInfo.t_y = 0;
|
||||
m_movementInfo.t_z = 0;
|
||||
@@ -14382,20 +14406,16 @@ void Unit::ExitVehicle()
|
||||
m_movementInfo.t_seat = 0;
|
||||
|
||||
//Send leave vehicle
|
||||
WorldPacket data;
|
||||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
((Player*)this)->SetClientControl(this, 1);
|
||||
((Player*)this)->BuildTeleportAckMsg(&data, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
|
||||
((Player*)this)->GetSession()->SendPacket(&data);
|
||||
((Player*)this)->SendTeleportAckMsg();
|
||||
}
|
||||
|
||||
WorldPacket data;
|
||||
BuildHeartBeatMsg(&data);
|
||||
SendMessageToSet(&data, false);
|
||||
|
||||
// This should be done before dismiss, because there may be some aura removal
|
||||
Vehicle *vehicle = m_Vehicle;
|
||||
m_Vehicle = NULL;
|
||||
//SendMonsterMoveTransport(m_Vehicle, false);
|
||||
|
||||
if(vehicle->GetOwnerGUID() == GetGUID())
|
||||
vehicle->Dismiss();
|
||||
@@ -14403,15 +14423,43 @@ void Unit::ExitVehicle()
|
||||
|
||||
void Unit::BuildMovementPacket(ByteBuffer *data) const
|
||||
{
|
||||
switch(GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
if(isInFlight())
|
||||
const_cast<Unit*>(this)->AddUnitMovementFlag(MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_LEVITATING);
|
||||
break;
|
||||
case TYPEID_PLAYER:
|
||||
// remove unknown, unused etc flags for now
|
||||
const_cast<Unit*>(this)->RemoveUnitMovementFlag(MOVEMENTFLAG_SPLINE2);
|
||||
if(isInFlight())
|
||||
{
|
||||
WPAssert(const_cast<Unit*>(this)->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
|
||||
const_cast<Unit*>(this)->AddUnitMovementFlag(MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_SPLINE2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
*data << uint32(GetUnitMovementFlags()); // movement flags
|
||||
*data << uint16(m_movementInfo.unk1); // 2.3.0
|
||||
*data << uint32(getMSTime()); // time
|
||||
*data << GetPositionX();
|
||||
*data << GetPositionY();
|
||||
*data << GetPositionZ();
|
||||
*data << GetOrientation();
|
||||
|
||||
// 0x00000200
|
||||
if(GetUnitMovementFlags() & MOVEMENTFLAG_ONTRANSPORT)
|
||||
{
|
||||
if(m_Vehicle)
|
||||
*data << (uint64)m_Vehicle->GetGUID();
|
||||
data->append(m_Vehicle->GetPackGUID());
|
||||
else if(GetTransport())
|
||||
*data << (uint64)GetTransport()->GetGUID();
|
||||
data->append(GetTransport()->GetPackGUID());
|
||||
else
|
||||
*data << (uint64)0; //This will cause client crash
|
||||
{
|
||||
sLog.outError("Unit %u does not have transport!", GetEntry());
|
||||
*data << (uint8)0;
|
||||
}
|
||||
*data << float (GetTransOffsetX());
|
||||
*data << float (GetTransOffsetY());
|
||||
*data << float (GetTransOffsetZ());
|
||||
@@ -14441,6 +14489,19 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const
|
||||
*data << (float)m_movementInfo.u_unk1;
|
||||
}
|
||||
|
||||
void Unit::OutMovementInfo() const
|
||||
{
|
||||
sLog.outString("MovementInfo: Flag %u, Unk1 %u, Time %u, Pos %f %f %f %f, Fall %u", m_movementInfo.flags, (uint32)m_movementInfo.unk1, m_movementInfo.time, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), m_movementInfo.fallTime);
|
||||
if(m_movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT)
|
||||
sLog.outString("Transport: GUID " UI64FMTD ", Pos %f %f %f %f, Time %u, Seat %d", m_movementInfo.t_guid, m_movementInfo.t_x, m_movementInfo.t_y, m_movementInfo.t_z, m_movementInfo.t_o, m_movementInfo.t_time, (int32)m_movementInfo.t_seat);
|
||||
if((m_movementInfo.flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2)) || (m_movementInfo.unk1 & 0x20))
|
||||
sLog.outString("Pitch: %f", m_movementInfo.s_pitch);
|
||||
if(m_movementInfo.flags & MOVEMENTFLAG_JUMPING)
|
||||
sLog.outString("Jump: speedz %f, sin %f, cos %f, speedxy %f", m_movementInfo.j_zspeed, m_movementInfo.j_sinAngle, m_movementInfo.j_cosAngle, m_movementInfo.j_xyspeed);
|
||||
if(m_movementInfo.flags & MOVEMENTFLAG_SPLINE)
|
||||
sLog.outString("Spline: %f", m_movementInfo.u_unk1);
|
||||
}
|
||||
|
||||
void Unit::NearTeleportTo( float x, float y, float z, float orientation, bool casting /*= false*/ )
|
||||
{
|
||||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
|
||||
+8
-3
@@ -625,6 +625,7 @@ enum MoveFlags
|
||||
MOVEFLAG_WALK = 0x00001000,
|
||||
MOVEFLAG_FLY = 0x00002000,
|
||||
MOVEFLAG_GLIDE = 0x00003000, // dragon
|
||||
MOVEFLAG_ENTER_TRANSPORT = 0x00800000,
|
||||
};
|
||||
|
||||
enum MovementFlags
|
||||
@@ -647,10 +648,10 @@ enum MovementFlags
|
||||
MOVEMENTFLAG_FALLING = 0x00004000,
|
||||
// 0x8000, 0x10000, 0x20000, 0x40000, 0x80000, 0x100000
|
||||
MOVEMENTFLAG_SWIMMING = 0x00200000, // appears with fly flag also
|
||||
MOVEMENTFLAG_FLY_UP = 0x00400000,
|
||||
MOVEMENTFLAG_FLY_UP = 0x00400000, // press "space" when flying
|
||||
MOVEMENTFLAG_CAN_FLY = 0x00800000,
|
||||
MOVEMENTFLAG_FLYING = 0x01000000,
|
||||
MOVEMENTFLAG_FLYING2 = 0x02000000, // Actual flying mode
|
||||
MOVEMENTFLAG_FLYING = 0x01000000, // fly land
|
||||
MOVEMENTFLAG_FLYING2 = 0x02000000, // fly hover
|
||||
MOVEMENTFLAG_SPLINE = 0x04000000, // used for flight paths
|
||||
MOVEMENTFLAG_SPLINE2 = 0x08000000, // used for flight paths
|
||||
MOVEMENTFLAG_WATERWALKING = 0x10000000, // prevent unit from falling through water
|
||||
@@ -1311,10 +1312,14 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player = NULL);
|
||||
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL);
|
||||
void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end);
|
||||
void SendMonsterMoveTransport(Vehicle *vehicle, bool apply);
|
||||
void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL);
|
||||
void SendMonsterMoveWithSpeedToCurrentDestination(Player* player = NULL);
|
||||
void SendMovementFlagUpdate();
|
||||
|
||||
void BuildHeartBeatMsg(WorldPacket *data) const;
|
||||
void OutMovementInfo() const;
|
||||
|
||||
bool isAlive() const { return (m_deathState == ALIVE); };
|
||||
bool isDead() const { return ( m_deathState == DEAD || m_deathState == CORPSE ); };
|
||||
DeathState getDeathState() { return m_deathState; };
|
||||
|
||||
+13
-17
@@ -30,7 +30,7 @@
|
||||
Vehicle::Vehicle() : Creature(), m_vehicleInfo(NULL), m_usableSeatNum(0)
|
||||
{
|
||||
m_summonMask |= SUMMON_MASK_VEHICLE;
|
||||
m_updateFlag = (UPDATEFLAG_LIVING | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_VEHICLE);
|
||||
m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_LIVING | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_VEHICLE);
|
||||
}
|
||||
|
||||
Vehicle::~Vehicle()
|
||||
@@ -234,32 +234,28 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
|
||||
|
||||
//SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_24);
|
||||
|
||||
unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_FLY_UNK1);
|
||||
VehicleSeatEntry const *veSeat = seat->second.seatInfo;
|
||||
unit->m_movementInfo.t_x = veSeat->m_attachmentOffsetX;
|
||||
unit->m_movementInfo.t_y = veSeat->m_attachmentOffsetY;
|
||||
unit->m_movementInfo.t_z = veSeat->m_attachmentOffsetZ;
|
||||
unit->m_movementInfo.t_o = 0;
|
||||
unit->m_movementInfo.t_time = 4;
|
||||
unit->m_movementInfo.t_time = 0; // 1 for player
|
||||
unit->m_movementInfo.t_seat = seat->first;
|
||||
|
||||
unit->Relocate(GetPositionX() + unit->m_movementInfo.t_x,
|
||||
GetPositionY() + unit->m_movementInfo.t_y,
|
||||
GetPositionZ() + unit->m_movementInfo.t_z,
|
||||
GetOrientation());
|
||||
if(unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.seatInfo->IsUsable()) // not right
|
||||
SetCharmedBy(unit, CHARM_TYPE_VEHICLE);
|
||||
|
||||
WorldPacket data;
|
||||
if(unit->GetTypeId() == TYPEID_PLAYER)
|
||||
if(false)
|
||||
{
|
||||
if(seat->first == 0 && seat->second.seatInfo->IsUsable()) // not right
|
||||
SetCharmedBy(unit, CHARM_TYPE_VEHICLE);
|
||||
|
||||
((Player*)unit)->BuildTeleportAckMsg(&data, unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetOrientation());
|
||||
((Player*)unit)->GetSession()->SendPacket(&data);
|
||||
unit->SendMonsterMoveTransport(this, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(unit->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)unit)->SendTeleportAckMsg();
|
||||
unit->SendMovementFlagUpdate();
|
||||
}
|
||||
|
||||
unit->BuildHeartBeatMsg(&data);
|
||||
unit->SendMessageToSet(&data, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -679,19 +679,6 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo *mi)
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::OutMovementInfo(MovementInfo *mi)
|
||||
{
|
||||
sLog.outString("MovementInfo: Flag %u, Unk1 %u, Time %u, Pos %f %f %f %f, Fall %u", mi->flags, (uint32)mi->unk1, mi->time, mi->x, mi->y, mi->z, mi->o, mi->fallTime);
|
||||
if(mi->flags & MOVEMENTFLAG_ONTRANSPORT)
|
||||
sLog.outString("Transport: GUID " I64FMT ", Pos %f %f %f %f, Time %u, Seat %d", mi->t_guid, mi->t_x, mi->t_y, mi->t_z, mi->t_o, mi->t_time, (int32)mi->t_seat);
|
||||
if((mi->flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING2)) || (mi->unk1 & 0x20))
|
||||
sLog.outString("Pitch: %f", mi->s_pitch);
|
||||
if(mi->flags & MOVEMENTFLAG_JUMPING)
|
||||
sLog.outString("Jump: speedz %f, sin %f, cos %f, speedxy %f", mi->j_zspeed, mi->j_sinAngle, mi->j_cosAngle, mi->j_xyspeed);
|
||||
if(mi->flags & MOVEMENTFLAG_SPLINE)
|
||||
sLog.outString("Spline: %f", mi->u_unk1);
|
||||
}
|
||||
|
||||
void WorldSession::ReadAddonsInfo(WorldPacket &data)
|
||||
{
|
||||
if (data.rpos() + 4 > data.size())
|
||||
|
||||
@@ -112,7 +112,6 @@ class TRINITY_DLL_SPEC WorldSession
|
||||
void SendAddonsInfo();
|
||||
|
||||
void ReadMovementInfo(WorldPacket &data, MovementInfo *mi);
|
||||
void OutMovementInfo(MovementInfo *mi);
|
||||
|
||||
void SendPacket(WorldPacket const* packet);
|
||||
void SendNotification(const char *format,...) ATTR_PRINTF(2,3);
|
||||
|
||||
@@ -67,6 +67,7 @@ enum LoginResult
|
||||
};
|
||||
|
||||
// we need to stick to 1 version or half of the stuff will work for someone
|
||||
// others will not and opposite
|
||||
// will only support WoW, WoW:TBC and WoW:WotLK 3.1.3 client build 9947...
|
||||
|
||||
#define EXPECTED_TRINITY_CLIENT_BUILD {9947, 0}
|
||||
|
||||
@@ -21,19 +21,17 @@
|
||||
/** \file
|
||||
\ingroup realmd
|
||||
*/
|
||||
#include <openssl/md5.h>
|
||||
|
||||
#include "Common.h"
|
||||
#include "Auth/Sha1.h"
|
||||
#include "Config/ConfigEnv.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
|
||||
#include "AuthCodes.h"
|
||||
#include "AuthSocket.h"
|
||||
#include "ByteBuffer.h"
|
||||
#include "Config/ConfigEnv.h"
|
||||
#include "Log.h"
|
||||
#include "RealmList.h"
|
||||
|
||||
#include "AuthSocket.h"
|
||||
#include "AuthCodes.h"
|
||||
#include <openssl/md5.h>
|
||||
#include "Auth/Sha1.h"
|
||||
//#include "Util.h" -- for commented utf8ToUpperOnlyLatin
|
||||
|
||||
extern RealmList m_realmList;
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef _AUTHSOCKET_H
|
||||
#define _AUTHSOCKET_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "Auth/BigNumber.h"
|
||||
#include "sockets/TcpSocket.h"
|
||||
#include "sockets/SocketHandler.h"
|
||||
#include "sockets/ListenSocket.h"
|
||||
@@ -32,9 +34,6 @@
|
||||
#include "sockets/Parse.h"
|
||||
#include "sockets/Socket.h"
|
||||
|
||||
#include "Common.h"
|
||||
#include "Auth/BigNumber.h"
|
||||
|
||||
/// Handle login commands
|
||||
class AuthSocket: public TcpSocket
|
||||
{
|
||||
|
||||
+12
-13
@@ -22,19 +22,18 @@
|
||||
/// @{
|
||||
/// \file
|
||||
|
||||
#include <openssl/opensslv.h>
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
#include "Common.h"
|
||||
#include "Config/ConfigEnv.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "sockets/ListenSocket.h"
|
||||
|
||||
#include "AuthSocket.h"
|
||||
#include "Log.h"
|
||||
#include "RealmList.h"
|
||||
|
||||
#include "Config/ConfigEnv.h"
|
||||
#include "Log.h"
|
||||
#include "sockets/ListenSocket.h"
|
||||
#include "AuthSocket.h"
|
||||
#include "SystemConfig.h"
|
||||
#include "Util.h"
|
||||
#include <openssl/opensslv.h>
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
// Format is YYYYMMDDRR where RR is the change in the conf file
|
||||
// for that day.
|
||||
@@ -149,6 +148,9 @@ extern int main(int argc, char **argv)
|
||||
sLog.outError("Could not find configuration file %s.", cfg_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
sLog.outString( "%s (realm-daemon)", _FULLVERSION );
|
||||
sLog.outString( "<Ctrl-C> to stop.\n" );
|
||||
sLog.outString("Using configuration file %s.", cfg_file);
|
||||
|
||||
///- Check the version of the configuration file
|
||||
@@ -172,9 +174,6 @@ extern int main(int argc, char **argv)
|
||||
sLog.outDetail("WARNING: Minimal required version [OpenSSL 0.9.8k]");
|
||||
}
|
||||
|
||||
sLog.outString( "%s (realm-daemon)", _FULLVERSION );
|
||||
sLog.outString( "<Ctrl-C> to stop.\n" );
|
||||
|
||||
/// realmd PID file creation
|
||||
std::string pidfile = sConfig.GetStringDefault("PidFile", "");
|
||||
if(!pidfile.empty())
|
||||
@@ -261,7 +260,7 @@ extern int main(int argc, char **argv)
|
||||
sLog.outError("Can't set used processors (hex): %x", curAff);
|
||||
}
|
||||
}
|
||||
sLog.outString("");
|
||||
sLog.outString();
|
||||
}
|
||||
|
||||
bool Prio = sConfig.GetBoolDefault("ProcessPriority", false);
|
||||
@@ -272,7 +271,7 @@ extern int main(int argc, char **argv)
|
||||
sLog.outString("TrinityRealm process priority class set to HIGH");
|
||||
else
|
||||
sLog.outError("ERROR: Can't set realmd process priority class.");
|
||||
sLog.outString("");
|
||||
sLog.outString();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -23,10 +23,9 @@
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
#include "Policies/SingletonImp.h"
|
||||
|
||||
#include "RealmList.h"
|
||||
#include "Policies/SingletonImp.h"
|
||||
#include "Database/DatabaseEnv.h"
|
||||
|
||||
INSTANTIATE_SINGLETON_1( RealmList );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user