mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-02-22 16:13:35 +00:00
initial work on BeginZoningMessage; working tests (not like there's anything to test in the tests)
This commit is contained in:
parent
68473dda45
commit
9f783572cd
4 changed files with 50 additions and 1 deletions
|
|
@ -398,7 +398,7 @@ object GamePacketOpcode extends Enumeration {
|
|||
case 0x40 => noDecoder(MountVehicleCargoMsg)
|
||||
case 0x41 => noDecoder(DismountVehicleCargoMsg)
|
||||
case 0x42 => noDecoder(CargoMountPointStatusMessage)
|
||||
case 0x43 => noDecoder(BeginZoningMessage)
|
||||
case 0x43 => game.BeginZoningMessage.decode
|
||||
case 0x44 => game.ItemTransactionMessage.decode
|
||||
case 0x45 => game.ItemTransactionResultMessage.decode
|
||||
case 0x46 => game.ChangeFireModeMessage.decode
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package net.psforever.packet.game
|
||||
|
||||
import net.psforever.packet.{GamePacketOpcode, Marshallable, PacketHelpers, PlanetSideGamePacket}
|
||||
import scodec.Codec
|
||||
|
||||
/**
|
||||
* na
|
||||
*/
|
||||
final case class BeginZoningMessage()
|
||||
extends PlanetSideGamePacket {
|
||||
type Packet = BeginZoningMessage
|
||||
def opcode = GamePacketOpcode.BeginZoningMessage
|
||||
def encode = BeginZoningMessage.encode(this)
|
||||
}
|
||||
|
||||
object BeginZoningMessage extends Marshallable[BeginZoningMessage] {
|
||||
implicit val codec : Codec[BeginZoningMessage] = PacketHelpers.emptyCodec(BeginZoningMessage())
|
||||
}
|
||||
27
common/src/test/scala/game/BeginZoningMessageTest.scala
Normal file
27
common/src/test/scala/game/BeginZoningMessageTest.scala
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import scodec.bits._
|
||||
|
||||
class BeginZoningMessageTest extends Specification {
|
||||
val string = hex"43" //yes, just the opcode
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case BeginZoningMessage() =>
|
||||
ok
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = BeginZoningMessage()
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue