fleshed out field details of COSM

This commit is contained in:
FateJH 2017-04-20 08:37:51 -04:00
parent 49880ce476
commit 749d2d2c50
2 changed files with 21 additions and 6 deletions

View file

@ -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]
}

View file

@ -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) {