member packets

This commit is contained in:
ScrawnyRonnie 2025-08-20 12:31:08 -04:00
parent d450a1b6e5
commit b070834a8a
3 changed files with 38 additions and 50 deletions

View file

@ -44,8 +44,10 @@ object OutfitEventAction {
unk9: Int,
outfit_rank_names: OutfitRankNames,
motd: String,
owner_guid: PlanetSideGUID, // ?
unk20: Int,
unk10: Int,
unk11: Int,
unk12: Int,
unk13: Int,// ?
unk21: Int,
unk21_2: Int,
created_timestamp: Long,
@ -126,8 +128,10 @@ object OutfitEventAction {
uint16L ::
OutfitRankNamesCodec ::
PacketHelpers.encodedWideString ::
PlanetSideGUID.codec ::
uint16L :: //
uint8L ::
uint8L ::
uint8L ::
uint8L ::
uint8L :: // bool somewhere here
uintL(1) :: //
("created_timestamp" | uint32L) ::
@ -137,12 +141,12 @@ object OutfitEventAction {
uintL(7)
).xmap[OutfitInfo](
{
case outfit_name :: u6 :: u7 :: member_count :: u9 :: outfit_rank_names :: motd :: u19 :: u20 :: u21 :: u21_2 :: created_timestamp :: u23 :: u24 :: u25 :: u123 :: HNil =>
OutfitInfo(outfit_name, u6, u7, member_count, u9, outfit_rank_names, motd, u19, u20, u21, u21_2, created_timestamp, u23, u24, u25, u123)
case outfit_name :: u6 :: u7 :: member_count :: u9 :: outfit_rank_names :: motd :: u10 :: u11 :: u12 :: u13 :: u21 :: u21_2 :: created_timestamp :: u23 :: u24 :: u25 :: u123 :: HNil =>
OutfitInfo(outfit_name, u6, u7, member_count, u9, outfit_rank_names, motd, u10, u11, u12, u13, u21, u21_2, created_timestamp, u23, u24, u25, u123)
},
{
case OutfitInfo(outfit_name, u6, u7, member_count, u9, outfit_rank_names, motd, u19, u20, u21, u21_2, created_timestamp, u23, u24, u25, u123) =>
outfit_name :: u6 :: u7 :: member_count :: u9 :: outfit_rank_names :: motd :: u19 :: u20 :: u21 :: u21_2 :: created_timestamp :: u23 :: u24 :: u25 :: u123 :: HNil
case OutfitInfo(outfit_name, u6, u7, member_count, u9, outfit_rank_names, motd, u10, u11, u12, u13, u21, u21_2, created_timestamp, u23, u24, u25, u123) =>
outfit_name :: u6 :: u7 :: member_count :: u9 :: outfit_rank_names :: motd :: u10 :: u11 :: u12 :: u13 :: u21 :: u21_2 :: created_timestamp :: u23 :: u24 :: u25 :: u123 :: HNil
}
)
@ -284,9 +288,9 @@ object OutfitEvent extends Marshallable[OutfitEvent] {
import scala.annotation.switch
((code: @switch) match {
case 0 => Unk0Codec
case 0 => Unk0Codec // view outfit window and members
case 1 => Unk1Codec
case 2 => Unk2Codec // sent after /outfitcreate ?
case 2 => Unk2Codec // sent after /outfitcreate and on login if in an outfit
case 3 => Unk3Codec
case 4 => Unk4Codec
case 5 => Unk5Codec

View file

@ -9,18 +9,12 @@ import shapeless.{::, HNil}
final case class OutfitMemberEvent(
unk00: Int,
outfit_id: Long,
unk3: Int, // OMR(Unk1) target_guid
unk5: Int, // OMR(Unk1) unk3
member_id: Long,
member_name: String,
unk8: Int,
unk9: Int,
unk10: Int,
unk11: Int,
unk12: Int,
unk13: Int,
unk14: Int,
unk15: Int,
unk16: Int,
rank: Int, // 0-7
points: Long, // client divides this by 100
last_login: Long, // seconds ago from current time, 0 if online
unk1: Int,
) extends PlanetSideGamePacket {
type Packet = OutfitMemberEvent
def opcode = GamePacketOpcode.OutfitMemberEvent
@ -31,26 +25,20 @@ object OutfitMemberEvent extends Marshallable[OutfitMemberEvent] {
implicit val codec: Codec[OutfitMemberEvent] = (
("unk00" | uintL(2)) ::
("outfit_id" | uint32L) ::
("unk3" | uint16L) :: // OMR(Unk1) unk2
("unk5" | uint16L) ::
("member_name" | PacketHelpers.encodedWideStringAligned(6)) ::
("unk8" | uint8L) ::
("unk9" | uint8L) ::
("unk10" | uint8L) ::
("unk11" | uint8L) ::
("unk12" | uint8L) ::
("unk13" | uint8L) ::
("unk14" | uint8L) ::
("unk15" | uint8L) ::
("unk16" | uint8L)
("member_id" | uint32L) ::
("member_name" | PacketHelpers.encodedWideStringAligned(6)) ::
("rank" | uint(3)) ::
("points" | uint32L) ::
("last_login" | uint32L) ::
("unk1" | uint(5))
).xmap[OutfitMemberEvent](
{
case unk00 :: outfit_id :: u3 :: u5 :: member_name :: u8 :: u9 :: u10 :: u11 :: u12 :: u13 :: u14 :: u15 :: u16 :: HNil =>
OutfitMemberEvent(unk00, outfit_id, u3, u5, member_name, u8, u9, u10, u11, u12, u13, u14, u15, u16)
case unk00 :: outfit_id :: member_id :: member_name :: rank :: points :: last_login :: u1 :: HNil =>
OutfitMemberEvent(unk00, outfit_id, member_id, member_name, rank, points, last_login, u1)
},
{
case OutfitMemberEvent(unk00, outfit_id, u3, u5, member_name, u8, u9, u10, u11, u12, u13, u14, u15, u16) =>
unk00 :: outfit_id :: u3 :: u5 :: member_name :: u8 :: u9 :: u10 :: u11 :: u12 :: u13 :: u14 :: u15 :: u16 :: HNil
case OutfitMemberEvent(unk00, outfit_id, member_id, member_name, rank, points, last_login, u1) =>
unk00 :: outfit_id :: member_id :: member_name :: rank :: points :: last_login :: u1 :: HNil
}
)
}

View file

@ -9,11 +9,9 @@ import shapeless.{::, HNil}
final case class OutfitMemberUpdate(
outfit_guid: Long,
char_id: Long,
rank: Int, // 0-7
unk1: Int,
unk2: Int,
unk3: Int,
unk4: Int,
unk5: Int,
) extends PlanetSideGamePacket {
type Packet = OutfitMemberUpdate
def opcode = GamePacketOpcode.OutfitMemberUpdate
@ -23,19 +21,17 @@ final case class OutfitMemberUpdate(
object OutfitMemberUpdate extends Marshallable[OutfitMemberUpdate] {
implicit val codec: Codec[OutfitMemberUpdate] = (
("outfit_guid" | uint32L) ::
("unk1" | uint8L) ::
("unk2" | uint8L) ::
("unk3" | uint8L) ::
("unk4" | uint8L) ::
("unk5" | uint8L)
("char_id" | uint32L) ::
("rank" | uint(3)) ::
("unk1" | uint(5))
).xmap[OutfitMemberUpdate](
{
case outfit_guid :: u1 :: u2 :: u3 :: u4 :: u5 :: HNil =>
OutfitMemberUpdate(outfit_guid, u1, u2, u3, u4, u5)
case outfit_guid :: char_id :: rank :: u1 :: HNil =>
OutfitMemberUpdate(outfit_guid, char_id, rank, u1)
},
{
case OutfitMemberUpdate(outfit_guid, u1, u2, u3, u4, u5) =>
outfit_guid :: u1 :: u2 :: u3 :: u4 :: u5 :: HNil
case OutfitMemberUpdate(outfit_guid, char_id, rank, u1) =>
outfit_guid :: char_id :: rank :: u1 :: HNil
}
)
}