Update member names

This commit is contained in:
Resaec 2025-12-22 01:22:15 +01:00
parent 607fb82254
commit 07af940817
4 changed files with 59 additions and 40 deletions

View file

@ -58,7 +58,9 @@ object BindStatus extends Enumeration(1) {
* @param zone_number the number of the zone in which to display this spawn option; * @param zone_number the number of the zone in which to display this spawn option;
* if `zone_number` is not the current zone, and the action is positive, * if `zone_number` is not the current zone, and the action is positive,
* a small map of the alternate zone with selectable spawn point will become visible * a small map of the alternate zone with selectable spawn point will become visible
* @param unk4 na * @param map_id the "MapID" of the facility the player is bound to;
* if spawn_group is AMS it is likely the source facility of the AMS;
* with spawn_group AMS pos does point to the AMS position;
* @param pos coordinates for any displayed deployment map icon; * @param pos coordinates for any displayed deployment map icon;
* `x` and `y` determine the position * `x` and `y` determine the position
*/ */
@ -69,7 +71,7 @@ final case class BindPlayerMessage(
logging: Boolean, logging: Boolean,
spawn_group: SpawnGroup, spawn_group: SpawnGroup,
zone_number: Long, zone_number: Long,
unk4: Long, map_id: Long,
pos: Vector3 pos: Vector3
) extends PlanetSideGamePacket { ) extends PlanetSideGamePacket {
type Packet = BindPlayerMessage type Packet = BindPlayerMessage

View file

@ -7,8 +7,8 @@ import scodec.Codec
import scodec.codecs._ import scodec.codecs._
final case class SquadBindInfoMessage( final case class SquadBindInfoMessage(
unk0: Int, // squad? unk0: Int, // squad/platoon index?
elements: Vector[SquadBindEntry], elements: Vector[SquadBindEntry],
) extends PlanetSideGamePacket { ) extends PlanetSideGamePacket {
type Packet = SquadBindInfoMessage type Packet = SquadBindInfoMessage
def opcode = GamePacketOpcode.SquadBindInfoMessage def opcode = GamePacketOpcode.SquadBindInfoMessage
@ -17,19 +17,28 @@ final case class SquadBindInfoMessage(
object SquadBindInfoMessage extends Marshallable[SquadBindInfoMessage] { object SquadBindInfoMessage extends Marshallable[SquadBindInfoMessage] {
/**
* SquadBindEntry
*
* If isBound is false unk1 and unk2 are 0.
* unk1
* @param squadMember index of squad member
* @param zoneID zone ID as in zX / mapX
* @param mapID MapID identifier in mapX.json
* @param isBound is bound to a facility
*/
final case class SquadBindEntry( final case class SquadBindEntry(
unk0: Long, squadMember: Long,
unk1: Long, zoneID: Long,
unk2: Int, mapID: Int,
unk3: Boolean, isBound: Boolean,
) )
private implicit val squadBindEntryCodec: Codec[SquadBindEntry] = ( private implicit val squadBindEntryCodec: Codec[SquadBindEntry] = (
("unk0" | uint32L) :: ("squadMember" | uint32L) ::
("unk1" | uint32L) :: ("zoneID" | uint32L) ::
("unk2" | uint16L) :: ("mapID" | uint16L) ::
("unk3" | bool) ("isBound" | bool)
).as[SquadBindEntry] ).as[SquadBindEntry]
implicit val codec: Codec[SquadBindInfoMessage] = ( implicit val codec: Codec[SquadBindInfoMessage] = (

View file

@ -5,11 +5,19 @@ import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacke
import scodec.Codec import scodec.Codec
import scodec.codecs._ import scodec.codecs._
/**
* SquadFacilityBindInfoMessage
* @param unk0
* @param squadID ID of the squad this message is relating to
* @param mapID MapID of the facility the player is bound to;
* alternatively of the facility the AMS was pulled from?;
* @param zoneID ZoneID of where the bind is from and the MapID relates to
*/
final case class SquadFacilityBindInfoMessage( final case class SquadFacilityBindInfoMessage(
unk0: Boolean, unk0: Boolean,
unk1: Long, squadID: Long,
unk2: Long, mapID: Long,
unk3: Long zoneID: Long
) extends PlanetSideGamePacket { ) extends PlanetSideGamePacket {
type Packet = EmpireBenefitsMessage type Packet = EmpireBenefitsMessage
def opcode = GamePacketOpcode.SquadFacilityBindInfoMessage def opcode = GamePacketOpcode.SquadFacilityBindInfoMessage
@ -20,8 +28,8 @@ object SquadFacilityBindInfoMessage extends Marshallable[SquadFacilityBindInfoMe
implicit val codec: Codec[SquadFacilityBindInfoMessage] = ( implicit val codec: Codec[SquadFacilityBindInfoMessage] = (
("unk0" | bool) :: ("unk0" | bool) ::
("unk1" | uint32L) :: ("squadID" | uint32L) ::
("unk2" | uint32L) :: ("mapID" | uint32L) ::
("unk3" | uint32L) ("zoneID" | uint32L)
).as[SquadFacilityBindInfoMessage] ).as[SquadFacilityBindInfoMessage]
} }

View file

@ -14,11 +14,11 @@ class SquadFacilityBindInfoMessageTest extends Specification {
"decode sample1" in { "decode sample1" in {
PacketCoding.decodePacket(sample1).require match { PacketCoding.decodePacket(sample1).require match {
case SquadFacilityBindInfoMessage(unk0, unk1, unk2, unk3) => case SquadFacilityBindInfoMessage(unk0, squadID, mapID, zoneID) =>
unk0 mustEqual false unk0 mustEqual false
unk1 mustEqual 7 squadID mustEqual 7
unk2 mustEqual 0 mapID mustEqual 0
unk3 mustEqual 0 zoneID mustEqual 0
case _ => case _ =>
ko ko
} }
@ -27,9 +27,9 @@ class SquadFacilityBindInfoMessageTest extends Specification {
"encode sample1" in { "encode sample1" in {
val msg = SquadFacilityBindInfoMessage( val msg = SquadFacilityBindInfoMessage(
unk0 = false, unk0 = false,
unk1 = 7, squadID = 7,
unk2 = 0, mapID = 0,
unk3 = 0 zoneID = 0
) )
val pkt = PacketCoding.encodePacket(msg).require.toByteVector val pkt = PacketCoding.encodePacket(msg).require.toByteVector
@ -38,11 +38,11 @@ class SquadFacilityBindInfoMessageTest extends Specification {
"decode sample2" in { "decode sample2" in {
PacketCoding.decodePacket(sample2).require match { PacketCoding.decodePacket(sample2).require match {
case SquadFacilityBindInfoMessage(unk0, unk1, unk2, unk3) => case SquadFacilityBindInfoMessage(unk0, squadID, mapID, zoneID) =>
unk0 mustEqual false unk0 mustEqual false
unk1 mustEqual 4 squadID mustEqual 4
unk2 mustEqual 16 mapID mustEqual 16
unk3 mustEqual 7 zoneID mustEqual 7
case _ => case _ =>
ko ko
} }
@ -51,9 +51,9 @@ class SquadFacilityBindInfoMessageTest extends Specification {
"encode sample2" in { "encode sample2" in {
val msg = SquadFacilityBindInfoMessage( val msg = SquadFacilityBindInfoMessage(
unk0 = false, unk0 = false,
unk1 = 4, squadID = 4,
unk2 = 16, mapID = 16,
unk3 = 7 zoneID = 7
) )
val pkt = PacketCoding.encodePacket(msg).require.toByteVector val pkt = PacketCoding.encodePacket(msg).require.toByteVector
@ -62,11 +62,11 @@ class SquadFacilityBindInfoMessageTest extends Specification {
"decode sample3" in { "decode sample3" in {
PacketCoding.decodePacket(sample3).require match { PacketCoding.decodePacket(sample3).require match {
case SquadFacilityBindInfoMessage(unk0, unk1, unk2, unk3) => case SquadFacilityBindInfoMessage(unk0, squadID, mapID, zoneID) =>
unk0 mustEqual false unk0 mustEqual false
unk1 mustEqual 3 squadID mustEqual 3
unk2 mustEqual 9 mapID mustEqual 9
unk3 mustEqual 5 zoneID mustEqual 5
case _ => case _ =>
ko ko
} }
@ -75,9 +75,9 @@ class SquadFacilityBindInfoMessageTest extends Specification {
"encode sample3" in { "encode sample3" in {
val msg = SquadFacilityBindInfoMessage( val msg = SquadFacilityBindInfoMessage(
unk0 = false, unk0 = false,
unk1 = 3, squadID = 3,
unk2 = 9, mapID = 9,
unk3 = 5 zoneID = 5
) )
val pkt = PacketCoding.encodePacket(msg).require.toByteVector val pkt = PacketCoding.encodePacket(msg).require.toByteVector