mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-06 05:50:23 +00:00
adding the ams utility: matrix terminal c; gave it an binding sound action in WSA
This commit is contained in:
parent
df3b60882b
commit
4b2e3763f1
4 changed files with 83 additions and 6 deletions
|
|
@ -489,6 +489,8 @@ object GlobalDefinitions {
|
|||
|
||||
val ams_respawn_tube = new SpawnTubeDefinition(49) { Name = "ams_respawn_tube" }
|
||||
|
||||
val matrix_terminalc = new MatrixTerminalDefinition(519)
|
||||
|
||||
val order_terminala = new OrderTerminalABDefinition(613)
|
||||
|
||||
val order_terminalb = new OrderTerminalABDefinition(614)
|
||||
|
|
@ -2350,6 +2352,7 @@ object GlobalDefinitions {
|
|||
ams.Seats(0).ArmorRestriction = SeatArmorRestriction.NoReinforcedOrMax
|
||||
ams.MountPoints += 1 -> 0
|
||||
ams.MountPoints += 2 -> 0
|
||||
ams.Utilities += 1 -> UtilityType.matrix_terminalc
|
||||
ams.Utilities += 2 -> UtilityType.ams_respawn_tube
|
||||
ams.Utilities += 3 -> UtilityType.order_terminala
|
||||
ams.Utilities += 4 -> UtilityType.order_terminalb
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package net.psforever.objects.serverobject.terminals
|
||||
|
||||
import akka.actor.ActorContext
|
||||
import net.psforever.objects.Player
|
||||
import net.psforever.objects.serverobject.structures.Amenity
|
||||
import net.psforever.packet.game.ItemTransactionMessage
|
||||
|
||||
/**
|
||||
* The definition for any `Terminal` that is of a type "matrix_terminal".
|
||||
*/
|
||||
class MatrixTerminalDefinition(object_id : Int) extends TerminalDefinition(object_id) {
|
||||
Name = if(object_id == 517) {
|
||||
"matrix_terminala"
|
||||
}
|
||||
else if(object_id == 518) {
|
||||
"matrix_terminalb"
|
||||
}
|
||||
else if(object_id == 519) {
|
||||
"matrix_terminalc"
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("terminal must be either object id 613 or object id 614")
|
||||
}
|
||||
|
||||
override def Buy(player : Player, msg : ItemTransactionMessage) : Terminal.Exchange = Terminal.NoDeal()
|
||||
}
|
||||
|
||||
object MatrixTerminalDefinition {
|
||||
/**
|
||||
* Assemble some logic for a provided object.
|
||||
* @param obj an `Amenity` object;
|
||||
* anticipating a `Terminal` object using this same definition
|
||||
* @param context hook to the local `Actor` system
|
||||
*/
|
||||
def Setup(obj : Amenity, context : ActorContext) : Unit = {
|
||||
import akka.actor.{ActorRef, Props}
|
||||
if(obj.Actor == ActorRef.noSender) {
|
||||
obj.Actor = context.actorOf(Props(classOf[TerminalControl], obj), s"${obj.Definition.Name}_${obj.GUID.guid}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ package net.psforever.objects.vehicles
|
|||
import akka.actor.ActorContext
|
||||
import net.psforever.objects.{GlobalDefinitions, Vehicle}
|
||||
import net.psforever.objects.serverobject.structures.Amenity
|
||||
import net.psforever.objects.serverobject.terminals.{OrderTerminalABDefinition, Terminal}
|
||||
import net.psforever.objects.serverobject.terminals.{MatrixTerminalDefinition, OrderTerminalABDefinition, Terminal, TerminalDefinition}
|
||||
import net.psforever.objects.serverobject.tube.{SpawnTube, SpawnTubeDefinition}
|
||||
|
||||
/**
|
||||
|
|
@ -19,6 +19,7 @@ object UtilityType extends Enumeration {
|
|||
type Type = Value
|
||||
val
|
||||
ams_respawn_tube,
|
||||
matrix_terminalc,
|
||||
order_terminala,
|
||||
order_terminalb
|
||||
= Value
|
||||
|
|
@ -86,11 +87,31 @@ object Utility {
|
|||
*/
|
||||
private def BuildUtilityFunc(util : UtilityType.Value) : Amenity = util match {
|
||||
case UtilityType.ams_respawn_tube =>
|
||||
SpawnTube(GlobalDefinitions.ams_respawn_tube)
|
||||
new SpawnTubeUtility(GlobalDefinitions.ams_respawn_tube)
|
||||
case UtilityType.matrix_terminalc =>
|
||||
new TerminalUtility(GlobalDefinitions.matrix_terminalc)
|
||||
case UtilityType.order_terminala =>
|
||||
Terminal(GlobalDefinitions.order_terminala)
|
||||
new TerminalUtility(GlobalDefinitions.order_terminala)
|
||||
case UtilityType.order_terminalb =>
|
||||
Terminal(GlobalDefinitions.order_terminalb)
|
||||
new TerminalUtility(GlobalDefinitions.order_terminalb)
|
||||
}
|
||||
|
||||
/**
|
||||
* Override for `SpawnTube` objects so that they inherit the spatial characteristics of their `Owner`.
|
||||
* @param tubeDef the `ObjectDefinition` that constructs this object and maintains some of its immutable fields
|
||||
*/
|
||||
private class SpawnTubeUtility(tubeDef : SpawnTubeDefinition) extends SpawnTube(tubeDef) {
|
||||
override def Position = Owner.Position
|
||||
override def Orientation = Owner.Orientation
|
||||
}
|
||||
|
||||
/**
|
||||
* Override for `Terminal` objects so that they inherit the spatial characteristics of their `Owner`.
|
||||
* @param tdef the `ObjectDefinition` that constructs this object and maintains some of its immutable fields
|
||||
*/
|
||||
private class TerminalUtility(tdef : TerminalDefinition) extends Terminal(tdef) {
|
||||
override def Position = Owner.Position
|
||||
override def Orientation = Owner.Orientation
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -101,6 +122,8 @@ object Utility {
|
|||
private def SelectUtilitySetupFunc(util : UtilityType.Value) : UtilLogic = util match {
|
||||
case UtilityType.ams_respawn_tube =>
|
||||
SpawnTubeDefinition.Setup
|
||||
case UtilityType.matrix_terminalc =>
|
||||
MatrixTerminalDefinition.Setup
|
||||
case UtilityType.order_terminala =>
|
||||
OrderTerminalABDefinition.Setup
|
||||
case UtilityType.order_terminalb =>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import net.psforever.objects.serverobject.implantmech.ImplantTerminalMech
|
|||
import net.psforever.objects.serverobject.locks.IFFLock
|
||||
import net.psforever.objects.serverobject.mblocker.Locker
|
||||
import net.psforever.objects.serverobject.pad.VehicleSpawnPad
|
||||
import net.psforever.objects.serverobject.terminals.Terminal
|
||||
import net.psforever.objects.serverobject.terminals.{MatrixTerminalDefinition, Terminal}
|
||||
import net.psforever.objects.serverobject.terminals.Terminal.TerminalMessage
|
||||
import net.psforever.objects.vehicles.{AccessPermissionGroup, Utility, VehicleLockState}
|
||||
import net.psforever.objects.zones.{InterstellarCluster, Zone}
|
||||
|
|
@ -988,7 +988,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
PlanetSideEmpire.VS, //Base owned by VS
|
||||
0, //!! Field != 0 will cause malformed packet. See class def.
|
||||
None,
|
||||
PlanetSideGeneratorState.Critical, //Generator critical
|
||||
PlanetSideGeneratorState.Normal, //Generator critical
|
||||
true, //Respawn tubes destroyed
|
||||
true, //Force dome active
|
||||
16, //Tech plant lattice benefit
|
||||
|
|
@ -1969,6 +1969,15 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
}
|
||||
}
|
||||
|
||||
case Some(obj : Terminal) =>
|
||||
if(obj.Definition.isInstanceOf[MatrixTerminalDefinition]) {
|
||||
//TODO matrix spawn point; for now, just blindly bind to show work (and hope nothing breaks)
|
||||
sendResponse(PacketCoding.CreateGamePacket(0, BindPlayerMessage(1, "@ams", true, true, 0, 0, 0, obj.Position)))
|
||||
}
|
||||
else {
|
||||
sendResponse(PacketCoding.CreateGamePacket(0, UseItemMessage(avatar_guid, unk1, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType)))
|
||||
}
|
||||
|
||||
case Some(obj : PlanetSideGameObject) =>
|
||||
if(itemType != 121) {
|
||||
sendResponse(UseItemMessage(avatar_guid, unk1, object_guid, unk2, unk3, unk4, unk5, unk6, unk7, unk8, itemType))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue