mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-28 23:35:23 +00:00
changing continent id to normal data types and away from PlanetSideGUID in ZoneForcedCavernConnections and ContinentalLockUpdate; implementing ForcedZoneCavernConnections and ContinentalLockUpdate in WSA
This commit is contained in:
parent
b61097a22d
commit
f0bec9cf3a
5 changed files with 13 additions and 12 deletions
|
|
@ -12,10 +12,10 @@ import scodec.codecs._
|
||||||
* This generates the event message "The [empire] have captured [continent]."
|
* This generates the event message "The [empire] have captured [continent]."
|
||||||
* If the continent_guid is not a valid zone, no message is displayed.
|
* If the continent_guid is not a valid zone, no message is displayed.
|
||||||
* If empire is not a valid empire, or refers to the neutral or Black Ops forces, no message is displayed.
|
* If empire is not a valid empire, or refers to the neutral or Black Ops forces, no message is displayed.
|
||||||
* @param continent_guid identifies the zone (continent)
|
* @param continent_id identifies the zone (continent)
|
||||||
* @param empire identifies the empire
|
* @param empire identifies the empire
|
||||||
*/
|
*/
|
||||||
final case class ContinentalLockUpdateMessage(continent_guid : PlanetSideGUID,
|
final case class ContinentalLockUpdateMessage(continent_id : Int,
|
||||||
empire : PlanetSideEmpire.Value)
|
empire : PlanetSideEmpire.Value)
|
||||||
extends PlanetSideGamePacket {
|
extends PlanetSideGamePacket {
|
||||||
type Packet = ContinentalLockUpdateMessage
|
type Packet = ContinentalLockUpdateMessage
|
||||||
|
|
@ -25,7 +25,7 @@ final case class ContinentalLockUpdateMessage(continent_guid : PlanetSideGUID,
|
||||||
|
|
||||||
object ContinentalLockUpdateMessage extends Marshallable[ContinentalLockUpdateMessage] {
|
object ContinentalLockUpdateMessage extends Marshallable[ContinentalLockUpdateMessage] {
|
||||||
implicit val codec : Codec[ContinentalLockUpdateMessage] = (
|
implicit val codec : Codec[ContinentalLockUpdateMessage] = (
|
||||||
("continent_guid" | PlanetSideGUID.codec) ::
|
("continent_id" | uint16L) ::
|
||||||
("empire" | PlanetSideEmpire.codec)
|
("empire" | PlanetSideEmpire.codec)
|
||||||
).as[ContinentalLockUpdateMessage]
|
).as[ContinentalLockUpdateMessage]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import scodec.codecs._
|
||||||
* @param zone the zone
|
* @param zone the zone
|
||||||
* @param unk na
|
* @param unk na
|
||||||
*/
|
*/
|
||||||
final case class ZoneForcedCavernConnectionsMessage(zone : PlanetSideGUID,
|
final case class ZoneForcedCavernConnectionsMessage(zone : Int,
|
||||||
unk : Int)
|
unk : Int)
|
||||||
extends PlanetSideGamePacket {
|
extends PlanetSideGamePacket {
|
||||||
type Packet = ZoneForcedCavernConnectionsMessage
|
type Packet = ZoneForcedCavernConnectionsMessage
|
||||||
|
|
@ -20,7 +20,7 @@ final case class ZoneForcedCavernConnectionsMessage(zone : PlanetSideGUID,
|
||||||
|
|
||||||
object ZoneForcedCavernConnectionsMessage extends Marshallable[ZoneForcedCavernConnectionsMessage] {
|
object ZoneForcedCavernConnectionsMessage extends Marshallable[ZoneForcedCavernConnectionsMessage] {
|
||||||
implicit val codec : Codec[ZoneForcedCavernConnectionsMessage] = (
|
implicit val codec : Codec[ZoneForcedCavernConnectionsMessage] = (
|
||||||
("zone" | PlanetSideGUID.codec) ::
|
("zone" | uint16L) ::
|
||||||
("unk" | uint2L)
|
("unk" | uint2L)
|
||||||
).as[ZoneForcedCavernConnectionsMessage]
|
).as[ZoneForcedCavernConnectionsMessage]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ class ContinentalLockUpdateMessageTest extends Specification {
|
||||||
"decode" in {
|
"decode" in {
|
||||||
PacketCoding.DecodePacket(string).require match {
|
PacketCoding.DecodePacket(string).require match {
|
||||||
case ContinentalLockUpdateMessage(continent_guid, empire) =>
|
case ContinentalLockUpdateMessage(continent_guid, empire) =>
|
||||||
continent_guid mustEqual PlanetSideGUID(22)
|
continent_guid mustEqual 22
|
||||||
empire mustEqual PlanetSideEmpire.NC
|
empire mustEqual PlanetSideEmpire.NC
|
||||||
case _ =>
|
case _ =>
|
||||||
ko
|
ko
|
||||||
|
|
@ -21,7 +21,7 @@ class ContinentalLockUpdateMessageTest extends Specification {
|
||||||
}
|
}
|
||||||
|
|
||||||
"encode" in {
|
"encode" in {
|
||||||
val msg = ContinentalLockUpdateMessage(PlanetSideGUID(22), PlanetSideEmpire.NC)
|
val msg = ContinentalLockUpdateMessage(22, PlanetSideEmpire.NC)
|
||||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||||
|
|
||||||
pkt mustEqual string
|
pkt mustEqual string
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class ZoneForcedCavernConnectionsMessageTest extends Specification {
|
||||||
}
|
}
|
||||||
|
|
||||||
"encode" in {
|
"encode" in {
|
||||||
val msg = ZoneForcedCavernConnectionsMessage(PlanetSideGUID(32), 1)
|
val msg = ZoneForcedCavernConnectionsMessage(32, 1)
|
||||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||||
|
|
||||||
pkt mustEqual string
|
pkt mustEqual string
|
||||||
|
|
|
||||||
|
|
@ -989,19 +989,20 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
|
|
||||||
initZone.Buildings.foreach({ case(id, building) => initBuilding(continentNumber, id, building) })
|
initZone.Buildings.foreach({ case(id, building) => initBuilding(continentNumber, id, building) })
|
||||||
sendResponse(ZonePopulationUpdateMessage(continentNumber, 414, 138, popTR, 138, popNC, 138, popVS, 138, popBO))
|
sendResponse(ZonePopulationUpdateMessage(continentNumber, 414, 138, popTR, 138, popNC, 138, popVS, 138, popBO))
|
||||||
//ContinentLockUpdateMessage()
|
sendResponse(ContinentalLockUpdateMessage(continentNumber, PlanetSideEmpire.NEUTRAL))
|
||||||
//CaptureFlagUpdateMessage()
|
//CaptureFlagUpdateMessage()
|
||||||
//VanuModuleUpdateMessage()
|
//VanuModuleUpdateMessage()
|
||||||
//ModuleLimitsMessage()
|
//ModuleLimitsMessage()
|
||||||
sendResponse(ZoneInfoMessage(continentNumber, true, 0))
|
sendResponse(ZoneInfoMessage(continentNumber, true, 0))
|
||||||
sendResponse(ZoneLockInfoMessage(continentNumber, false, true))
|
sendResponse(ZoneLockInfoMessage(continentNumber, false, true))
|
||||||
//ZoneForcedCavernConnectionMessage()
|
sendResponse(ZoneForcedCavernConnectionsMessage(continentNumber, 0))
|
||||||
|
|
||||||
case InterstellarCluster.ClientInitializationComplete(tplayer)=>
|
case InterstellarCluster.ClientInitializationComplete(tplayer)=>
|
||||||
//this will cause the client to send back a BeginZoningMessage packet (see below)
|
//custom
|
||||||
sendResponse(ContinentalLockUpdateMessage(PlanetSideGUID(13), PlanetSideEmpire.VS)) // "The VS have captured the VS Sanctuary."
|
sendResponse(ContinentalLockUpdateMessage(13, PlanetSideEmpire.VS)) // "The VS have captured the VS Sanctuary."
|
||||||
sendResponse(BroadcastWarpgateUpdateMessage(PlanetSideGUID(13), PlanetSideGUID(1), false, false, true)) // VS Sanctuary: Inactive Warpgate -> Broadcast Warpgate
|
sendResponse(BroadcastWarpgateUpdateMessage(PlanetSideGUID(13), PlanetSideGUID(1), false, false, true)) // VS Sanctuary: Inactive Warpgate -> Broadcast Warpgate
|
||||||
|
|
||||||
|
//this will cause the client to send back a BeginZoningMessage packet (see below)
|
||||||
sendResponse(LoadMapMessage(continent.Map.Name, continent.Id, 40100,25,true,3770441820L)) //VS Sanctuary
|
sendResponse(LoadMapMessage(continent.Map.Name, continent.Id, 40100,25,true,3770441820L)) //VS Sanctuary
|
||||||
log.info("Load the now-registered player")
|
log.info("Load the now-registered player")
|
||||||
//load the now-registered player
|
//load the now-registered player
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue