mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-20 02:24:45 +00:00
outfit_id is uint32L
This commit is contained in:
parent
f977ea8e6f
commit
6e23b701a6
|
|
@ -11,7 +11,7 @@ import shapeless.{::, HNil}
|
|||
|
||||
final case class OutfitEvent(
|
||||
request_type: OutfitEvent.RequestType.Type,
|
||||
outfit_guid: PlanetSideGUID,
|
||||
outfit_guid: Long,
|
||||
action: OutfitEventAction
|
||||
) extends PlanetSideGamePacket {
|
||||
type Packet = OutfitEvent
|
||||
|
|
@ -37,8 +37,6 @@ object OutfitEventAction {
|
|||
)
|
||||
|
||||
final case class OutfitInfo(
|
||||
unk1: Int,
|
||||
unk2: Int,
|
||||
outfit_name: String,
|
||||
unk6: Long,
|
||||
unk7: Long,
|
||||
|
|
@ -62,8 +60,6 @@ object OutfitEventAction {
|
|||
) extends OutfitEventAction(code = 0)
|
||||
|
||||
final case class Unk1(
|
||||
unk0: Int,
|
||||
unk1: Int,
|
||||
unk2: Int,
|
||||
unk3: Boolean,
|
||||
) extends OutfitEventAction(code = 1)
|
||||
|
|
@ -73,24 +69,19 @@ object OutfitEventAction {
|
|||
) extends OutfitEventAction(code = 2)
|
||||
|
||||
final case class Unk3(
|
||||
unk0: Int,
|
||||
unk1: Int,
|
||||
unk2: Int,
|
||||
unk3: Boolean,
|
||||
data: BitVector,
|
||||
) extends OutfitEventAction(code = 3)
|
||||
|
||||
final case class Unk4(
|
||||
unk0: Int,
|
||||
unk1: Int,
|
||||
unk2: Int,
|
||||
new_outfit_id: Long,
|
||||
unk3: Int,
|
||||
unk4: Boolean,
|
||||
data: BitVector,
|
||||
) extends OutfitEventAction(code = 4)
|
||||
|
||||
final case class Unk5(
|
||||
unk0: Int,
|
||||
unk1: Int,
|
||||
unk2: Int,
|
||||
unk3: Int,
|
||||
|
|
@ -128,8 +119,6 @@ object OutfitEventAction {
|
|||
)
|
||||
|
||||
private val InfoCodec: Codec[OutfitInfo] = (
|
||||
uint8L ::
|
||||
uint8L ::
|
||||
PacketHelpers.encodedWideStringAligned(5) ::
|
||||
uint32L ::
|
||||
uint32L ::
|
||||
|
|
@ -148,12 +137,12 @@ object OutfitEventAction {
|
|||
uintL(7)
|
||||
).xmap[OutfitInfo](
|
||||
{
|
||||
case u1 :: u2 :: outfit_name :: u6 :: u7 :: member_count :: u9 :: outfit_rank_names :: motd :: u19 :: u20 :: u21 :: u21_2 :: created_timestamp :: u23 :: u24 :: u25 :: u123 :: HNil =>
|
||||
OutfitInfo(u1, u2, 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 :: 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 OutfitInfo(u1, u2, outfit_name, u6, u7, member_count, u9, outfit_rank_names, motd, u19, u20, u21, u21_2, created_timestamp, u23, u24, u25, u123) =>
|
||||
u1 :: u2 :: 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, 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
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -171,18 +160,16 @@ object OutfitEventAction {
|
|||
)
|
||||
|
||||
val Unk1Codec: Codec[Unk1] = (
|
||||
uint8L ::
|
||||
uint8L ::
|
||||
uint4L ::
|
||||
bool
|
||||
).xmap[Unk1](
|
||||
{
|
||||
case u0 :: u1 :: u2 :: u3 :: HNil =>
|
||||
Unk1(u0, u1, u2, u3)
|
||||
case u2 :: u3 :: HNil =>
|
||||
Unk1(u2, u3)
|
||||
},
|
||||
{
|
||||
case Unk1(u0, u1, u2, u3) =>
|
||||
u0 :: u1 :: u2 :: u3 :: HNil
|
||||
case Unk1(u2, u3) =>
|
||||
u2 :: u3 :: HNil
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -200,42 +187,37 @@ object OutfitEventAction {
|
|||
)
|
||||
|
||||
val Unk3Codec: Codec[Unk3] = (
|
||||
uint8L ::
|
||||
uint8L ::
|
||||
uint4L ::
|
||||
bool ::
|
||||
bits
|
||||
).xmap[Unk3](
|
||||
{
|
||||
case u0 :: u1 :: u2 :: u3 :: data :: HNil =>
|
||||
Unk3(u0, u1, u2, u3, data)
|
||||
case u2 :: u3 :: data :: HNil =>
|
||||
Unk3(u2, u3, data)
|
||||
},
|
||||
{
|
||||
case Unk3(u0, u1, u2, u3, data) =>
|
||||
u0 :: u1 :: u2 :: u3 :: data :: HNil
|
||||
case Unk3(u2, u3, data) =>
|
||||
u2 :: u3 :: data :: HNil
|
||||
}
|
||||
)
|
||||
|
||||
val Unk4Codec: Codec[Unk4] = (
|
||||
uint16L ::
|
||||
uint16L ::
|
||||
uint16L ::
|
||||
val Unk4Codec: Codec[Unk4] = ( // update outfit_id? // 2016.03.18 #10640 // after this packet the referenced id changes to the new one, old is not used again
|
||||
uint32L :: // real / other outfit_id
|
||||
uint4L ::
|
||||
bool ::
|
||||
bits
|
||||
).xmap[Unk4](
|
||||
{
|
||||
case u0 :: u1 :: u2 :: u3 :: u4 :: data :: HNil =>
|
||||
Unk4(u0, u1, u2, u3, u4, data)
|
||||
case new_outfit_id :: u3 :: u4 :: data :: HNil =>
|
||||
Unk4(new_outfit_id, u3, u4, data)
|
||||
},
|
||||
{
|
||||
case Unk4(u0, u1, u2, u3, u4, data) =>
|
||||
u0 :: u1 :: u2 ::u3 :: u4 :: data :: HNil
|
||||
case Unk4(new_outfit_id, u3, u4, data) =>
|
||||
new_outfit_id ::u3 :: u4 :: data :: HNil
|
||||
}
|
||||
)
|
||||
|
||||
val Unk5Codec: Codec[Unk5] = (
|
||||
uint16L ::
|
||||
uint16L ::
|
||||
uint16L ::
|
||||
uint4L ::
|
||||
|
|
@ -243,12 +225,12 @@ object OutfitEventAction {
|
|||
bits
|
||||
).xmap[Unk5](
|
||||
{
|
||||
case u0 :: u1 :: u2 :: u3 :: u4 :: data :: HNil =>
|
||||
Unk5(u0, u1, u2, u3, u4, data)
|
||||
case u1 :: u2 :: u3 :: u4 :: data :: HNil =>
|
||||
Unk5(u1, u2, u3, u4, data)
|
||||
},
|
||||
{
|
||||
case Unk5(u0, u1, u2, u3, u4, data) =>
|
||||
u0 :: u1 :: u2 :: u3 :: u4 :: data :: HNil
|
||||
case Unk5(u1, u2, u3, u4, data) =>
|
||||
u1 :: u2 :: u3 :: u4 :: data :: HNil
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -342,7 +324,7 @@ object OutfitEvent extends Marshallable[OutfitEvent] {
|
|||
|
||||
implicit val codec: Codec[OutfitEvent] = (
|
||||
("request_type" | RequestType.codec) >>:~ { request_type =>
|
||||
("outfit_guid" | PlanetSideGUID.codec) ::
|
||||
("outfit_guid" | uint32L) ::
|
||||
("action" | selectFromType(request_type.id))
|
||||
}
|
||||
).xmap[OutfitEvent](
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package net.psforever.packet.game
|
|||
|
||||
import net.psforever.packet.GamePacketOpcode.Type
|
||||
import net.psforever.packet.{GamePacketOpcode, Marshallable, PacketHelpers, PlanetSideGamePacket}
|
||||
import net.psforever.types.PlanetSideGUID
|
||||
import scodec.{Attempt, Codec, Err}
|
||||
import scodec.bits.BitVector
|
||||
import scodec.codecs._
|
||||
|
|
@ -11,8 +10,7 @@ import shapeless.{::, HNil}
|
|||
|
||||
final case class OutfitMembershipRequest(
|
||||
request_type: OutfitMembershipRequest.RequestType.Type,
|
||||
avatar_guid: PlanetSideGUID, // avatar_guid and unk1 are related, might be Long instead
|
||||
unk1: Int, //
|
||||
outfit_id: Long,
|
||||
action: OutfitMembershipRequestAction
|
||||
) extends PlanetSideGamePacket {
|
||||
type Packet = OutfitMembershipRequest
|
||||
|
|
@ -170,18 +168,17 @@ object OutfitMembershipRequest extends Marshallable[OutfitMembershipRequest] {
|
|||
|
||||
implicit val codec: Codec[OutfitMembershipRequest] = (
|
||||
("request_type" | RequestType.codec) >>:~ { request_type =>
|
||||
("avatar_guid" | PlanetSideGUID.codec) ::
|
||||
("unk1" | uint16L) ::
|
||||
("outfit_id" | uint32L) ::
|
||||
("action" | selectFromType(request_type.id))
|
||||
}
|
||||
).xmap[OutfitMembershipRequest](
|
||||
{
|
||||
case request_type :: avatar_guid :: u1 :: action :: HNil =>
|
||||
OutfitMembershipRequest(request_type, avatar_guid, u1, action)
|
||||
case request_type :: outfit_id :: action :: HNil =>
|
||||
OutfitMembershipRequest(request_type, outfit_id, action)
|
||||
},
|
||||
{
|
||||
case OutfitMembershipRequest(request_type, avatar_guid, u1, action) =>
|
||||
request_type :: avatar_guid :: u1 :: action :: HNil
|
||||
case OutfitMembershipRequest(request_type, outfit_id, action) =>
|
||||
request_type :: outfit_id :: action :: HNil
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ import shapeless.{::, HNil}
|
|||
final case class OutfitMembershipResponse(
|
||||
response_type: OutfitMembershipResponse.ResponseType.Type,
|
||||
unk0: Int,
|
||||
avatar_guid: PlanetSideGUID, // avatar_guid and unk1 are related, might be Long instead
|
||||
unk1: PlanetSideGUID, //
|
||||
outfit_id: Long,
|
||||
unk2: PlanetSideGUID,
|
||||
unk3: Int,
|
||||
//unk4: Boolean,
|
||||
|
|
@ -223,8 +222,7 @@ object OutfitMembershipResponse extends Marshallable[OutfitMembershipResponse] {
|
|||
implicit val codec: Codec[OutfitMembershipResponse] = (
|
||||
("response_type" | ResponseType.codec) >>:~ { response_type =>
|
||||
("unk0" | uint8L) ::
|
||||
("avatar_guid" | PlanetSideGUID.codec) ::
|
||||
("outfit_guid-1" | PlanetSideGUID.codec) ::
|
||||
("outfit_id" | uint32L) ::
|
||||
("target_guid" | PlanetSideGUID.codec) ::
|
||||
("unk3" | uint16L) ::
|
||||
//("unk4" | bool) ::
|
||||
|
|
@ -232,12 +230,12 @@ object OutfitMembershipResponse extends Marshallable[OutfitMembershipResponse] {
|
|||
}
|
||||
).xmap[OutfitMembershipResponse](
|
||||
{
|
||||
case response_type :: u0 :: avatar_guid :: outfit_guid_1 :: target_guid :: u3 :: action :: HNil =>
|
||||
OutfitMembershipResponse(response_type, u0, avatar_guid, outfit_guid_1, target_guid, u3, action)
|
||||
case response_type :: u0 :: outfit_id :: target_guid :: u3 :: action :: HNil =>
|
||||
OutfitMembershipResponse(response_type, u0, outfit_id, target_guid, u3, action)
|
||||
},
|
||||
{
|
||||
case OutfitMembershipResponse(response_type, u0, avatar_guid, u1, u2, u3, action) =>
|
||||
response_type :: u0 :: avatar_guid :: u1 :: u2 :: u3 :: action :: HNil
|
||||
case OutfitMembershipResponse(response_type, u0, outfit_id, u2, u3, action) =>
|
||||
response_type :: u0 :: outfit_id :: u2 :: u3 :: action :: HNil
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,11 +54,9 @@ class OutfitEventTest extends Specification {
|
|||
PacketCoding.decodePacket(unk0_ABC).require match {
|
||||
case OutfitEvent(request_type, outfit_guid, action) =>
|
||||
request_type mustEqual RequestType.Unk0
|
||||
outfit_guid mustEqual PlanetSideGUID(25044)
|
||||
outfit_guid mustEqual 25044
|
||||
action mustEqual Unk0(
|
||||
OutfitInfo(
|
||||
unk1 = 0,
|
||||
unk2 = 0,
|
||||
outfit_name = "Black Armored Reapers",
|
||||
unk6 = 223190045,
|
||||
unk7 = 223190045,
|
||||
|
|
@ -85,11 +83,9 @@ class OutfitEventTest extends Specification {
|
|||
"encode Unk0 ABC" in {
|
||||
val msg = OutfitEvent(
|
||||
RequestType.Unk0,
|
||||
PlanetSideGUID(25044),
|
||||
25044,
|
||||
Unk0(
|
||||
OutfitInfo(
|
||||
unk1 = 0,
|
||||
unk2 = 0,
|
||||
outfit_name = "Black Armored Reapers",
|
||||
unk6 = 223190045,
|
||||
unk7 = 223190045,
|
||||
|
|
@ -118,8 +114,11 @@ class OutfitEventTest extends Specification {
|
|||
PacketCoding.decodePacket(unk1_ABC).require match {
|
||||
case OutfitEvent(request_type, outfit_guid, action) =>
|
||||
request_type mustEqual RequestType.Unk1
|
||||
outfit_guid mustEqual PlanetSideGUID(5400)
|
||||
action mustEqual Unk1(unk0 = 8, unk1 = 0, unk2 = 0, unk3 = false)
|
||||
outfit_guid mustEqual 529688L
|
||||
action mustEqual Unk1(
|
||||
unk2 = 0,
|
||||
unk3 = false
|
||||
)
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
|
|
@ -128,10 +127,8 @@ class OutfitEventTest extends Specification {
|
|||
"encode Unk1 ABC" in {
|
||||
val msg = OutfitEvent(
|
||||
RequestType.Unk1,
|
||||
PlanetSideGUID(5400),
|
||||
529688L,
|
||||
Unk1(
|
||||
unk0 = 8,
|
||||
unk1 = 0,
|
||||
unk2 = 0,
|
||||
unk3 = false,
|
||||
)
|
||||
|
|
@ -145,10 +142,25 @@ class OutfitEventTest extends Specification {
|
|||
PacketCoding.decodePacket(unk2_ABC).require match {
|
||||
case OutfitEvent(request_type, outfit_guid, action) =>
|
||||
request_type mustEqual RequestType.Unk2
|
||||
outfit_guid mustEqual PlanetSideGUID(1)
|
||||
action mustEqual Unk2(OutfitInfo(unk1 = 255, unk2 = 127, outfit_name = "PlanetSide_Forever_Vanu",
|
||||
unk6 = 0, unk7 = 0, member_count = 1, unk9 = 0, OutfitRankNames("","","","","","","",""),
|
||||
"", PlanetSideGUID(28672), 33353, 0, 0, 0, 0, 0, 0, 0))
|
||||
outfit_guid mustEqual 2147418113L
|
||||
action mustEqual Unk2(OutfitInfo(
|
||||
outfit_name = "PlanetSide_Forever_Vanu",
|
||||
unk6 = 0,
|
||||
unk7 = 0,
|
||||
member_count = 1,
|
||||
unk9 = 0,
|
||||
OutfitRankNames("","","","","","","",""),
|
||||
"",
|
||||
PlanetSideGUID(28672),
|
||||
33353,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
))
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
|
|
@ -157,11 +169,9 @@ class OutfitEventTest extends Specification {
|
|||
"encode Unk2 ABC" in {
|
||||
val msg = OutfitEvent(
|
||||
RequestType.Unk2,
|
||||
PlanetSideGUID(1),
|
||||
2147418113L,
|
||||
Unk2(
|
||||
OutfitInfo(
|
||||
unk1 = 255,
|
||||
unk2 = 127,
|
||||
outfit_name = "PlanetSide_Forever_Vanu",
|
||||
unk6 = 0,
|
||||
unk7 = 0,
|
||||
|
|
@ -190,10 +200,8 @@ class OutfitEventTest extends Specification {
|
|||
PacketCoding.decodePacket(unk3_ABC).require match {
|
||||
case OutfitEvent(request_type, outfit_guid, action) =>
|
||||
request_type mustEqual RequestType.Unk3
|
||||
outfit_guid mustEqual PlanetSideGUID(1)
|
||||
outfit_guid mustEqual 2147418113L
|
||||
action mustEqual Unk3(
|
||||
unk0 = 255,
|
||||
unk1 = 127,
|
||||
unk2 = 0,
|
||||
unk3 = false,
|
||||
BitVector.fromValidHex("")
|
||||
|
|
@ -206,10 +214,8 @@ class OutfitEventTest extends Specification {
|
|||
"encode Unk3 ABC" in {
|
||||
val msg = OutfitEvent(
|
||||
RequestType.Unk3,
|
||||
PlanetSideGUID(1),
|
||||
2147418113L,
|
||||
Unk3(
|
||||
unk0 = 255,
|
||||
unk1 = 127,
|
||||
unk2 = 0,
|
||||
unk3 = false,
|
||||
BitVector.fromValidHex("")
|
||||
|
|
@ -224,11 +230,9 @@ class OutfitEventTest extends Specification {
|
|||
PacketCoding.decodePacket(unk4_ABC).require match {
|
||||
case OutfitEvent(request_type, outfit_guid, action) =>
|
||||
request_type mustEqual RequestType.Unk4
|
||||
outfit_guid mustEqual PlanetSideGUID(1)
|
||||
outfit_guid mustEqual 2147418113L
|
||||
action mustEqual Unk4(
|
||||
unk0 = 32767,
|
||||
unk1 = 5456,
|
||||
unk2 = 8,
|
||||
new_outfit_id = 529744L,
|
||||
0,
|
||||
unk4 = false,
|
||||
BitVector.fromValidHex("")
|
||||
|
|
@ -241,11 +245,9 @@ class OutfitEventTest extends Specification {
|
|||
"encode Unk4 ABC" in {
|
||||
val msg = OutfitEvent(
|
||||
RequestType.Unk4,
|
||||
PlanetSideGUID(1),
|
||||
2147418113L,
|
||||
Unk4(
|
||||
unk0 = 32767,
|
||||
unk1 = 5456,
|
||||
unk2 = 8,
|
||||
new_outfit_id = 529744L,
|
||||
unk3 = 0,
|
||||
unk4 = false,
|
||||
BitVector.fromValidHex("")
|
||||
|
|
@ -260,9 +262,8 @@ class OutfitEventTest extends Specification {
|
|||
PacketCoding.decodePacket(unk5_ABC).require match {
|
||||
case OutfitEvent(request_type, outfit_guid, action) =>
|
||||
request_type mustEqual RequestType.Unk5
|
||||
outfit_guid mustEqual PlanetSideGUID(1)
|
||||
outfit_guid mustEqual 2147418113L
|
||||
action mustEqual Unk5(
|
||||
unk0 = 32767,
|
||||
unk1 = 2,
|
||||
unk2 = 0,
|
||||
unk3 = 0,
|
||||
|
|
@ -277,9 +278,8 @@ class OutfitEventTest extends Specification {
|
|||
"encode Unk5 ABC" in {
|
||||
val msg = OutfitEvent(
|
||||
RequestType.Unk5,
|
||||
PlanetSideGUID(1),
|
||||
2147418113L,
|
||||
Unk5(
|
||||
unk0 = 32767,
|
||||
unk1 = 2,
|
||||
unk2 = 0,
|
||||
unk3 = 0,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import net.psforever.packet._
|
|||
import net.psforever.packet.game._
|
||||
import net.psforever.packet.game.OutfitMembershipRequest.RequestType
|
||||
import net.psforever.packet.game.OutfitMembershipRequestAction._
|
||||
import net.psforever.types.PlanetSideGUID
|
||||
import org.specs2.mutable._
|
||||
import scodec.bits._
|
||||
|
||||
|
|
@ -25,10 +24,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode CreateOutfit ABC" in {
|
||||
PacketCoding.decodePacket(create_ABC).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Create
|
||||
avatar_id mustEqual PlanetSideGUID(1)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 1
|
||||
action mustEqual CreateOutfit("", 0, unk4 = false, "ABC")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -36,7 +34,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode CreateOutfit ABC" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Create, PlanetSideGUID(1), 0, CreateOutfit("", 0, unk4 = false, "ABC"))
|
||||
val msg = OutfitMembershipRequest(RequestType.Create, 1, CreateOutfit("", 0, unk4 = false, "ABC"))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual create_ABC
|
||||
|
|
@ -44,10 +42,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode CreateOutfit 2222" in {
|
||||
PacketCoding.decodePacket(create_2222).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Create
|
||||
avatar_id mustEqual PlanetSideGUID(8)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 8
|
||||
action mustEqual CreateOutfit("", 0, unk4 = false, "2222")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -55,7 +52,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode CreateOutfit 2222" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Create, PlanetSideGUID(8), 0, CreateOutfit("", 0, unk4 = false, "2222"))
|
||||
val msg = OutfitMembershipRequest(RequestType.Create, 8, CreateOutfit("", 0, unk4 = false, "2222"))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual create_2222
|
||||
|
|
@ -63,10 +60,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode FormOutfit abc" in {
|
||||
PacketCoding.decodePacket(form_abc).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Form
|
||||
avatar_id mustEqual PlanetSideGUID(1)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 1
|
||||
action mustEqual FormOutfit("", 0, unk4 = false, "abc")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -74,7 +70,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode FormOutfit abc" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Form, PlanetSideGUID(1), 0, FormOutfit("", 0, unk4 = false, "abc"))
|
||||
val msg = OutfitMembershipRequest(RequestType.Form, 1, FormOutfit("", 0, unk4 = false, "abc"))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual form_abc
|
||||
|
|
@ -82,10 +78,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode FormOutfit 1" in {
|
||||
PacketCoding.decodePacket(form_1).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Form
|
||||
avatar_id mustEqual PlanetSideGUID(8)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 8
|
||||
action mustEqual FormOutfit("", 0, unk4 = false, "1")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -93,7 +88,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode FormOutfit 1" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Form, PlanetSideGUID(8), 0, FormOutfit("", 0, unk4 = false, "1"))
|
||||
val msg = OutfitMembershipRequest(RequestType.Form, 8, FormOutfit("", 0, unk4 = false, "1"))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual form_1
|
||||
|
|
@ -101,10 +96,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode AcceptOutfitInvite 1" in {
|
||||
PacketCoding.decodePacket(accept_1).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Accept
|
||||
avatar_id mustEqual PlanetSideGUID(1)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 1
|
||||
action mustEqual AcceptOutfitInvite("")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -112,7 +106,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode AcceptOutfitInvite 1" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Accept, PlanetSideGUID(1), 0, AcceptOutfitInvite(""))
|
||||
val msg = OutfitMembershipRequest(RequestType.Accept, 1, AcceptOutfitInvite(""))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual accept_1
|
||||
|
|
@ -120,10 +114,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode AcceptOutfitInvite 2" in {
|
||||
PacketCoding.decodePacket(accept_2).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Accept
|
||||
avatar_id mustEqual PlanetSideGUID(2)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 2
|
||||
action mustEqual AcceptOutfitInvite("")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -131,7 +124,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode AcceptOutfitInvite 2" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Accept, PlanetSideGUID(2), 0, AcceptOutfitInvite(""))
|
||||
val msg = OutfitMembershipRequest(RequestType.Accept, 2, AcceptOutfitInvite(""))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual accept_2
|
||||
|
|
@ -139,10 +132,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode RejectOutfitInvite 1" in {
|
||||
PacketCoding.decodePacket(reject_1).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Reject
|
||||
avatar_id mustEqual PlanetSideGUID(1)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 1
|
||||
action mustEqual RejectOutfitInvite("")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -150,7 +142,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode RejectOutfitInvite 1" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Reject, PlanetSideGUID(1), 0, RejectOutfitInvite(""))
|
||||
val msg = OutfitMembershipRequest(RequestType.Reject, 1, RejectOutfitInvite(""))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual reject_1
|
||||
|
|
@ -158,10 +150,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode RejectOutfitInvite 2" in {
|
||||
PacketCoding.decodePacket(reject_2).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Reject
|
||||
avatar_id mustEqual PlanetSideGUID(2)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 2
|
||||
action mustEqual RejectOutfitInvite("")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -169,7 +160,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode RejectOutfitInvite 2" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Reject, PlanetSideGUID(2), 0, RejectOutfitInvite(""))
|
||||
val msg = OutfitMembershipRequest(RequestType.Reject, 2, RejectOutfitInvite(""))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual reject_2
|
||||
|
|
@ -177,10 +168,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode CancelOutfitInvite 3" in {
|
||||
PacketCoding.decodePacket(cancel_3).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Cancel
|
||||
avatar_id mustEqual PlanetSideGUID(3)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 3
|
||||
action mustEqual CancelOutfitInvite(0, 0, "")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -188,7 +178,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode CancelOutfitInvite 3" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Cancel, PlanetSideGUID(3), 0, CancelOutfitInvite(0, 0, ""))
|
||||
val msg = OutfitMembershipRequest(RequestType.Cancel, 3, CancelOutfitInvite(0, 0, ""))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual cancel_3
|
||||
|
|
@ -196,10 +186,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode CancelOutfitInvite 1 abc" in {
|
||||
PacketCoding.decodePacket(cancel_1_abc).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Cancel
|
||||
avatar_id mustEqual PlanetSideGUID(1)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 1
|
||||
action mustEqual CancelOutfitInvite(0, 0, "abc")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -207,7 +196,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode CancelOutfitInvite 1 abc" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Cancel, PlanetSideGUID(1), 0, CancelOutfitInvite(0, 0, "abc"))
|
||||
val msg = OutfitMembershipRequest(RequestType.Cancel, 1, CancelOutfitInvite(0, 0, "abc"))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual cancel_1_abc
|
||||
|
|
@ -215,10 +204,9 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
|
||||
"decode CancelOutfitInvite 3 def" in {
|
||||
PacketCoding.decodePacket(cancel_3_def).require match {
|
||||
case OutfitMembershipRequest(request_type, avatar_id, unk1, action) =>
|
||||
case OutfitMembershipRequest(request_type, avatar_id, action) =>
|
||||
request_type mustEqual RequestType.Cancel
|
||||
avatar_id mustEqual PlanetSideGUID(3)
|
||||
unk1 mustEqual 0
|
||||
avatar_id mustEqual 3
|
||||
action mustEqual CancelOutfitInvite(0, 0, "def")
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -226,7 +214,7 @@ class OutfitMembershipRequestTest extends Specification {
|
|||
}
|
||||
|
||||
"encode CancelOutfitInvite 3 def" in {
|
||||
val msg = OutfitMembershipRequest(RequestType.Cancel, PlanetSideGUID(3), 0, CancelOutfitInvite(0, 0, "def"))
|
||||
val msg = OutfitMembershipRequest(RequestType.Cancel, 3, CancelOutfitInvite(0, 0, "def"))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual cancel_3_def
|
||||
|
|
|
|||
Loading…
Reference in a new issue