added TrainingZoneMessage packet; rudimentary comments, but no tests

This commit is contained in:
FateJH 2016-09-22 21:34:00 -04:00
parent daa22c572e
commit 37778229dc
2 changed files with 39 additions and 1 deletions

View file

@ -457,7 +457,7 @@ object GamePacketOpcode extends Enumeration {
case 0x72 => noDecoder(FriendsRequest)
case 0x73 => noDecoder(FriendsResponse)
case 0x74 => noDecoder(TriggerEnvironmentalDamageMessage)
case 0x75 => noDecoder(TrainingZoneMessage)
case 0x75 => game.TrainingZoneMessage.decode
case 0x76 => noDecoder(DeployableObjectsInfoMessage)
case 0x77 => noDecoder(SquadState)
// 0x78

View file

@ -0,0 +1,38 @@
// 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._
/**
* The client is telling the server that the player wants to go to the training zones.<br>
* <br>
* This message is dispatched when a player enters the VR hallway / VR teleport and accepts the "Shooting Range" or the "Vehicle Training Area" options on the prompt.
* The packet sends indication to the server (as if it didn't know?) in regards to which training grounds the player should be sent.
* Players are sent to their respective empire's area by default.<br>
* @param unk1 na;
* 19 (`13`) when shooting range;
* 22 (`16`) when ground vehicle range
* @param unk2 na; always zero?
* @param unk3 na; always zero?
* @param unk4 na; always zero?
*/
final case class TrainingZoneMessage(unk1 : Int,
unk2 : Int,
unk3 : Int,
unk4 : Int)
extends PlanetSideGamePacket {
type Packet = TrainingZoneMessage
def opcode = GamePacketOpcode.TrainingZoneMessage
def encode = TrainingZoneMessage.encode(this)
}
object TrainingZoneMessage extends Marshallable[TrainingZoneMessage] {
implicit val codec : Codec[TrainingZoneMessage] = (
("unk1" | uint8L) ::
("unk2" | uint8L) ::
("unk3" | uint8L) ::
("unk4" | uint8L)
).as[TrainingZoneMessage]
}