mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-04-28 07:45:28 +00:00
Wearing Your Accomplishments on Your Sleeve (#988)
* ability to swap merit commendation ribbons on shoulder and have other players see it * ability to swap merit commendation ribbons on shoulder and have other players see it * VehicleControlTest from elsewhere * giver all non-Exclusive ribbons that would become available to faction/sex and allow modification of the ribbon bars * awards only need to load during login activities; fixing a few awards that were not being allocated correctly * wrong conditional for sex check
This commit is contained in:
parent
0d8c717b73
commit
e5fe6cf89a
11 changed files with 1470 additions and 90 deletions
|
|
@ -4,18 +4,20 @@ package game
|
|||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import net.psforever.types.MeritCommendation
|
||||
import scodec.bits._
|
||||
|
||||
class AvatarAwardMessageTest extends Specification {
|
||||
val string0 = hex"cf 15010000014000003d0040000000"
|
||||
val string1 = hex"cf 2a010000c717b12a0000"
|
||||
val string2 = hex"cf a6010000e9058cab0080"
|
||||
val string3 = hex"cf 7a010000400000000000"
|
||||
|
||||
"decode (0)" in {
|
||||
PacketCoding.decodePacket(string0).require match {
|
||||
case AvatarAwardMessage(unk1, unk2, unk3) =>
|
||||
unk1 mustEqual 277
|
||||
unk2 mustEqual AwardOptionZero(5, 500)
|
||||
unk1 mustEqual MeritCommendation.Max1
|
||||
unk2 mustEqual AwardProgress(5, 500)
|
||||
unk3 mustEqual 0
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -25,8 +27,8 @@ class AvatarAwardMessageTest extends Specification {
|
|||
"decode (1)" in {
|
||||
PacketCoding.decodePacket(string1).require match {
|
||||
case AvatarAwardMessage(unk1, unk2, unk3) =>
|
||||
unk1 mustEqual 298
|
||||
unk2 mustEqual AwardOptionTwo(2831441436L)
|
||||
unk1 mustEqual MeritCommendation.OneYearVS
|
||||
unk2 mustEqual AwardCompletion(1415720846L)
|
||||
unk3 mustEqual 0
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -36,32 +38,50 @@ class AvatarAwardMessageTest extends Specification {
|
|||
"decode (2)" in {
|
||||
PacketCoding.decodePacket(string2).require match {
|
||||
case AvatarAwardMessage(unk1, unk2, unk3) =>
|
||||
unk1 mustEqual 422
|
||||
unk2 mustEqual AwardOptionTwo(2888963748L)
|
||||
unk3 mustEqual 2
|
||||
unk1 mustEqual MeritCommendation.TwoYearVS
|
||||
unk2 mustEqual AwardCompletion(1444482002L)
|
||||
unk3 mustEqual 1
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"decode (3)" in {
|
||||
PacketCoding.decodePacket(string3).require match {
|
||||
case AvatarAwardMessage(unk1, unk2, unk3) =>
|
||||
unk1 mustEqual MeritCommendation.StandardAssault3
|
||||
unk2 mustEqual AwardQualificationProgress(0)
|
||||
unk3 mustEqual 0
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode (0)" in {
|
||||
val msg = AvatarAwardMessage(277, AwardOptionZero(5, 500), 0)
|
||||
val msg = AvatarAwardMessage(MeritCommendation.Max1, AwardProgress(5, 500))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string0
|
||||
}
|
||||
|
||||
"encode (1)" in {
|
||||
val msg = AvatarAwardMessage(298, AwardOptionTwo(2831441436L), 0)
|
||||
val msg = AvatarAwardMessage(MeritCommendation.OneYearVS, AwardCompletion(1415720846L))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string1
|
||||
}
|
||||
|
||||
"encode (2)" in {
|
||||
val msg = AvatarAwardMessage(422, AwardOptionTwo(2888963748L), 2)
|
||||
val msg = AvatarAwardMessage(MeritCommendation.TwoYearVS, AwardCompletion(1444482002L), 1)
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string2
|
||||
}
|
||||
|
||||
"encode (3)" in {
|
||||
val msg = AvatarAwardMessage(MeritCommendation.StandardAssault3, AwardQualificationProgress(0))
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string3
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,14 +15,14 @@ class DisplayedAwardMessageTest extends Specification {
|
|||
case DisplayedAwardMessage(player_guid, ribbon, bar) =>
|
||||
player_guid mustEqual PlanetSideGUID(1695)
|
||||
ribbon mustEqual MeritCommendation.TwoYearVS
|
||||
bar mustEqual RibbonBarsSlot.TermOfService
|
||||
bar mustEqual RibbonBarSlot.TermOfService
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = DisplayedAwardMessage(PlanetSideGUID(1695), MeritCommendation.TwoYearVS, RibbonBarsSlot.TermOfService)
|
||||
val msg = DisplayedAwardMessage(PlanetSideGUID(1695), MeritCommendation.TwoYearVS, RibbonBarSlot.TermOfService)
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue