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;
* 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
* @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;
* `x` and `y` determine the position
*/
@ -69,7 +71,7 @@ final case class BindPlayerMessage(
logging: Boolean,
spawn_group: SpawnGroup,
zone_number: Long,
unk4: Long,
map_id: Long,
pos: Vector3
) extends PlanetSideGamePacket {
type Packet = BindPlayerMessage

View file

@ -7,8 +7,8 @@ import scodec.Codec
import scodec.codecs._
final case class SquadBindInfoMessage(
unk0: Int, // squad?
elements: Vector[SquadBindEntry],
unk0: Int, // squad/platoon index?
elements: Vector[SquadBindEntry],
) extends PlanetSideGamePacket {
type Packet = SquadBindInfoMessage
def opcode = GamePacketOpcode.SquadBindInfoMessage
@ -17,19 +17,28 @@ final case class 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(
unk0: Long,
unk1: Long,
unk2: Int,
unk3: Boolean,
squadMember: Long,
zoneID: Long,
mapID: Int,
isBound: Boolean,
)
private implicit val squadBindEntryCodec: Codec[SquadBindEntry] = (
("unk0" | uint32L) ::
("unk1" | uint32L) ::
("unk2" | uint16L) ::
("unk3" | bool)
("squadMember" | uint32L) ::
("zoneID" | uint32L) ::
("mapID" | uint16L) ::
("isBound" | bool)
).as[SquadBindEntry]
implicit val codec: Codec[SquadBindInfoMessage] = (

View file

@ -5,11 +5,19 @@ import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacke
import scodec.Codec
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(
unk0: Boolean,
unk1: Long,
unk2: Long,
unk3: Long
squadID: Long,
mapID: Long,
zoneID: Long
) extends PlanetSideGamePacket {
type Packet = EmpireBenefitsMessage
def opcode = GamePacketOpcode.SquadFacilityBindInfoMessage
@ -20,8 +28,8 @@ object SquadFacilityBindInfoMessage extends Marshallable[SquadFacilityBindInfoMe
implicit val codec: Codec[SquadFacilityBindInfoMessage] = (
("unk0" | bool) ::
("unk1" | uint32L) ::
("unk2" | uint32L) ::
("unk3" | uint32L)
("squadID" | uint32L) ::
("mapID" | uint32L) ::
("zoneID" | uint32L)
).as[SquadFacilityBindInfoMessage]
}

View file

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