mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-04-22 04:45:23 +00:00
Team Building Exercise [Incomplete] (#1013)
* Squad -> SquadFeatures from a common lookup * refactor to SquadService, etc.; clarification of fields related to outfit ids * thorough pass over squad functionality in regards to joining a squad or rejecting a squad invitation * decorating squads in the squad list to indicate availability based on size/capacity or role requirements * squad list decoration; rudimentary squad list searching * renovations to squad joining, promotion, and certain invitation/cleanup procedures * further renovations to squad joining, promotion, and certain invitation/cleanup procedures * overhaul of squad joining and squad promotion * separated the invitation system from the squad publishing and manipulating system
This commit is contained in:
parent
3bd50dc89c
commit
ebfc028f5c
30 changed files with 4782 additions and 3626 deletions
|
|
@ -33,7 +33,7 @@ class CharacterKnowledgeMessageTest extends Specification {
|
|||
),
|
||||
15,
|
||||
0,
|
||||
PlanetSideGUID(12)
|
||||
12
|
||||
)
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -61,7 +61,7 @@ class CharacterKnowledgeMessageTest extends Specification {
|
|||
),
|
||||
15,
|
||||
0,
|
||||
PlanetSideGUID(12)
|
||||
12
|
||||
)
|
||||
)
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import org.specs2.mutable._
|
|||
import net.psforever.packet._
|
||||
import net.psforever.packet.game.SquadAction._
|
||||
import net.psforever.packet.game._
|
||||
import net.psforever.types.PlanetSideGUID
|
||||
import net.psforever.types.{PlanetSideGUID, SquadListDecoration}
|
||||
import scodec.bits._
|
||||
|
||||
class SquadDefinitionActionMessageTest extends Specification {
|
||||
|
|
@ -29,6 +29,7 @@ class SquadDefinitionActionMessageTest extends Specification {
|
|||
val string_26 = hex"E7 68 000000"
|
||||
val string_28 = hex"E7 70 000020" //On
|
||||
val string_31 = hex"E7 7c 000020" //On
|
||||
val string_33 = hex"E7 84 0C0008"
|
||||
val string_34a =
|
||||
hex"E7 88 00002180420061006400610073007300000000000000040000" //"Badass", Solsar, Any matching position
|
||||
val string_34b =
|
||||
|
|
@ -224,6 +225,17 @@ class SquadDefinitionActionMessageTest extends Specification {
|
|||
}
|
||||
}
|
||||
|
||||
"decode (33)" in {
|
||||
PacketCoding.decodePacket(string_33).require match {
|
||||
case SquadDefinitionActionMessage(unk1, unk2, action) =>
|
||||
unk1 mustEqual PlanetSideGUID(3)
|
||||
unk2 mustEqual 0
|
||||
action mustEqual SquadListDecorator(SquadListDecoration.Available)
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"decode (34a)" in {
|
||||
PacketCoding.decodePacket(string_34a).require match {
|
||||
case SquadDefinitionActionMessage(unk1, unk2, action) =>
|
||||
|
|
@ -460,6 +472,13 @@ class SquadDefinitionActionMessageTest extends Specification {
|
|||
pkt mustEqual string_31
|
||||
}
|
||||
|
||||
"encode (33)" in {
|
||||
val msg = SquadDefinitionActionMessage(PlanetSideGUID(3), 0, SquadAction.SquadListDecorator(SquadListDecoration.Available))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_33
|
||||
}
|
||||
|
||||
"encode (34a)" in {
|
||||
val msg = SquadDefinitionActionMessage(
|
||||
PlanetSideGUID(0),
|
||||
|
|
|
|||
|
|
@ -651,7 +651,7 @@ class SquadDetailDefinitionUpdateMessageTest extends Specification {
|
|||
val msg = SquadDetailDefinitionUpdateMessage(
|
||||
PlanetSideGUID(3),
|
||||
SquadDetail()
|
||||
.Field1(0)
|
||||
.Guid(0)
|
||||
.LeaderCharId(1221560L)
|
||||
.Members(
|
||||
List(
|
||||
|
|
@ -677,7 +677,7 @@ class SquadDetailDefinitionUpdateMessageTest extends Specification {
|
|||
PlanetSideGUID(3),
|
||||
SquadDetail()
|
||||
.Leader(42631712L, "Jaako")
|
||||
.Field3(556403L)
|
||||
.OutfitId(556403L)
|
||||
.Members(
|
||||
List(
|
||||
SquadPositionEntry(0, SquadPositionDetail().Player(0L, ""))
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class SquadMembershipResponseTest extends Specification {
|
|||
"decode (1-1)" in {
|
||||
PacketCoding.decodePacket(string_11).require match {
|
||||
case SquadMembershipResponse(unk1, unk2, unk3, unk4, unk5, unk6, unk7, unk8) =>
|
||||
unk1 mustEqual SquadResponseType.Unk01
|
||||
unk1 mustEqual SquadResponseType.ProximityInvite
|
||||
unk2 mustEqual 19
|
||||
unk3 mustEqual 0
|
||||
unk4 mustEqual 41530025L
|
||||
|
|
@ -78,7 +78,7 @@ class SquadMembershipResponseTest extends Specification {
|
|||
"decode (1-2)" in {
|
||||
PacketCoding.decodePacket(string_12).require match {
|
||||
case SquadMembershipResponse(unk1, unk2, unk3, unk4, unk5, unk6, unk7, unk8) =>
|
||||
unk1 mustEqual SquadResponseType.Unk01
|
||||
unk1 mustEqual SquadResponseType.ProximityInvite
|
||||
unk2 mustEqual 18
|
||||
unk3 mustEqual 0
|
||||
unk4 mustEqual 41578085L
|
||||
|
|
@ -315,14 +315,14 @@ class SquadMembershipResponseTest extends Specification {
|
|||
}
|
||||
|
||||
"encode (1-1)" in {
|
||||
val msg = SquadMembershipResponse(SquadResponseType.Unk01, 19, 0, 41530025L, Some(0L), "", true, Some(None))
|
||||
val msg = SquadMembershipResponse(SquadResponseType.ProximityInvite, 19, 0, 41530025L, Some(0L), "", true, Some(None))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_11
|
||||
}
|
||||
|
||||
"encode (1-2)" in {
|
||||
val msg = SquadMembershipResponse(SquadResponseType.Unk01, 18, 0, 41578085L, Some(0L), "", true, Some(None))
|
||||
val msg = SquadMembershipResponse(SquadResponseType.ProximityInvite, 18, 0, 41578085L, Some(0L), "", true, Some(None))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_12
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ class CharacterDataTest extends Specification {
|
|||
a.unk9 mustEqual 0
|
||||
a.unkA mustEqual 0
|
||||
|
||||
b.outfit_id mustEqual 316554L
|
||||
b.outfit_name mustEqual "Black Beret Armoured Corps"
|
||||
b.outfit_logo mustEqual 23
|
||||
b.backpack mustEqual false
|
||||
|
|
@ -67,7 +68,6 @@ class CharacterDataTest extends Specification {
|
|||
b.is_cloaking mustEqual false
|
||||
b.charging_pose mustEqual false
|
||||
b.on_zipline.isEmpty mustEqual true
|
||||
b.unk0 mustEqual 316554L
|
||||
b.unk1 mustEqual false
|
||||
b.unk2 mustEqual false
|
||||
b.unk3 mustEqual false
|
||||
|
|
@ -174,6 +174,7 @@ class CharacterDataTest extends Specification {
|
|||
a.unk9 mustEqual 0
|
||||
a.unkA mustEqual 0
|
||||
|
||||
b.outfit_id mustEqual 26L
|
||||
b.outfit_name mustEqual "Black Beret Armoured Corps"
|
||||
b.outfit_logo mustEqual 23
|
||||
b.backpack mustEqual false
|
||||
|
|
@ -184,7 +185,6 @@ class CharacterDataTest extends Specification {
|
|||
b.is_cloaking mustEqual false
|
||||
b.charging_pose mustEqual false
|
||||
b.on_zipline.isEmpty mustEqual true
|
||||
b.unk0 mustEqual 26L
|
||||
b.unk1 mustEqual false
|
||||
b.unk2 mustEqual false
|
||||
b.unk3 mustEqual false
|
||||
|
|
@ -243,6 +243,7 @@ class CharacterDataTest extends Specification {
|
|||
a.unk9 mustEqual 0
|
||||
a.unkA mustEqual 0
|
||||
|
||||
b.outfit_id mustEqual 529687L
|
||||
b.outfit_name mustEqual "Original District"
|
||||
b.outfit_logo mustEqual 23
|
||||
b.backpack mustEqual true
|
||||
|
|
@ -253,7 +254,6 @@ class CharacterDataTest extends Specification {
|
|||
b.is_cloaking mustEqual false
|
||||
b.charging_pose mustEqual false
|
||||
b.on_zipline.isEmpty mustEqual true
|
||||
b.unk0 mustEqual 529687L
|
||||
b.unk1 mustEqual false
|
||||
b.unk2 mustEqual false
|
||||
b.unk3 mustEqual false
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ class DetailedCharacterDataTest extends Specification {
|
|||
a.unk9 mustEqual 0
|
||||
a.unkA mustEqual 65535
|
||||
|
||||
b.outfit_id mustEqual 0L
|
||||
b.outfit_name mustEqual ""
|
||||
b.outfit_logo mustEqual 0
|
||||
b.backpack mustEqual false
|
||||
|
|
@ -97,7 +98,6 @@ class DetailedCharacterDataTest extends Specification {
|
|||
b.is_cloaking mustEqual false
|
||||
b.charging_pose mustEqual false
|
||||
b.on_zipline.isEmpty mustEqual true
|
||||
b.unk0 mustEqual 0L
|
||||
b.unk1 mustEqual false
|
||||
b.unk2 mustEqual false
|
||||
b.unk3 mustEqual false
|
||||
|
|
@ -275,6 +275,7 @@ class DetailedCharacterDataTest extends Specification {
|
|||
a.unk9 mustEqual 0
|
||||
a.unkA mustEqual 0
|
||||
|
||||
b.outfit_id mustEqual 0L
|
||||
b.outfit_name mustEqual ""
|
||||
b.outfit_logo mustEqual 0
|
||||
b.backpack mustEqual false
|
||||
|
|
@ -285,7 +286,6 @@ class DetailedCharacterDataTest extends Specification {
|
|||
b.is_cloaking mustEqual false
|
||||
b.charging_pose mustEqual false
|
||||
b.on_zipline.isEmpty mustEqual true
|
||||
b.unk0 mustEqual 0L
|
||||
b.unk1 mustEqual false
|
||||
b.unk2 mustEqual false
|
||||
b.unk3 mustEqual false
|
||||
|
|
@ -460,6 +460,7 @@ class DetailedCharacterDataTest extends Specification {
|
|||
a.unk9 mustEqual 0
|
||||
a.unkA mustEqual 65535
|
||||
|
||||
b.outfit_id mustEqual 0L
|
||||
b.outfit_name mustEqual ""
|
||||
b.outfit_logo mustEqual 0
|
||||
b.backpack mustEqual false
|
||||
|
|
@ -470,7 +471,6 @@ class DetailedCharacterDataTest extends Specification {
|
|||
b.is_cloaking mustEqual false
|
||||
b.charging_pose mustEqual false
|
||||
b.on_zipline.isEmpty mustEqual true
|
||||
b.unk0 mustEqual 0L
|
||||
b.unk1 mustEqual false
|
||||
b.unk2 mustEqual false
|
||||
b.unk3 mustEqual false
|
||||
|
|
@ -687,6 +687,7 @@ class DetailedCharacterDataTest extends Specification {
|
|||
a.unk9 mustEqual 0
|
||||
a.unkA mustEqual 0
|
||||
|
||||
b.outfit_id mustEqual 556539L
|
||||
b.outfit_name mustEqual ""
|
||||
b.outfit_logo mustEqual 14
|
||||
b.backpack mustEqual false
|
||||
|
|
@ -697,7 +698,6 @@ class DetailedCharacterDataTest extends Specification {
|
|||
b.is_cloaking mustEqual false
|
||||
b.charging_pose mustEqual false
|
||||
b.on_zipline.isEmpty mustEqual true
|
||||
b.unk0 mustEqual 556539L
|
||||
b.unk1 mustEqual false
|
||||
b.unk2 mustEqual false
|
||||
b.unk3 mustEqual false
|
||||
|
|
@ -1208,7 +1208,7 @@ class DetailedCharacterDataTest extends Specification {
|
|||
a.unk9 mustEqual 10
|
||||
a.unkA mustEqual 1
|
||||
|
||||
b.unk0 mustEqual 25044L
|
||||
b.outfit_id mustEqual 25044L
|
||||
b.outfit_name mustEqual "Black Armored Reapers"
|
||||
b.outfit_logo mustEqual 15
|
||||
b.unk1 mustEqual false
|
||||
|
|
@ -1355,7 +1355,7 @@ class DetailedCharacterDataTest extends Specification {
|
|||
a.unk9 mustEqual 0
|
||||
a.unkA mustEqual 0
|
||||
|
||||
b.unk0 mustEqual 16507L
|
||||
b.outfit_id mustEqual 16507L
|
||||
b.outfit_name mustEqual "Hooked On Insanity"
|
||||
b.outfit_logo mustEqual 5
|
||||
b.unk1 mustEqual false
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ class MountedVehiclesTest extends Specification {
|
|||
a.unk9 mustEqual 0
|
||||
a.unkA mustEqual 0
|
||||
|
||||
b.outfit_id mustEqual 316554L
|
||||
b.outfit_name mustEqual "Black Beret Armoured Corps"
|
||||
b.outfit_logo mustEqual 23
|
||||
b.backpack mustEqual false
|
||||
|
|
@ -85,7 +86,6 @@ class MountedVehiclesTest extends Specification {
|
|||
b.is_cloaking mustEqual false
|
||||
b.charging_pose mustEqual false
|
||||
b.on_zipline.isEmpty mustEqual true
|
||||
b.unk0 mustEqual 316554L
|
||||
b.unk1 mustEqual false
|
||||
b.unk2 mustEqual false
|
||||
b.unk3 mustEqual false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue