mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-29 07:45:26 +00:00
Add CargoMountPointStatusMessage / DismountVehicleCargoMsg / MountVehicleCargomsg packets
This commit is contained in:
parent
fdf05337fd
commit
5347b78e7c
5 changed files with 127 additions and 3 deletions
|
|
@ -395,9 +395,9 @@ object GamePacketOpcode extends Enumeration {
|
||||||
case 0x3f => game.ProjectileStateMessage.decode
|
case 0x3f => game.ProjectileStateMessage.decode
|
||||||
|
|
||||||
// OPCODES 0x40-4f
|
// OPCODES 0x40-4f
|
||||||
case 0x40 => noDecoder(MountVehicleCargoMsg)
|
case 0x40 => game.MountVehicleCargoMsg.decode
|
||||||
case 0x41 => noDecoder(DismountVehicleCargoMsg)
|
case 0x41 => game.DismountVehicleCargoMsg.decode
|
||||||
case 0x42 => noDecoder(CargoMountPointStatusMessage)
|
case 0x42 => game.CargoMountPointStatusMessage.decode
|
||||||
case 0x43 => game.BeginZoningMessage.decode
|
case 0x43 => game.BeginZoningMessage.decode
|
||||||
case 0x44 => game.ItemTransactionMessage.decode
|
case 0x44 => game.ItemTransactionMessage.decode
|
||||||
case 0x45 => game.ItemTransactionResultMessage.decode
|
case 0x45 => game.ItemTransactionResultMessage.decode
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
// Copyright (c) 2017 PSForever
|
||||||
|
package net.psforever.packet.game
|
||||||
|
|
||||||
|
import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacket}
|
||||||
|
import net.psforever.types.CargoStatus
|
||||||
|
import scodec.Codec
|
||||||
|
import scodec.codecs._
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param cargo_vehicle_guid Cargo vehicle GUID (galaxy / lodestar)
|
||||||
|
* @param requesting_vehicle Seems to be vehicle that requested mounting (0 after mount)
|
||||||
|
* @param mounted_vehicle Seems to be vehicle that requested mounting after mount (0 before mount)
|
||||||
|
* @param dismounted_vehicle Seems to be vehicle that was mounted after disembarking (0 before embark or reset to 0 when MountVehicleCargoMsg received)
|
||||||
|
* @param slot Mount point for cargo bay 1 = lodestar, 15 = galaxy
|
||||||
|
* @param mount_status Mount status? 0 = None, 1 = Mount/Dismount in progress, 3 = Mounted
|
||||||
|
* @param orientation 0 = normal, 1 = sideways (e.g. router in lodestar)
|
||||||
|
*/
|
||||||
|
final case class CargoMountPointStatusMessage(cargo_vehicle_guid : PlanetSideGUID,
|
||||||
|
requesting_vehicle: PlanetSideGUID,
|
||||||
|
mounted_vehicle: PlanetSideGUID,
|
||||||
|
dismounted_vehicle: PlanetSideGUID,
|
||||||
|
slot: Int,
|
||||||
|
mount_status: CargoStatus.Value,
|
||||||
|
orientation: Int)
|
||||||
|
extends PlanetSideGamePacket {
|
||||||
|
type Packet = CargoMountPointStatusMessage
|
||||||
|
|
||||||
|
def opcode = GamePacketOpcode.CargoMountPointStatusMessage
|
||||||
|
|
||||||
|
def encode = CargoMountPointStatusMessage.encode(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
object CargoMountPointStatusMessage extends Marshallable[CargoMountPointStatusMessage] {
|
||||||
|
implicit val codec : Codec[CargoMountPointStatusMessage] = (
|
||||||
|
("cargo_vehicle_guid" | PlanetSideGUID.codec) ::
|
||||||
|
("requesting_vehicle" | PlanetSideGUID.codec) ::
|
||||||
|
("mounted_vehicle" | PlanetSideGUID.codec) ::
|
||||||
|
("dismounted_vehicle" | PlanetSideGUID.codec) ::
|
||||||
|
("slot" | uint8L) ::
|
||||||
|
("mount_status" | CargoStatus.codec) ::
|
||||||
|
("orientation" | uint2L)
|
||||||
|
).as[CargoMountPointStatusMessage]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
// Copyright (c) 2017 PSForever
|
||||||
|
package net.psforever.packet.game
|
||||||
|
|
||||||
|
import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacket}
|
||||||
|
import scodec.Codec
|
||||||
|
import scodec.codecs._
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Note: For some reason this packet does not include the GUID of the vehicle that is being dismounted from. As a workaround vehicle.MountedIn in manually set/removed
|
||||||
|
* @param player_guid // GUID of the player that is rqeuesting dismount
|
||||||
|
* @param vehicle_guid GUID of the vehicle that is requesting dismount
|
||||||
|
* @param bailed If the vehicle bailed out of the cargo vehicle
|
||||||
|
* @param requestedByPassenger If a passenger of the vehicle in the cargo bay requests dismount this bit will be set
|
||||||
|
* @param kicked If the vehicle was kicked by the cargo vehicle pilot
|
||||||
|
*/
|
||||||
|
final case class DismountVehicleCargoMsg(player_guid : PlanetSideGUID, vehicle_guid: PlanetSideGUID, bailed: Boolean, requestedByPassenger: Boolean, kicked: Boolean)
|
||||||
|
extends PlanetSideGamePacket {
|
||||||
|
type Packet = DismountVehicleCargoMsg
|
||||||
|
|
||||||
|
def opcode = GamePacketOpcode.DismountVehicleCargoMsg
|
||||||
|
|
||||||
|
def encode = DismountVehicleCargoMsg.encode(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
object DismountVehicleCargoMsg extends Marshallable[DismountVehicleCargoMsg] {
|
||||||
|
implicit val codec : Codec[DismountVehicleCargoMsg] = (
|
||||||
|
("player_guid" | PlanetSideGUID.codec) ::
|
||||||
|
("vehicle_guid" | PlanetSideGUID.codec) ::
|
||||||
|
("unk3" | bool) :: // bailed?
|
||||||
|
("unk4" | bool) ::
|
||||||
|
("unk5" | bool)
|
||||||
|
).as[DismountVehicleCargoMsg]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
// Copyright (c) 2017 PSForever
|
||||||
|
package net.psforever.packet.game
|
||||||
|
|
||||||
|
import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacket}
|
||||||
|
import scodec.Codec
|
||||||
|
import scodec.codecs._
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param player_guid The guid of the player sending the request to board another vehicle with a cargo vehicle
|
||||||
|
* @param vehicle_guid The guid of the vehicle for the requesting player
|
||||||
|
* @param target_vehicle The cargo vehicle guid e.g. Galaxy / Lodestar
|
||||||
|
* @param unk4
|
||||||
|
*/
|
||||||
|
final case class MountVehicleCargoMsg(player_guid : PlanetSideGUID, vehicle_guid: PlanetSideGUID, target_vehicle: PlanetSideGUID, unk4: Int)
|
||||||
|
extends PlanetSideGamePacket {
|
||||||
|
type Packet = MountVehicleCargoMsg
|
||||||
|
|
||||||
|
def opcode = GamePacketOpcode.MountVehicleCargoMsg
|
||||||
|
|
||||||
|
def encode = MountVehicleCargoMsg.encode(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
object MountVehicleCargoMsg extends Marshallable[MountVehicleCargoMsg] {
|
||||||
|
implicit val codec : Codec[MountVehicleCargoMsg] = (
|
||||||
|
("unk1" | PlanetSideGUID.codec) ::
|
||||||
|
("unk2" | PlanetSideGUID.codec)::
|
||||||
|
("unk3" | PlanetSideGUID.codec) ::
|
||||||
|
("unk4" | uint8L)
|
||||||
|
).as[MountVehicleCargoMsg]
|
||||||
|
}
|
||||||
15
common/src/main/scala/net/psforever/types/CargoStatus.scala
Normal file
15
common/src/main/scala/net/psforever/types/CargoStatus.scala
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright (c) 2017 PSForever
|
||||||
|
package net.psforever.types
|
||||||
|
|
||||||
|
import net.psforever.packet.PacketHelpers
|
||||||
|
import scodec.codecs._
|
||||||
|
|
||||||
|
object CargoStatus extends Enumeration {
|
||||||
|
type Type = Value
|
||||||
|
|
||||||
|
val Empty = Value(0)
|
||||||
|
val InProgress = Value(1)
|
||||||
|
val Occupied = Value(3)
|
||||||
|
|
||||||
|
implicit val codec = PacketHelpers.createEnumerationCodec(this, uint4L)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue