mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-11 22:44:37 +00:00
Merge branch 'training-zone'
This commit is contained in:
commit
0e784d217f
3 changed files with 67 additions and 2 deletions
|
|
@ -457,7 +457,7 @@ object GamePacketOpcode extends Enumeration {
|
||||||
case 0x72 => game.FriendsRequest.decode
|
case 0x72 => game.FriendsRequest.decode
|
||||||
case 0x73 => game.FriendsResponse.decode
|
case 0x73 => game.FriendsResponse.decode
|
||||||
case 0x74 => noDecoder(TriggerEnvironmentalDamageMessage)
|
case 0x74 => noDecoder(TriggerEnvironmentalDamageMessage)
|
||||||
case 0x75 => noDecoder(TrainingZoneMessage)
|
case 0x75 => game.TrainingZoneMessage.decode
|
||||||
case 0x76 => noDecoder(DeployableObjectsInfoMessage)
|
case 0x76 => noDecoder(DeployableObjectsInfoMessage)
|
||||||
case 0x77 => noDecoder(SquadState)
|
case 0x77 => noDecoder(SquadState)
|
||||||
// 0x78
|
// 0x78
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
// 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._
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispatched when the player wants to go to the training zones.
|
||||||
|
* When a player enters the virtual reality hallways behind sanctuary spawn rooms and walks to the base of the ramp, he is presented with a prompt.
|
||||||
|
* From the prompt, the player accepts either "Shooting Range" or "Vehicle Training Area."<br>
|
||||||
|
* <br>
|
||||||
|
* Both sets of training zones utilize the same map for their type - `map14` for shooting and `map15` for vehicles.
|
||||||
|
* The factions are kept separate so there are actually six separated zones - two each - to accommodate the three factions.
|
||||||
|
* There is no global map notation, i.e., `map##`, for going to a faction-instance training zone map.
|
||||||
|
* The zone modifier is used in conjunction with the `LoadMapMessage` packet to determine the faction-instance of the training map.<br>
|
||||||
|
* <br>
|
||||||
|
* Players are sent to their respective empire's area by default.
|
||||||
|
* A TR player utilizing the virtual reality hallway in the NC sanctuary and will still only be offered the TR virtual reality areas.
|
||||||
|
* Black OPs do not have normal access to virtual reality areas.<br>
|
||||||
|
* <br>
|
||||||
|
* Zone:<br>
|
||||||
|
* 17 - `11` - TR Shooting Range<br>
|
||||||
|
* 18 - `12` - NC Shooting Range<br>
|
||||||
|
* 19 - `13` - VS Shooting Range<br>
|
||||||
|
* 20 - `14` - TR Vehicle Training Area<br>
|
||||||
|
* 21 - `15` - NC Vehicle Training Area<br>
|
||||||
|
* 22 - `16` - VS Vehicle Training Area
|
||||||
|
* @param zone the virtual reality zone to send the player
|
||||||
|
* @param unk na; always 0?
|
||||||
|
*/
|
||||||
|
final case class TrainingZoneMessage(zone : PlanetSideGUID,
|
||||||
|
unk : Int = 0)
|
||||||
|
extends PlanetSideGamePacket {
|
||||||
|
type Packet = TrainingZoneMessage
|
||||||
|
def opcode = GamePacketOpcode.TrainingZoneMessage
|
||||||
|
def encode = TrainingZoneMessage.encode(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
object TrainingZoneMessage extends Marshallable[TrainingZoneMessage] {
|
||||||
|
implicit val codec : Codec[TrainingZoneMessage] = (
|
||||||
|
("zone" | PlanetSideGUID.codec) ::
|
||||||
|
("unk" | uint16L)
|
||||||
|
).as[TrainingZoneMessage]
|
||||||
|
}
|
||||||
|
|
@ -1122,6 +1122,26 @@ class GamePacketTest extends Specification {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"TrainingZoneMessage" should {
|
||||||
|
val string = hex"75 13 000000"
|
||||||
|
|
||||||
|
"decode" in {
|
||||||
|
PacketCoding.DecodePacket(string).require match {
|
||||||
|
case TrainingZoneMessage(zone, unk) =>
|
||||||
|
zone mustEqual PlanetSideGUID(19)
|
||||||
|
case default =>
|
||||||
|
ko
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"encode" in {
|
||||||
|
val msg = TrainingZoneMessage(PlanetSideGUID(19))
|
||||||
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||||
|
|
||||||
|
pkt mustEqual string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
"WeaponDryFireMessage" should {
|
"WeaponDryFireMessage" should {
|
||||||
val string = hex"52 4C00"
|
val string = hex"52 4C00"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue