using three Terminals known to the continent home3

This commit is contained in:
FateJH 2017-09-21 12:24:28 -04:00
parent 0c7c4dc58f
commit 981acadae5
4 changed files with 30 additions and 19 deletions

View file

@ -25,9 +25,9 @@ class IntergalacticCluster(continents : List[Zone]) extends Actor {
case IntergalacticCluster.RequestZoneInitialization(tplayer) => case IntergalacticCluster.RequestZoneInitialization(tplayer) =>
continents.foreach(zone => { continents.foreach(zone => {
sender ! Zone.ZoneInitialization(zone.ZoneInitialization()) sender ! Zone.ClientInitialization(zone.ClientInitialization())
}) })
sender ! IntergalacticCluster.ZoneInitializationComplete(tplayer) sender ! IntergalacticCluster.ClientInitializationComplete(tplayer)
case _ => ; case _ => ;
} }
@ -55,5 +55,5 @@ object IntergalacticCluster {
final case class RequestZoneInitialization(tplayer : Player) final case class RequestZoneInitialization(tplayer : Player)
final case class ZoneInitializationComplete(tplayer : Player) final case class ClientInitializationComplete(tplayer : Player)
} }

View file

@ -2,7 +2,7 @@
package net.psforever.objects.continent package net.psforever.objects.continent
import akka.actor.{ActorContext, ActorRef, Props} import akka.actor.{ActorContext, ActorRef, Props}
import net.psforever.objects.Player import net.psforever.objects.{PlanetSideGameObject, Player}
import net.psforever.objects.entity.IdentifiableEntity import net.psforever.objects.entity.IdentifiableEntity
import net.psforever.objects.equipment.Equipment import net.psforever.objects.equipment.Equipment
import net.psforever.objects.guid.NumberPoolHub import net.psforever.objects.guid.NumberPoolHub
@ -25,12 +25,12 @@ class Zone(id : String, zoneNumber : Int, map : String) {
if(actor == ActorRef.noSender) { if(actor == ActorRef.noSender) {
actor = context.actorOf(Props(classOf[ZoneActor], this), s"$id-actor") actor = context.actorOf(Props(classOf[ZoneActor], this), s"$id-actor")
val pool = guid.AddPool("pool", (200 to 400).toList) val pool = guid.AddPool("pool", (200 to 1000).toList)
val poolActor = context.actorOf(Props(classOf[NumberPoolActor], pool), name = s"$ZoneId-poolActor") val poolActor = context.actorOf(Props(classOf[NumberPoolActor], pool), name = s"$ZoneId-poolActor")
pool.Selector = new RandomSelector pool.Selector = new RandomSelector
accessor = context.actorOf(Props(classOf[NumberPoolAccessorActor], guid, pool, poolActor), s"$ZoneId-accessor") accessor = context.actorOf(Props(classOf[NumberPoolAccessorActor], guid, pool, poolActor), s"$ZoneId-accessor")
startupUtilities.foreach({case ((obj, uid)) => accessor ! Register(obj, uid, actor)}) startupUtilities.foreach({case ((obj, uid)) => accessor ! Register(obj, uid, actor) })
} }
actor actor
} }
@ -52,7 +52,12 @@ class Zone(id : String, zoneNumber : Int, map : String) {
accessor accessor
} }
def GUID(object_guid : PlanetSideGUID) : Option[IdentifiableEntity] = guid(object_guid.guid) def GUID(object_guid : PlanetSideGUID) : Option[PlanetSideGameObject] = guid(object_guid.guid) match {
case Some(obj) =>
Some(obj.asInstanceOf[PlanetSideGameObject]) //potential casting error
case None =>
None
}
def EquipmentOnGround : ListBuffer[Equipment] = equipmentOnGround def EquipmentOnGround : ListBuffer[Equipment] = equipmentOnGround
@ -60,11 +65,11 @@ class Zone(id : String, zoneNumber : Int, map : String) {
startupUtilities = startupUtilities :+ (obj, id) startupUtilities = startupUtilities :+ (obj, id)
} }
def ZoneInitialization() : List[GamePacket] = { def ClientInitialization() : List[GamePacket] = {
List.empty[GamePacket] List.empty[GamePacket]
} }
def ZoneConfiguration() : List[GamePacket] = { def ClientConfiguration() : List[GamePacket] = {
List.empty[GamePacket] List.empty[GamePacket]
} }
} }
@ -79,7 +84,7 @@ object Zone {
final case class ItemFromGround(player : Player, item : Equipment) final case class ItemFromGround(player : Player, item : Equipment)
final case class ZoneInitialization(list : List[GamePacket]) final case class ClientInitialization(list : List[GamePacket])
def apply(zoneId : String, zoneNumber : Int, map : String) : Zone = { def apply(zoneId : String, zoneNumber : Int, map : String) : Zone = {
new Zone(zoneId, zoneNumber, map) new Zone(zoneId, zoneNumber, map)

View file

@ -223,7 +223,10 @@ object PsLogin {
def createContinents() : List[Zone] = { def createContinents() : List[Zone] = {
val home3 = Zone("home3",13,"map13") val home3 = Zone("home3",13,"map13")
home3.AddUtility(Terminal(new OrderTerminalDefinition), 336) val orderTerm = new OrderTerminalDefinition
home3.AddUtility(Terminal(orderTerm), 853)
home3.AddUtility(Terminal(orderTerm), 855)
home3.AddUtility(Terminal(orderTerm), 860)
home3 :: home3 ::
Nil Nil

View file

@ -17,7 +17,7 @@ import net.psforever.objects.equipment._
import net.psforever.objects.guid.{Task, TaskResolver} import net.psforever.objects.guid.{Task, TaskResolver}
import net.psforever.objects.guid.actor.{Register, Unregister} import net.psforever.objects.guid.actor.{Register, Unregister}
import net.psforever.objects.inventory.{GridInventory, InventoryItem} import net.psforever.objects.inventory.{GridInventory, InventoryItem}
import net.psforever.objects.terminals.{OrderTerminalDefinition, Terminal} import net.psforever.objects.terminals.Terminal
import net.psforever.packet.game.objectcreate._ import net.psforever.packet.game.objectcreate._
import net.psforever.types._ import net.psforever.types._
@ -435,7 +435,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
galaxy ! IntergalacticCluster.GetWorld("home3") galaxy ! IntergalacticCluster.GetWorld("home3")
} }
case Zone.ZoneInitialization(/*initList*/_) => case Zone.ClientInitialization(/*initList*/_) =>
//TODO iterate over initList; for now, just do this //TODO iterate over initList; for now, just do this
sendResponse( sendResponse(
PacketCoding.CreateGamePacket(0, PacketCoding.CreateGamePacket(0,
@ -468,7 +468,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
sendResponse(PacketCoding.CreateGamePacket(0, BroadcastWarpgateUpdateMessage(PlanetSideGUID(13), PlanetSideGUID(1), false, false, true))) // VS Sanctuary: Inactive Warpgate -> Broadcast Warpgate sendResponse(PacketCoding.CreateGamePacket(0, BroadcastWarpgateUpdateMessage(PlanetSideGUID(13), PlanetSideGUID(1), false, false, true))) // VS Sanctuary: Inactive Warpgate -> Broadcast Warpgate
sendResponse(PacketCoding.CreateGamePacket(0, ZonePopulationUpdateMessage(PlanetSideGUID(13), 414, 138, 0, 138, 0, 138, 0, 138, 0))) sendResponse(PacketCoding.CreateGamePacket(0, ZonePopulationUpdateMessage(PlanetSideGUID(13), 414, 138, 0, 138, 0, 138, 0, 138, 0)))
case IntergalacticCluster.ZoneInitializationComplete(tplayer)=> case IntergalacticCluster.ClientInitializationComplete(tplayer)=>
//this will cause the client to send back a BeginZoningMessage packet (see below) //this will cause the client to send back a BeginZoningMessage packet (see below)
sendResponse(PacketCoding.CreateGamePacket(0, LoadMapMessage(continent.Map, continent.ZoneId, 40100,25,true,3770441820L))) //VS Sanctuary sendResponse(PacketCoding.CreateGamePacket(0, LoadMapMessage(continent.Map, continent.ZoneId, 40100,25,true,3770441820L))) //VS Sanctuary
log.info("Load the now-registered player") log.info("Load the now-registered player")
@ -584,8 +584,6 @@ class WorldSessionActor extends Actor with MDCContextAware {
} }
} }
val terminal = Terminal(PlanetSideGUID(55000), new OrderTerminalDefinition)
import net.psforever.objects.GlobalDefinitions._ import net.psforever.objects.GlobalDefinitions._
//this part is created by the player (should be in case of ConnectToWorldRequestMessage, maybe) //this part is created by the player (should be in case of ConnectToWorldRequestMessage, maybe)
val energy_cell_box1 = AmmoBox(energy_cell) val energy_cell_box1 = AmmoBox(energy_cell)
@ -711,7 +709,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
case msg @ BeginZoningMessage() => case msg @ BeginZoningMessage() =>
log.info("Reticulating splines ...") log.info("Reticulating splines ...")
//map-specific initializations //map-specific initializations
//TODO continent.ZoneConfiguration() //TODO continent.ClientConfiguration()
sendResponse(PacketCoding.CreateGamePacket(0, SetEmpireMessage(PlanetSideGUID(2), PlanetSideEmpire.VS))) //HART building C 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, SetEmpireMessage(PlanetSideGUID(29), PlanetSideEmpire.NC))) //South Villa Gun Tower
//sendResponse(PacketCoding.CreateGamePacket(0, object2Hex)) //sendResponse(PacketCoding.CreateGamePacket(0, object2Hex))
@ -990,9 +988,14 @@ class WorldSessionActor extends Actor with MDCContextAware {
case msg @ GenericObjectStateMsg(object_guid, unk1) => case msg @ GenericObjectStateMsg(object_guid, unk1) =>
log.info("GenericObjectState: " + msg) log.info("GenericObjectState: " + msg)
case msg @ ItemTransactionMessage(terminal_guid, transaction_type, item_page, item_name, unk1, item_guid) => case msg @ ItemTransactionMessage(terminal_guid, _, _, _, _, _) =>
terminal.Actor ! Terminal.Request(player, msg)
log.info("ItemTransaction: " + msg) log.info("ItemTransaction: " + msg)
continent.GUID(terminal_guid) match {
case Some(term : Terminal) =>
term.Actor ! Terminal.Request(player, msg)
case Some(obj : PlanetSideGameObject) => ;
case None => ;
}
case msg @ FavoritesRequest(player_guid, unk, action, line, label) => case msg @ FavoritesRequest(player_guid, unk, action, line, label) =>
if(player.GUID == player_guid) { if(player.GUID == player_guid) {