From 749d2d2c50b6ab4c80d7f095567612f017ca564f Mon Sep 17 00:00:00 2001 From: FateJH Date: Thu, 20 Apr 2017 08:37:51 -0400 Subject: [PATCH] fleshed out field details of COSM --- .../packet/game/ChildObjectStateMessage.scala | 24 ++++++++++++++----- .../src/main/scala/WorldSessionActor.scala | 3 +++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/common/src/main/scala/net/psforever/packet/game/ChildObjectStateMessage.scala b/common/src/main/scala/net/psforever/packet/game/ChildObjectStateMessage.scala index efbb27cd2..34e964c7c 100644 --- a/common/src/main/scala/net/psforever/packet/game/ChildObjectStateMessage.scala +++ b/common/src/main/scala/net/psforever/packet/game/ChildObjectStateMessage.scala @@ -5,9 +5,21 @@ import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacke import scodec.Codec import scodec.codecs._ -final case class ChildObjectStateMessage(unk1 : Int, - unk2 : Int, - unk3 : Int) +/** + * na + * @param object_guid the object being manipulated (controlled) + * @param pitch the angle with respect to the sky and the ground towards which the object is directed; + * an 8-bit unsigned value; + * 0 is perfectly level and forward-facing, wrapping around at 255; + * positive rotation is occurs by rotating downwards from forward-facing + * @param yaw the angle with respect to the horizon towards which the object is directed; + * an 8-bit unsigned value; + * 0 is forward-facing, wrapping around at 255; + * positive rotation is clockwise of forward-facing + */ +final case class ChildObjectStateMessage(object_guid : PlanetSideGUID, + pitch : Int, + yaw : Int) extends PlanetSideGamePacket { type Packet = ChildObjectStateMessage def opcode = GamePacketOpcode.ChildObjectStateMessage @@ -16,8 +28,8 @@ final case class ChildObjectStateMessage(unk1 : Int, object ChildObjectStateMessage extends Marshallable[ChildObjectStateMessage] { implicit val codec : Codec[ChildObjectStateMessage] = ( - ("unk1" | uint16L) :: - ("unk2" | uint8L) :: - ("unk3" | uint8L) + ("object_guid" | PlanetSideGUID.codec) :: + ("pitch" | uint8L) :: + ("yaw" | uint8L) ).as[ChildObjectStateMessage] } diff --git a/pslogin/src/main/scala/WorldSessionActor.scala b/pslogin/src/main/scala/WorldSessionActor.scala index 5dc6479e8..9ba1b9a8d 100644 --- a/pslogin/src/main/scala/WorldSessionActor.scala +++ b/pslogin/src/main/scala/WorldSessionActor.scala @@ -238,6 +238,9 @@ class WorldSessionActor extends Actor with MDCContextAware { case msg @ PlayerStateMessageUpstream(avatar_guid, pos, vel, unk1, aim_pitch, unk2, seq_time, unk3, is_crouching, is_jumping, unk4, is_cloaking, unk5, unk6) => //log.info("PlayerState: " + msg) + case msg @ ChildObjectStateMessage(object_guid : PlanetSideGUID, pitch : Int, yaw : Int) => + //log.info("ChildObjectState: " + msg) + case msg @ ChatMsg(messagetype, has_wide_contents, recipient, contents, note_contents) => // TODO: Prevents log spam, but should be handled correctly if (messagetype != ChatMessageType.CMT_TOGGLE_GM) {