* Update structure for SMSG_ADDON_INFO and add some sort of basic handling for incorrect addon CRCs (anti-cheating).

* Fix CRLF in MovementHandler.cpp.
* Move some handlers/senders to correct place.

--HG--
branch : trunk
This commit is contained in:
XTZGZoReX
2010-01-15 19:50:27 +01:00
parent 0451e45e06
commit 26e11448dd
5 changed files with 92 additions and 83 deletions

View File

@@ -608,17 +608,49 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data)
int8 seatId;
recv_data >> seatId;
if(!accessory)
GetPlayer()->ChangeSeat(-1, seatId > 0); // prev/next
else if(Unit *vehUnit = ObjectAccessor::GetUnit(*GetPlayer(), accessory))
if(Vehicle *vehicle = vehUnit->GetVehicleKit())
if(vehicle->HasEmptySeat(seatId))
if(!accessory)
GetPlayer()->ChangeSeat(-1, seatId > 0); // prev/next
else if(Unit *vehUnit = ObjectAccessor::GetUnit(*GetPlayer(), accessory))
if(Vehicle *vehicle = vehUnit->GetVehicleKit())
if(vehicle->HasEmptySeat(seatId))
GetPlayer()->EnterVehicle(vehicle, seatId);
}
break;
}
}
void WorldSession::HandleEnterPlayerVehicle(WorldPacket &data)
{
// Read guid
uint64 guid;
data >> guid;
if(Player* pl=ObjectAccessor::FindPlayer(guid))
{
if (!pl->GetVehicleKit())
return;
if (!pl->IsInRaidWith(_player))
return;
if(!pl->IsWithinDistInMap(_player,INTERACTION_DISTANCE))
return;
_player->EnterVehicle(pl);
}
}
void WorldSession::HandleEjectPasenger(WorldPacket &data)
{
if(data.GetOpcode()==CMSG_EJECT_PASSENGER)
{
if(Vehicle* Vv= _player->GetVehicleKit())
{
uint64 guid;
data >> guid;
if(Player* Pl=ObjectAccessor::FindPlayer(guid))
Pl->ExitVehicle();
}
}
}
void WorldSession::HandleRequestVehicleExit(WorldPacket &recv_data)
{
sLog.outDebug("WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT");