mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-26 06:15:21 +00:00
Packet: WeaponLazeTargetPositionMessage (#111)
* importing WeaponLazeTargetPositionMessage packet and tests; adding laze pointer to available items that can be created * minor comment and format changes
This commit is contained in:
parent
3c0b55a99e
commit
5707580631
5 changed files with 83 additions and 2 deletions
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright (c) 2016 PSForever.net to present
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import net.psforever.types.Vector3
|
||||
import scodec.bits._
|
||||
|
||||
class WeaponLazeTargetPositionMessageTest extends Specification {
|
||||
val string = hex"C8 4C00 6C2D7 65535 CA16 982D7 4A535 CA16"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case WeaponLazeTargetPositionMessage(weapon_uid, pos1, pos2) =>
|
||||
weapon_uid mustEqual PlanetSideGUID(76)
|
||||
pos1.x mustEqual 3674.8438f
|
||||
pos1.y mustEqual 2726.789f
|
||||
pos1.z mustEqual 91.15625f
|
||||
pos2.x mustEqual 3675.1875f
|
||||
pos2.y mustEqual 2726.5781f
|
||||
pos2.z mustEqual 91.15625f
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = WeaponLazeTargetPositionMessage(
|
||||
PlanetSideGUID(76),
|
||||
Vector3(3674.8438f, 2726.789f, 91.15625f),
|
||||
Vector3(3675.1875f, 2726.5781f, 91.15625f)
|
||||
)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue