mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-15 08:24:39 +00:00
identified a field for PlayerStateMessageUpstream; modified file and tests; comments
This commit is contained in:
parent
daa22c572e
commit
dfe449354a
2 changed files with 30 additions and 14 deletions
|
|
@ -6,10 +6,26 @@ import net.psforever.types.Vector3
|
||||||
import scodec.Codec
|
import scodec.Codec
|
||||||
import scodec.codecs._
|
import scodec.codecs._
|
||||||
|
|
||||||
/** PlayerStateMessageUpstream is constantly sent from the client to the server to update avatar properties.
|
/**
|
||||||
*
|
* Constantly sent from the client to the server to update player avatar properties.<br>
|
||||||
* Note: seq_time appears to be used in other message definitions as well. It
|
* <br>
|
||||||
* seems to represent a timestamp for ordering of e.g. player and weapon events.
|
* Exploration:<br>
|
||||||
|
* `seq_time` appears to be used in other message definitions as well.
|
||||||
|
* It seems to represent a timestamp for ordering, e.g., player and weapon events.
|
||||||
|
* @param avatar_guid the player's GUID
|
||||||
|
* @param pos where the player is in the world
|
||||||
|
* @param vel how the player is moving
|
||||||
|
* @param unk1 na
|
||||||
|
* @param aim_pitch the vertical angle of viewing
|
||||||
|
* @param unk2 na
|
||||||
|
* @param seq_time na
|
||||||
|
* @param unk3 na
|
||||||
|
* @param is_crouching whether the player is crouched
|
||||||
|
* @param unk4 na
|
||||||
|
* @param unk5 na
|
||||||
|
* @param is_cloaking whether the player is cloaked (Infiltration Suit)
|
||||||
|
* @param unk6 na
|
||||||
|
* @param unk7 na
|
||||||
*/
|
*/
|
||||||
final case class PlayerStateMessageUpstream(avatar_guid : PlanetSideGUID,
|
final case class PlayerStateMessageUpstream(avatar_guid : PlanetSideGUID,
|
||||||
pos : Vector3,
|
pos : Vector3,
|
||||||
|
|
@ -22,9 +38,9 @@ final case class PlayerStateMessageUpstream(avatar_guid : PlanetSideGUID,
|
||||||
is_crouching : Boolean,
|
is_crouching : Boolean,
|
||||||
unk4 : Boolean,
|
unk4 : Boolean,
|
||||||
unk5 : Boolean,
|
unk5 : Boolean,
|
||||||
unk6 : Boolean,
|
is_cloaking : Boolean,
|
||||||
unk7 : Int,
|
unk6 : Int,
|
||||||
unk8 : Int)
|
unk7 : Int)
|
||||||
extends PlanetSideGamePacket {
|
extends PlanetSideGamePacket {
|
||||||
type Packet = PlayerStateMessageUpstream
|
type Packet = PlayerStateMessageUpstream
|
||||||
def opcode = GamePacketOpcode.PlayerStateMessageUpstream
|
def opcode = GamePacketOpcode.PlayerStateMessageUpstream
|
||||||
|
|
@ -44,8 +60,8 @@ object PlayerStateMessageUpstream extends Marshallable[PlayerStateMessageUpstrea
|
||||||
("is_crouching" | bool) ::
|
("is_crouching" | bool) ::
|
||||||
("unk4" | bool) ::
|
("unk4" | bool) ::
|
||||||
("unk5" | bool) ::
|
("unk5" | bool) ::
|
||||||
("unk6" | bool) ::
|
("is_cloaking" | bool) ::
|
||||||
("unk7" | uint8L) ::
|
("unk6" | uint8L) ::
|
||||||
("unk8" | uint16L)
|
("unk7" | uint16L)
|
||||||
).as[PlayerStateMessageUpstream]
|
).as[PlayerStateMessageUpstream]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -499,7 +499,7 @@ class GamePacketTest extends Specification {
|
||||||
|
|
||||||
"decode" in {
|
"decode" in {
|
||||||
PacketCoding.DecodePacket(string).require match {
|
PacketCoding.DecodePacket(string).require match {
|
||||||
case PlayerStateMessageUpstream(avatar_guid, pos, vel, unk1, aim_pitch, unk2, seq_time, unk3, is_crouching, unk4, unk5, unk6, unk7, unk8) =>
|
case PlayerStateMessageUpstream(avatar_guid, pos, vel, unk1, aim_pitch, unk2, seq_time, unk3, is_crouching, unk4, unk5, is_cloaking, unk6, unk7) =>
|
||||||
avatar_guid mustEqual PlanetSideGUID(75)
|
avatar_guid mustEqual PlanetSideGUID(75)
|
||||||
pos mustEqual Vector3(3694.1094f, 2735.4531f, 90.84375f)
|
pos mustEqual Vector3(3694.1094f, 2735.4531f, 90.84375f)
|
||||||
vel mustEqual Some(Vector3(4.375f, 2.59375f, 0.0f))
|
vel mustEqual Some(Vector3(4.375f, 2.59375f, 0.0f))
|
||||||
|
|
@ -511,9 +511,9 @@ class GamePacketTest extends Specification {
|
||||||
is_crouching mustEqual false
|
is_crouching mustEqual false
|
||||||
unk4 mustEqual false
|
unk4 mustEqual false
|
||||||
unk5 mustEqual false
|
unk5 mustEqual false
|
||||||
unk6 mustEqual false
|
is_cloaking mustEqual false
|
||||||
unk7 mustEqual 112
|
unk6 mustEqual 112
|
||||||
unk8 mustEqual 0
|
unk7 mustEqual 0
|
||||||
case default =>
|
case default =>
|
||||||
ko
|
ko
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue