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:
FateJH 2018-03-04 22:33:34 -05:00
parent b61097a22d
commit f0bec9cf3a
5 changed files with 13 additions and 12 deletions

View file

@ -12,10 +12,10 @@ import scodec.codecs._
* This generates the event message "The [empire] have captured [continent]."
* 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.
* @param continent_guid identifies the zone (continent)
* @param continent_id identifies the zone (continent)
* @param empire identifies the empire
*/
final case class ContinentalLockUpdateMessage(continent_guid : PlanetSideGUID,
final case class ContinentalLockUpdateMessage(continent_id : Int,
empire : PlanetSideEmpire.Value)
extends PlanetSideGamePacket {
type Packet = ContinentalLockUpdateMessage
@ -25,7 +25,7 @@ final case class ContinentalLockUpdateMessage(continent_guid : PlanetSideGUID,
object ContinentalLockUpdateMessage extends Marshallable[ContinentalLockUpdateMessage] {
implicit val codec : Codec[ContinentalLockUpdateMessage] = (
("continent_guid" | PlanetSideGUID.codec) ::
("continent_id" | uint16L) ::
("empire" | PlanetSideEmpire.codec)
).as[ContinentalLockUpdateMessage]
}

View file

@ -10,7 +10,7 @@ import scodec.codecs._
* @param zone the zone
* @param unk na
*/
final case class ZoneForcedCavernConnectionsMessage(zone : PlanetSideGUID,
final case class ZoneForcedCavernConnectionsMessage(zone : Int,
unk : Int)
extends PlanetSideGamePacket {
type Packet = ZoneForcedCavernConnectionsMessage
@ -20,7 +20,7 @@ final case class ZoneForcedCavernConnectionsMessage(zone : PlanetSideGUID,
object ZoneForcedCavernConnectionsMessage extends Marshallable[ZoneForcedCavernConnectionsMessage] {
implicit val codec : Codec[ZoneForcedCavernConnectionsMessage] = (
("zone" | PlanetSideGUID.codec) ::
("zone" | uint16L) ::
("unk" | uint2L)
).as[ZoneForcedCavernConnectionsMessage]
}

View file

@ -13,7 +13,7 @@ class ContinentalLockUpdateMessageTest extends Specification {
"decode" in {
PacketCoding.DecodePacket(string).require match {
case ContinentalLockUpdateMessage(continent_guid, empire) =>
continent_guid mustEqual PlanetSideGUID(22)
continent_guid mustEqual 22
empire mustEqual PlanetSideEmpire.NC
case _ =>
ko
@ -21,7 +21,7 @@ class ContinentalLockUpdateMessageTest extends Specification {
}
"encode" in {
val msg = ContinentalLockUpdateMessage(PlanetSideGUID(22), PlanetSideEmpire.NC)
val msg = ContinentalLockUpdateMessage(22, PlanetSideEmpire.NC)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string

View file

@ -21,7 +21,7 @@ class ZoneForcedCavernConnectionsMessageTest extends Specification {
}
"encode" in {
val msg = ZoneForcedCavernConnectionsMessage(PlanetSideGUID(32), 1)
val msg = ZoneForcedCavernConnectionsMessage(32, 1)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string

View file

@ -989,19 +989,20 @@ class WorldSessionActor extends Actor with MDCContextAware {
initZone.Buildings.foreach({ case(id, building) => initBuilding(continentNumber, id, building) })
sendResponse(ZonePopulationUpdateMessage(continentNumber, 414, 138, popTR, 138, popNC, 138, popVS, 138, popBO))
//ContinentLockUpdateMessage()
sendResponse(ContinentalLockUpdateMessage(continentNumber, PlanetSideEmpire.NEUTRAL))
//CaptureFlagUpdateMessage()
//VanuModuleUpdateMessage()
//ModuleLimitsMessage()
sendResponse(ZoneInfoMessage(continentNumber, true, 0))
sendResponse(ZoneLockInfoMessage(continentNumber, false, true))
//ZoneForcedCavernConnectionMessage()
sendResponse(ZoneForcedCavernConnectionsMessage(continentNumber, 0))
case InterstellarCluster.ClientInitializationComplete(tplayer)=>
//this will cause the client to send back a BeginZoningMessage packet (see below)
sendResponse(ContinentalLockUpdateMessage(PlanetSideGUID(13), PlanetSideEmpire.VS)) // "The VS have captured the VS Sanctuary."
//custom
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
//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
log.info("Load the now-registered player")
//load the now-registered player