Merge pull request #86 from Fate-JH/proximity-terminal

Added: ProximityTerminalUseMessage Packet
This commit is contained in:
Fate-JH 2017-03-02 07:32:01 -05:00 committed by GitHub
commit d1a0ee2bd1
3 changed files with 55 additions and 1 deletions

View file

@ -550,7 +550,7 @@ object GamePacketOpcode extends Enumeration {
case 0xc0 => noDecoder(CaptureFlagUpdateMessage)
case 0xc1 => noDecoder(VanuModuleUpdateMessage)
case 0xc2 => noDecoder(FacilityBenefitShieldChargeRequestMessage)
case 0xc3 => noDecoder(ProximityTerminalUseMessage)
case 0xc3 => game.ProximityTerminalUseMessage.decode
case 0xc4 => game.QuantityDeltaUpdateMessage.decode
case 0xc5 => noDecoder(ChainLashMessage)
case 0xc6 => game.ZoneInfoMessage.decode

View file

@ -0,0 +1,35 @@
// 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 player's avatar has moved in relation to a set piece that reacts with the player due to his proximity.<br>
* <br>
* Elements that exhibit this behavior include Repair/Rearm Silos in facility courtyards and various cavern crystals.
* The packets are only dispatched when it is appropriate for the player to be affected.<br>
* <br>
* Exploration:<br>
* Packets where the bytes for the player's GUID are blank exist.
* @param player_guid the player
* @param object_guid the object whose functionality is triggered
* @param unk na
*/
final case class ProximityTerminalUseMessage(player_guid : PlanetSideGUID,
object_guid : PlanetSideGUID,
unk : Boolean)
extends PlanetSideGamePacket {
type Packet = ProximityTerminalUseMessage
def opcode = GamePacketOpcode.ProximityTerminalUseMessage
def encode = ProximityTerminalUseMessage.encode(this)
}
object ProximityTerminalUseMessage extends Marshallable[ProximityTerminalUseMessage] {
implicit val codec : Codec[ProximityTerminalUseMessage] = (
("player_guid" | PlanetSideGUID.codec) ::
("object_guid" | PlanetSideGUID.codec) ::
("unk" | bool)
).as[ProximityTerminalUseMessage]
}