mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-12 15:04:39 +00:00
Packet: SetEmpireMessage
This commit is contained in:
commit
93fe7d6be8
4 changed files with 51 additions and 1 deletions
|
|
@ -361,7 +361,7 @@ object GamePacketOpcode extends Enumeration {
|
||||||
case ActionProgressMessage => noDecoder(opcode)
|
case ActionProgressMessage => noDecoder(opcode)
|
||||||
case ActionCancelMessage => noDecoder(opcode)
|
case ActionCancelMessage => noDecoder(opcode)
|
||||||
case ActionCancelAcknowledgeMessage => noDecoder(opcode)
|
case ActionCancelAcknowledgeMessage => noDecoder(opcode)
|
||||||
case SetEmpireMessage => noDecoder(opcode)
|
case SetEmpireMessage => game.SetEmpireMessage.decode
|
||||||
case EmoteMsg => game.EmoteMsg.decode
|
case EmoteMsg => game.EmoteMsg.decode
|
||||||
case UnuseItemMessage => noDecoder(opcode)
|
case UnuseItemMessage => noDecoder(opcode)
|
||||||
case ObjectDetachMessage => noDecoder(opcode)
|
case ObjectDetachMessage => noDecoder(opcode)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright (c) 2016 PSForever.net to present
|
||||||
|
package net.psforever.packet.game
|
||||||
|
|
||||||
|
import net.psforever.packet.{GamePacketOpcode, Marshallable, PacketHelpers, PlanetSideGamePacket}
|
||||||
|
import scodec.Codec
|
||||||
|
import scodec.codecs._
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The object_guid space for SetEmpireMessage is continent specific.
|
||||||
|
* SetEmpireMessage is usually followed by HackMessage (indicating the hack disposition of the same object_guid)
|
||||||
|
*/
|
||||||
|
final case class SetEmpireMessage(object_guid : PlanetSideGUID,
|
||||||
|
empire : PlanetSideEmpire.Value)
|
||||||
|
extends PlanetSideGamePacket {
|
||||||
|
type Packet = SetEmpireMessage
|
||||||
|
def opcode = GamePacketOpcode.SetEmpireMessage
|
||||||
|
def encode = SetEmpireMessage.encode(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
object SetEmpireMessage extends Marshallable[SetEmpireMessage] {
|
||||||
|
implicit val codec : Codec[SetEmpireMessage] = (
|
||||||
|
("object_guid" | PlanetSideGUID.codec) ::
|
||||||
|
("empire" | PlanetSideEmpire.codec)
|
||||||
|
).as[SetEmpireMessage]
|
||||||
|
}
|
||||||
|
|
@ -816,6 +816,27 @@ class GamePacketTest extends Specification {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"SetEmpireMessage" should {
|
||||||
|
val string = hex"24 02 00 80"
|
||||||
|
|
||||||
|
"decode" in {
|
||||||
|
PacketCoding.DecodePacket(string).require match {
|
||||||
|
case SetEmpireMessage(object_guid, empire) =>
|
||||||
|
object_guid mustEqual PlanetSideGUID(2)
|
||||||
|
empire mustEqual PlanetSideEmpire.VS
|
||||||
|
case default =>
|
||||||
|
ko
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"encode" in {
|
||||||
|
val msg = SetEmpireMessage(PlanetSideGUID(2), PlanetSideEmpire.VS)
|
||||||
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||||
|
|
||||||
|
pkt mustEqual string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
"PingMsg" should {
|
"PingMsg" should {
|
||||||
val packet = hex"1a 00000000 b0360000"
|
val packet = hex"1a 00000000 b0360000"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,10 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
sendRawResponse(hex"31 85 6D 61 70 31 33 85 68 6F 6D 65 33 A4 9C 19 00 00 00 AE 30 5E 70 00 ")
|
sendRawResponse(hex"31 85 6D 61 70 31 33 85 68 6F 6D 65 33 A4 9C 19 00 00 00 AE 30 5E 70 00 ")
|
||||||
sendRawResponse(objectHex)
|
sendRawResponse(objectHex)
|
||||||
|
|
||||||
|
// These object_guids are specfic to VS Sanc
|
||||||
|
sendResponse(PacketCoding.CreateGamePacket(0, SetEmpireMessage(PlanetSideGUID(2), PlanetSideEmpire.VS))) //HART building C
|
||||||
|
sendResponse(PacketCoding.CreateGamePacket(0, SetEmpireMessage(PlanetSideGUID(29), PlanetSideEmpire.NC))) //South Villa Gun Tower
|
||||||
|
|
||||||
sendResponse(PacketCoding.CreateGamePacket(0, ContinentalLockUpdateMessage(PlanetSideGUID(13), PlanetSideEmpire.VS))) // "The VS have captured the VS Sanctuary."
|
sendResponse(PacketCoding.CreateGamePacket(0, ContinentalLockUpdateMessage(PlanetSideGUID(13), PlanetSideEmpire.VS))) // "The VS have captured the VS Sanctuary."
|
||||||
sendResponse(PacketCoding.CreateGamePacket(0, BroadcastWarpgateUpdateMessage(PlanetSideGUID(13), PlanetSideGUID(1), 32))) // VS Sanctuary: Inactive Warpgate -> Broadcast Warpgate
|
sendResponse(PacketCoding.CreateGamePacket(0, BroadcastWarpgateUpdateMessage(PlanetSideGUID(13), PlanetSideGUID(1), 32))) // VS Sanctuary: Inactive Warpgate -> Broadcast Warpgate
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue