diff --git a/common/src/main/scala/net/psforever/packet/GamePacketOpcode.scala b/common/src/main/scala/net/psforever/packet/GamePacketOpcode.scala index 6e494320..f8f02e3e 100644 --- a/common/src/main/scala/net/psforever/packet/GamePacketOpcode.scala +++ b/common/src/main/scala/net/psforever/packet/GamePacketOpcode.scala @@ -582,7 +582,7 @@ object GamePacketOpcode extends Enumeration { case 0xdc => noDecoder(SquadMainTerminalResponseMessage) case 0xdd => noDecoder(SquadOrderMessage) case 0xde => noDecoder(SquadOrderResponse) - case 0xdf => noDecoder(ZoneLockInfoMessage) + case 0xdf => game.ZoneLockInfoMessage.decode // OPCODES 0xe0-ef case 0xe0 => noDecoder(SquadBindInfoMessage) diff --git a/common/src/main/scala/net/psforever/packet/game/ZoneLockInfoMessage.scala b/common/src/main/scala/net/psforever/packet/game/ZoneLockInfoMessage.scala new file mode 100644 index 00000000..e068da55 --- /dev/null +++ b/common/src/main/scala/net/psforever/packet/game/ZoneLockInfoMessage.scala @@ -0,0 +1,32 @@ +// Copyright (c) 2016 PSForever.net to present +package net.psforever.packet.game + +import net.psforever.packet.{GamePacketOpcode, Marshallable, PlanetSideGamePacket} +import scodec.Codec +import scodec.codecs._ + +/** + * Change the "Empire Status" text in the Interstellar Map zone description for the specified zone. + * The information in the Empire Incentives window also displays the changed information.
+ * @param zone the zone id + * @param lock_status `true` displays "Locked;" + * `false` displays the queue availability for the avatar's empire + * @param unk na; + * usually `true` + */ +final case class ZoneLockInfoMessage(zone : PlanetSideGUID, + lock_status : Boolean, + unk : Boolean) + extends PlanetSideGamePacket { + type Packet = ZoneLockInfoMessage + def opcode = GamePacketOpcode.ZoneLockInfoMessage + def encode = ZoneLockInfoMessage.encode(this) +} + +object ZoneLockInfoMessage extends Marshallable[ZoneLockInfoMessage] { + implicit val codec : Codec[ZoneLockInfoMessage] = ( + ("zone" | PlanetSideGUID.codec) :: + ("lock_status" | bool) :: + ("unk" | bool) + ).as[ZoneLockInfoMessage] +} diff --git a/common/src/test/scala/GamePacketTest.scala b/common/src/test/scala/GamePacketTest.scala index 903b62f0..7eac851e 100644 --- a/common/src/test/scala/GamePacketTest.scala +++ b/common/src/test/scala/GamePacketTest.scala @@ -1462,6 +1462,28 @@ class GamePacketTest extends Specification { } } + "ZoneLockInfoMesage" should { + val string = hex"DF 1B 00 40" + + "decode" in { + PacketCoding.DecodePacket(string).require match { + case ZoneLockInfoMessage(zone, locked, unk) => + zone mustEqual PlanetSideGUID(27) + locked mustEqual false + unk mustEqual true + case default => + ko + } + } + + "encode" in { + val msg = ZoneLockInfoMessage(PlanetSideGUID(27), false, true) + val pkt = PacketCoding.EncodePacket(msg).require.toByteVector + + pkt mustEqual string + } + } + "BattleExperienceMessage" should { val string = hex"B4 8A0A E7030000 00"