mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-29 15:55:23 +00:00
changes to quiet the warnings since the 2.13.2 update
This commit is contained in:
parent
222697aee8
commit
6f4eac9e43
56 changed files with 366 additions and 346 deletions
|
|
@ -45,8 +45,8 @@ lazy val commonSettings = Seq(
|
||||||
"com.github.t3hnar" %% "scala-bcrypt" % "4.1",
|
"com.github.t3hnar" %% "scala-bcrypt" % "4.1",
|
||||||
"org.ini4j" % "ini4j" % "0.5.4",
|
"org.ini4j" % "ini4j" % "0.5.4",
|
||||||
"org.scala-graph" %% "graph-core" % "1.13.1",
|
"org.scala-graph" %% "graph-core" % "1.13.1",
|
||||||
"io.kamon" %% "kamon-bundle" % "2.1.0",
|
// "io.kamon" %% "kamon-bundle" % "2.1.0",
|
||||||
"io.kamon" %% "kamon-apm-reporter" % "2.1.0",
|
// "io.kamon" %% "kamon-apm-reporter" % "2.1.0",
|
||||||
"org.json4s" %% "json4s-native" % "3.6.8",
|
"org.json4s" %% "json4s-native" % "3.6.8",
|
||||||
"com.typesafe.akka" %% "akka-stream" % "2.6.5",
|
"com.typesafe.akka" %% "akka-stream" % "2.6.5",
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ trait ConfigParser {
|
||||||
Valid
|
Valid
|
||||||
}
|
}
|
||||||
|
|
||||||
def ReplaceConfig(map : Map[String, Any]) {
|
def ReplaceConfig(map : Map[String, Any]) : Unit = {
|
||||||
config_map = map
|
config_map = map
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ trait Constraints {
|
||||||
errorMessage: String = "error.min",
|
errorMessage: String = "error.min",
|
||||||
strictErrorMessage: String = "error.min.strict"
|
strictErrorMessage: String = "error.min.strict"
|
||||||
)(implicit ordering: scala.math.Ordering[T]): Constraint[T] = Constraint[T]("constraint.min", minValue) { o =>
|
)(implicit ordering: scala.math.Ordering[T]): Constraint[T] = Constraint[T]("constraint.min", minValue) { o =>
|
||||||
(ordering.compare(o, minValue).signum, strict) match {
|
(ordering.compare(o, minValue).sign, strict) match {
|
||||||
case (1, _) | (0, false) => Valid
|
case (1, _) | (0, false) => Valid
|
||||||
case (_, false) => Invalid(ValidationError(errorMessage, minValue))
|
case (_, false) => Invalid(ValidationError(errorMessage, minValue))
|
||||||
case (_, true) => Invalid(ValidationError(strictErrorMessage, minValue))
|
case (_, true) => Invalid(ValidationError(strictErrorMessage, minValue))
|
||||||
|
|
@ -145,7 +145,7 @@ trait Constraints {
|
||||||
errorMessage: String = "error.max",
|
errorMessage: String = "error.max",
|
||||||
strictErrorMessage: String = "error.max.strict"
|
strictErrorMessage: String = "error.max.strict"
|
||||||
)(implicit ordering: scala.math.Ordering[T]): Constraint[T] = Constraint[T]("constraint.max", maxValue) { o =>
|
)(implicit ordering: scala.math.Ordering[T]): Constraint[T] = Constraint[T]("constraint.max", maxValue) { o =>
|
||||||
(ordering.compare(o, maxValue).signum, strict) match {
|
(ordering.compare(o, maxValue).sign, strict) match {
|
||||||
case (-1, _) | (0, false) => Valid
|
case (-1, _) | (0, false) => Valid
|
||||||
case (_, false) => Invalid(ValidationError(errorMessage, maxValue))
|
case (_, false) => Invalid(ValidationError(errorMessage, maxValue))
|
||||||
case (_, true) => Invalid(ValidationError(strictErrorMessage, maxValue))
|
case (_, true) => Invalid(ValidationError(strictErrorMessage, maxValue))
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ final class QuantizedDoubleCodec(min: Double, max: Double, bits: Int) extends Co
|
||||||
}
|
}
|
||||||
|
|
||||||
def UnquantizeDouble(value : Int) : Double = {
|
def UnquantizeDouble(value : Int) : Double = {
|
||||||
return ((max - min) * value.toDouble / (1 << bitsL).toDouble + min)
|
return ((max - min) * value.toDouble / (1 << bitsL.toInt).toDouble + min)
|
||||||
}
|
}
|
||||||
|
|
||||||
override def encode(value: Double) = {
|
override def encode(value: Double) = {
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ class Player(private val core : Avatar) extends PlanetSideServerObject
|
||||||
def Capacitor : Float = capacitor
|
def Capacitor : Float = capacitor
|
||||||
|
|
||||||
def Capacitor_=(value : Float) : Float = {
|
def Capacitor_=(value : Float) : Float = {
|
||||||
val newValue = math.min(math.max(0, value), ExoSuitDef.MaxCapacitor)
|
val newValue = math.min(math.max(0, value), ExoSuitDef.MaxCapacitor.toFloat)
|
||||||
|
|
||||||
if(newValue < capacitor) {
|
if(newValue < capacitor) {
|
||||||
capacitorLastUsedMillis = System.currentTimeMillis()
|
capacitorLastUsedMillis = System.currentTimeMillis()
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ object SpawnPoint {
|
||||||
val z = ori.z
|
val z = ori.z
|
||||||
val zrot = (z + 90) % 360
|
val zrot = (z + 90) % 360
|
||||||
val zrad = math.toRadians(zrot)
|
val zrad = math.toRadians(zrot)
|
||||||
val shift = Vector3(math.sin(zrad).toFloat, math.cos(zrad).toFloat, 0) * (3 * side) //x=sin, y=cos because compass-0 is East, not North
|
val shift = Vector3(math.sin(zrad).toFloat, math.cos(zrad).toFloat, 0) * (3 * side).toFloat //x=sin, y=cos because compass-0 is East, not North
|
||||||
(
|
(
|
||||||
obj.Position + shift + (if(x >= 330) { //ams leaning to the left
|
obj.Position + shift + (if(x >= 330) { //ams leaning to the left
|
||||||
Vector3.z(xsin)
|
Vector3.z(xsin)
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class PlayerControl(player : Player) extends Actor
|
||||||
}
|
}
|
||||||
|
|
||||||
if(implant.StaminaCost > 0 && implant.GetCostIntervalByExoSuit(player.ExoSuit) > 0) { // Ongoing stamina drain, if applicable
|
if(implant.StaminaCost > 0 && implant.GetCostIntervalByExoSuit(player.ExoSuit) > 0) { // Ongoing stamina drain, if applicable
|
||||||
implantSlotStaminaDrainTimers(slot) = context.system.scheduler.schedule(0 seconds, implant.GetCostIntervalByExoSuit(player.ExoSuit) milliseconds, self, Player.DrainStamina(implant.StaminaCost))
|
implantSlotStaminaDrainTimers(slot) = context.system.scheduler.scheduleWithFixedDelay(0 seconds, implant.GetCostIntervalByExoSuit(player.ExoSuit) milliseconds, self, Player.DrainStamina(implant.StaminaCost))
|
||||||
}
|
}
|
||||||
|
|
||||||
player.Zone.AvatarEvents ! AvatarServiceMessage(player.Zone.Id, AvatarAction.PlanetsideAttribute(player.GUID, 28, player.Implant(slot).id * 2 + 1)) // Activation sound / effect
|
player.Zone.AvatarEvents ! AvatarServiceMessage(player.Zone.Id, AvatarAction.PlanetsideAttribute(player.GUID, 28, player.Implant(slot).id * 2 + 1)) // Activation sound / effect
|
||||||
|
|
|
||||||
|
|
@ -166,8 +166,8 @@ object ProjectileDefinition {
|
||||||
}
|
}
|
||||||
|
|
||||||
def CalculateDerivedFields(pdef : ProjectileDefinition) : Unit = {
|
def CalculateDerivedFields(pdef : ProjectileDefinition) : Unit = {
|
||||||
val (distanceMax, distanceFromAcceleration, finalVelocity) : (Float, Float, Float) = if(pdef.Acceleration == 0f) {
|
val (distanceMax, distanceFromAcceleration, finalVelocity) : (Float, Float, Float) = if(pdef.Acceleration == 0) {
|
||||||
(pdef.InitialVelocity * pdef.Lifespan, 0, pdef.InitialVelocity)
|
(pdef.InitialVelocity * pdef.Lifespan, 0, pdef.InitialVelocity.toFloat)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val distanceFromAcceleration = (pdef.AccelerationUntil * pdef.InitialVelocity) + (0.5f * pdef.Acceleration * pdef.AccelerationUntil * pdef.AccelerationUntil)
|
val distanceFromAcceleration = (pdef.AccelerationUntil * pdef.InitialVelocity) + (0.5f * pdef.Acceleration * pdef.AccelerationUntil * pdef.AccelerationUntil)
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ object AvatarConverter {
|
||||||
DressBattleRank(obj),
|
DressBattleRank(obj),
|
||||||
0,
|
0,
|
||||||
DressCommandRank(obj),
|
DressCommandRank(obj),
|
||||||
MakeImplantEffectList(obj.Implants),
|
MakeImplantEffectList(obj.Implants.toIndexedSeq),
|
||||||
MakeCosmetics(obj)
|
MakeCosmetics(obj)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ class TaskResolver() extends Actor {
|
||||||
*/
|
*/
|
||||||
private def StartTimeoutCheck() : Unit = {
|
private def StartTimeoutCheck() : Unit = {
|
||||||
if(timeoutCleanup.isCancelled) {
|
if(timeoutCleanup.isCancelled) {
|
||||||
timeoutCleanup = context.system.scheduler.schedule(500 milliseconds, 500 milliseconds, self, TaskResolver.TimeoutCleanup())
|
timeoutCleanup = context.system.scheduler.scheduleWithFixedDelay(500 milliseconds, 500 milliseconds, self, TaskResolver.TimeoutCleanup())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,8 +156,8 @@ object GeneratorControl {
|
||||||
*/
|
*/
|
||||||
def DamageAwareness(target : Generator, cause : ResolvedProjectile, amount : Int) : Unit = {
|
def DamageAwareness(target : Generator, cause : ResolvedProjectile, amount : Int) : Unit = {
|
||||||
if(!target.Destroyed) {
|
if(!target.Destroyed) {
|
||||||
val health : Float = target.Health
|
val health : Float = target.Health.toFloat
|
||||||
val max : Float = target.MaxHealth
|
val max : Float = target.MaxHealth.toFloat
|
||||||
if(target.Condition != PlanetSideGeneratorState.Critical && health / max < 0.51f) { //becoming critical
|
if(target.Condition != PlanetSideGeneratorState.Critical && health / max < 0.51f) { //becoming critical
|
||||||
target.Condition = PlanetSideGeneratorState.Critical
|
target.Condition = PlanetSideGeneratorState.Critical
|
||||||
GeneratorControl.UpdateOwner(target)
|
GeneratorControl.UpdateOwner(target)
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ object GenericHackables {
|
||||||
def GetHackSpeed(player : Player, obj: PlanetSideServerObject): Float = {
|
def GetHackSpeed(player : Player, obj: PlanetSideServerObject): Float = {
|
||||||
val playerHackLevel = Player.GetHackLevel(player)
|
val playerHackLevel = Player.GetHackLevel(player)
|
||||||
val timeToHack = obj match {
|
val timeToHack = obj match {
|
||||||
case vehicle : Vehicle => vehicle.JackingDuration(playerHackLevel)
|
case vehicle : Vehicle => vehicle.JackingDuration(playerHackLevel).toFloat
|
||||||
case hackable : Hackable => hackable.HackDuration(playerHackLevel)
|
case hackable : Hackable => hackable.HackDuration(playerHackLevel).toFloat
|
||||||
case _ =>
|
case _ =>
|
||||||
log.warn(s"${player.Name} tried to hack an object that has no hack time defined - ${obj.Definition.Name}#${obj.GUID} on ${obj.Zone.Id}")
|
log.warn(s"${player.Name} tried to hack an object that has no hack time defined - ${obj.Definition.Name}#${obj.GUID} on ${obj.Zone.Id}")
|
||||||
0f
|
0f
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ class VehicleSpawnControl(pad : VehicleSpawnPad) extends VehicleSpawnControlBase
|
||||||
case Some(entry) =>
|
case Some(entry) =>
|
||||||
if(periodicReminder.isCancelled) {
|
if(periodicReminder.isCancelled) {
|
||||||
trace (s"the pad has become blocked by ${entry.vehicle.Definition.Name}")
|
trace (s"the pad has become blocked by ${entry.vehicle.Definition.Name}")
|
||||||
periodicReminder = context.system.scheduler.schedule(
|
periodicReminder = context.system.scheduler.scheduleWithFixedDelay(
|
||||||
VehicleSpawnControl.initialReminderDelay,
|
VehicleSpawnControl.initialReminderDelay,
|
||||||
VehicleSpawnControl.periodicReminderDelay,
|
VehicleSpawnControl.periodicReminderDelay,
|
||||||
self, VehicleSpawnControl.ProcessControl.Reminder
|
self, VehicleSpawnControl.ProcessControl.Reminder
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ class PainboxControl(painbox: Painbox) extends Actor {
|
||||||
case Painbox.Start() =>
|
case Painbox.Start() =>
|
||||||
context.become(Running)
|
context.become(Running)
|
||||||
painboxTick.cancel
|
painboxTick.cancel
|
||||||
painboxTick = context.system.scheduler.schedule(0 seconds, 1 second, self, Painbox.Tick())
|
painboxTick = context.system.scheduler.scheduleWithFixedDelay(0 seconds, 1 second, self, Painbox.Tick())
|
||||||
|
|
||||||
case _ => ;
|
case _ => ;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ class ProximityTerminalControl(term : Terminal with ProximityUnit) extends Actor
|
||||||
val medDef = term.Definition.asInstanceOf[MedicalTerminalDefinition]
|
val medDef = term.Definition.asInstanceOf[MedicalTerminalDefinition]
|
||||||
import scala.concurrent.ExecutionContext.Implicits.global
|
import scala.concurrent.ExecutionContext.Implicits.global
|
||||||
terminalAction.cancel
|
terminalAction.cancel
|
||||||
terminalAction = context.system.scheduler.schedule(500 milliseconds, medDef.Interval, self, ProximityTerminalControl.TerminalAction())
|
terminalAction = context.system.scheduler.scheduleWithFixedDelay(500 milliseconds, medDef.Interval, self, ProximityTerminalControl.TerminalAction())
|
||||||
TerminalObject.Zone.LocalEvents ! Terminal.StartProximityEffect(term)
|
TerminalObject.Zone.LocalEvents ! Terminal.StartProximityEffect(term)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class FacilityTurretControl(turret : FacilityTurret) extends Actor
|
||||||
weaponAmmoRechargeTimer.cancel()
|
weaponAmmoRechargeTimer.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
weaponAmmoRechargeTimer = context.system.scheduler.schedule(3 seconds, 200 milliseconds, self, FacilityTurret.RechargeAmmo())
|
weaponAmmoRechargeTimer = context.system.scheduler.scheduleWithFixedDelay(3 seconds, 200 milliseconds, self, FacilityTurret.RechargeAmmo())
|
||||||
|
|
||||||
case FacilityTurret.RechargeAmmo() =>
|
case FacilityTurret.RechargeAmmo() =>
|
||||||
val weapon = turret.ControlledWeapon(1).get.asInstanceOf[net.psforever.objects.Tool]
|
val weapon = turret.ControlledWeapon(1).get.asInstanceOf[net.psforever.objects.Tool]
|
||||||
|
|
|
||||||
|
|
@ -25,5 +25,5 @@ trait StandardResistanceProfile extends ResistanceProfile {
|
||||||
|
|
||||||
def ResistanceAggravated : Int = resistDef.ResistanceDirectHit
|
def ResistanceAggravated : Int = resistDef.ResistanceDirectHit
|
||||||
|
|
||||||
def RadiationShielding : Float = resistDef.ResistanceDirectHit
|
def RadiationShielding : Float = resistDef.ResistanceDirectHit.toFloat
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,11 +22,11 @@ trait ResistanceProfile {
|
||||||
|
|
||||||
def Resist(dtype : DamageType.Value) : Float = {
|
def Resist(dtype : DamageType.Value) : Float = {
|
||||||
dtype match {
|
dtype match {
|
||||||
case DamageType.Direct => ResistanceDirectHit
|
case DamageType.Direct => ResistanceDirectHit.toFloat
|
||||||
case DamageType.Splash => ResistanceSplash
|
case DamageType.Splash => ResistanceSplash.toFloat
|
||||||
case DamageType.Aggravated => ResistanceAggravated
|
case DamageType.Aggravated => ResistanceAggravated.toFloat
|
||||||
case DamageType.Radiation => RadiationShielding
|
case DamageType.Radiation => RadiationShielding
|
||||||
case _ => 0
|
case _ => 0f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,12 +140,12 @@ object ResolutionCalculations {
|
||||||
if(player.Capacitor.toInt > 0 && player.isShielded) {
|
if(player.Capacitor.toInt > 0 && player.isShielded) {
|
||||||
// Subtract armour damage from capacitor
|
// Subtract armour damage from capacitor
|
||||||
result = SubtractWithRemainder(player.Capacitor.toInt, b)
|
result = SubtractWithRemainder(player.Capacitor.toInt, b)
|
||||||
player.Capacitor = result._1
|
player.Capacitor = result._1.toFloat
|
||||||
b = result._2
|
b = result._2
|
||||||
|
|
||||||
// Then follow up with health damage if any capacitor is left
|
// Then follow up with health damage if any capacitor is left
|
||||||
result = SubtractWithRemainder(player.Capacitor.toInt, a)
|
result = SubtractWithRemainder(player.Capacitor.toInt, a)
|
||||||
player.Capacitor = result._1
|
player.Capacitor = result._1.toFloat
|
||||||
a = result._2
|
a = result._2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ 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
|
||||||
import net.psforever.objects.guid.actor.UniqueNumberSystem
|
import net.psforever.objects.guid.actor.UniqueNumberSystem
|
||||||
|
import net.psforever.objects.guid.key.LoanedKey
|
||||||
import net.psforever.objects.guid.selector.RandomSelector
|
import net.psforever.objects.guid.selector.RandomSelector
|
||||||
import net.psforever.objects.guid.source.LimitedNumberSource
|
import net.psforever.objects.guid.source.LimitedNumberSource
|
||||||
import net.psforever.objects.inventory.Container
|
import net.psforever.objects.inventory.Container
|
||||||
|
|
@ -31,6 +32,8 @@ import scalax.collection.Graph
|
||||||
import scalax.collection.GraphPredef._
|
import scalax.collection.GraphPredef._
|
||||||
import scalax.collection.GraphEdge._
|
import scalax.collection.GraphEdge._
|
||||||
|
|
||||||
|
import scala.util.Try
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A server object representing the one-landmass planets as well as the individual subterranean caverns.<br>
|
* A server object representing the one-landmass planets as well as the individual subterranean caverns.<br>
|
||||||
* <br>
|
* <br>
|
||||||
|
|
@ -223,7 +226,7 @@ class Zone(private val zoneId : String, zoneMap : ZoneMap, zoneNumber : Int) {
|
||||||
* @return synchronized reference to the globally unique identifier system
|
* @return synchronized reference to the globally unique identifier system
|
||||||
*/
|
*/
|
||||||
def GUID(hub : NumberPoolHub) : Boolean = {
|
def GUID(hub : NumberPoolHub) : Boolean = {
|
||||||
if(actor == ActorRef.noSender && guid.Pools.map({case (_, pool) => pool.Count}).sum == 0) {
|
if(actor == ActorRef.noSender && guid.Pools.values.foldLeft(0)(_ + _.Count) == 0) {
|
||||||
import org.fusesource.jansi.Ansi.Color.RED
|
import org.fusesource.jansi.Ansi.Color.RED
|
||||||
import org.fusesource.jansi.Ansi.ansi
|
import org.fusesource.jansi.Ansi.ansi
|
||||||
println(ansi().fgBright(RED).a(s"""Caution: replacement of the number pool system for zone $Id; function is for testing purposes only""").reset())
|
println(ansi().fgBright(RED).a(s"""Caution: replacement of the number pool system for zone $Id; function is for testing purposes only""").reset())
|
||||||
|
|
@ -408,9 +411,9 @@ class Zone(private val zoneId : String, zoneMap : ZoneMap, zoneNumber : Int) {
|
||||||
|
|
||||||
private def MakeBuildings(implicit context : ActorContext) : PairMap[Int, Building] = {
|
private def MakeBuildings(implicit context : ActorContext) : PairMap[Int, Building] = {
|
||||||
val buildingList = Map.LocalBuildings
|
val buildingList = Map.LocalBuildings
|
||||||
val registrationKeys = buildingList.map {
|
val registrationKeys : Map[Int, Try[LoanedKey]] = buildingList.map {
|
||||||
case ((_, building_guid, _), _) =>
|
case ((_, building_guid : Int, _), _) =>
|
||||||
building_guid -> guid.register(building_guid)
|
(building_guid, guid.register(building_guid))
|
||||||
}
|
}
|
||||||
buildings = buildingList.map({
|
buildings = buildingList.map({
|
||||||
case((name, building_guid, map_id), constructor) if registrationKeys(building_guid).isSuccess =>
|
case((name, building_guid, map_id), constructor) if registrationKeys(building_guid).isSuccess =>
|
||||||
|
|
@ -448,19 +451,13 @@ class Zone(private val zoneId : String, zoneMap : ZoneMap, zoneNumber : Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private def MakeLattice(): Unit = {
|
private def MakeLattice(): Unit = {
|
||||||
Map.LatticeLink.foreach({ case(source, target) =>
|
lattice ++= Map.LatticeLink.map { case(source, target) =>
|
||||||
val sourceBuilding = Building(source) match {
|
val (sourceBuilding, targetBuilding) = (Building(source), Building(target)) match {
|
||||||
case Some(building) => building
|
case (Some(sBuilding), Some(tBuilding)) => (sBuilding, tBuilding)
|
||||||
case _ => throw new NoSuchElementException(s"Can't create lattice link between $source $target. Source is missing")
|
case _ => throw new NoSuchElementException(s"Can't create lattice link between $source $target. Source is missing")
|
||||||
}
|
}
|
||||||
|
sourceBuilding~targetBuilding
|
||||||
val targetBuilding = Building(target) match {
|
}
|
||||||
case Some(building) => building
|
|
||||||
case _ => throw new NoSuchElementException(s"Can't create lattice link between $source $target. Target is missing")
|
|
||||||
}
|
|
||||||
|
|
||||||
lattice += sourceBuilding~targetBuilding
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private def CreateSpawnGroups() : Unit = {
|
private def CreateSpawnGroups() : Unit = {
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ object PacketHelpers {
|
||||||
def createEnumerationCodec[E <: Enumeration](enum : E, storageCodec : Codec[Int]) : Codec[E#Value] = {
|
def createEnumerationCodec[E <: Enumeration](enum : E, storageCodec : Codec[Int]) : Codec[E#Value] = {
|
||||||
type Struct = Int :: HNil
|
type Struct = Int :: HNil
|
||||||
val struct : Codec[Struct] = storageCodec.hlist
|
val struct : Codec[Struct] = storageCodec.hlist
|
||||||
val primitiveLimit = Math.pow(2, storageCodec.sizeBound.exact.get)
|
val primitiveLimit = Math.pow(2, storageCodec.sizeBound.exact.get.toDouble)
|
||||||
|
|
||||||
// Assure that the enum will always be able to fit in a N-bit int
|
// Assure that the enum will always be able to fit in a N-bit int
|
||||||
assert(enum.maxId <= primitiveLimit,
|
assert(enum.maxId <= primitiveLimit,
|
||||||
|
|
|
||||||
|
|
@ -509,6 +509,8 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
||||||
Some(linkFields(member_list.collect { case SquadPositionEntry(_, Some(entry)) => entry }.reverse)) ::
|
Some(linkFields(member_list.collect { case SquadPositionEntry(_, Some(entry)) => entry }.reverse)) ::
|
||||||
HNil
|
HNil
|
||||||
)
|
)
|
||||||
|
case data =>
|
||||||
|
Attempt.failure(Err(s"can not get squad detail definition from data $data"))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -637,6 +639,8 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
||||||
Attempt.successful(SquadDetail(None, None, None, None, None, None, None, None, Some(ignoreTerminatingEntry(member_list.toList))))
|
Attempt.successful(SquadDetail(None, None, None, None, None, None, None, None, Some(ignoreTerminatingEntry(member_list.toList))))
|
||||||
case false :: None :: Some(_ :: member_list :: HNil) :: HNil =>
|
case false :: None :: Some(_ :: member_list :: HNil) :: HNil =>
|
||||||
Attempt.successful(SquadDetail(None, None, None, None, None, None, None, None, Some(ignoreTerminatingEntry(member_list.toList))))
|
Attempt.successful(SquadDetail(None, None, None, None, None, None, None, None, Some(ignoreTerminatingEntry(member_list.toList))))
|
||||||
|
case data =>
|
||||||
|
Attempt.failure(Err(s"SquadDetail $data not encoded correctly"))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
case SquadDetail(_, _, _, _, _, _, _, _, Some(member_list)) =>
|
case SquadDetail(_, _, _, _, _, _, _, _, Some(member_list)) =>
|
||||||
|
|
@ -1108,18 +1112,22 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
||||||
conditional(index < 255, bool :: squad_member_details_codec(bitsOverByte.Add(1))) ::
|
conditional(index < 255, bool :: squad_member_details_codec(bitsOverByte.Add(1))) ::
|
||||||
conditional(index == 255, bits)
|
conditional(index == 255, bits)
|
||||||
}
|
}
|
||||||
).xmap[SquadPositionEntry] (
|
).exmap[SquadPositionEntry] (
|
||||||
{
|
{
|
||||||
case 255 :: _ :: _ :: HNil =>
|
case 255 :: _ :: _ :: HNil =>
|
||||||
SquadPositionEntry(255, None)
|
Attempt.Successful(SquadPositionEntry(255, None))
|
||||||
case ndx :: Some(_ :: info :: HNil) :: _ :: HNil =>
|
case ndx :: Some(_ :: info :: HNil) :: _ :: HNil =>
|
||||||
SquadPositionEntry(ndx, Some(unlinkFields(Some(info))))
|
Attempt.Successful(SquadPositionEntry(ndx, Some(unlinkFields(Some(info)))))
|
||||||
|
case data =>
|
||||||
|
Attempt.Failure(Err(s"SquadPositionEntry: unsupported decoding format - $data"))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
case SquadPositionEntry(255, _) =>
|
case SquadPositionEntry(255, _) =>
|
||||||
255 :: None :: None :: HNil
|
Attempt.Successful(255 :: None :: None :: HNil)
|
||||||
case SquadPositionEntry(ndx, Some(info)) =>
|
case SquadPositionEntry(ndx, Some(info)) =>
|
||||||
ndx :: Some(true :: linkFields(info) :: HNil) :: None :: HNil
|
Attempt.Successful(ndx :: Some(true :: linkFields(info) :: HNil) :: None :: HNil)
|
||||||
|
case data =>
|
||||||
|
Attempt.Failure(Err(s"SquadPositionEntry: unsupported encoding format - $data"))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -1223,18 +1231,20 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
||||||
conditional(size - 1 > 0, subsequent_position_codec(size - 1)) ::
|
conditional(size - 1 > 0, subsequent_position_codec(size - 1)) ::
|
||||||
conditional(index == 255, bits)
|
conditional(index == 255, bits)
|
||||||
}
|
}
|
||||||
).xmap[LinkedFields](
|
).exmap[LinkedFields](
|
||||||
{
|
{
|
||||||
case 255 :: _ :: _ :: _ :: HNil =>
|
case 255 :: _ :: _ :: _ :: HNil =>
|
||||||
LinkedFields(255, SquadPositionDetail.Blank, None)
|
Attempt.Successful(LinkedFields(255, SquadPositionDetail.Blank, None))
|
||||||
case index :: Some(_ :: entry :: HNil) :: next :: _ :: HNil =>
|
case index :: Some(_ :: entry :: HNil) :: next :: _ :: HNil =>
|
||||||
LinkedFields(index, entry, next)
|
Attempt.Successful(LinkedFields(index, entry, next))
|
||||||
|
case data =>
|
||||||
|
Attempt.Failure(Err(s"LinkedFields: unsupported decoding format - $data"))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
case LinkedFields(255, _, _) =>
|
case LinkedFields(255, _, _) =>
|
||||||
255 :: None :: None :: None :: HNil
|
Attempt.Successful(255 :: None :: None :: None :: HNil)
|
||||||
case LinkedFields(index, entry, next) =>
|
case LinkedFields(index, entry, next) =>
|
||||||
index :: Some(true :: entry :: HNil) :: next :: None :: HNil
|
Attempt.Successful(index :: Some(true :: entry :: HNil) :: next :: None :: HNil)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -1255,18 +1265,20 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
||||||
conditional(index < 255 && size - 1 > 0, subsequent_position_codec(size - 1)) ::
|
conditional(index < 255 && size - 1 > 0, subsequent_position_codec(size - 1)) ::
|
||||||
conditional(index == 255, bits)
|
conditional(index == 255, bits)
|
||||||
}
|
}
|
||||||
).xmap[LinkedFields](
|
).exmap[LinkedFields](
|
||||||
{
|
{
|
||||||
case 255 :: _ :: _ :: _ :: HNil =>
|
case 255 :: _ :: _ :: _ :: HNil =>
|
||||||
LinkedFields(255, SquadPositionDetail.Blank, None)
|
Attempt.Successful(LinkedFields(255, SquadPositionDetail.Blank, None))
|
||||||
case index :: Some(_ :: entry :: HNil) :: next :: _ :: HNil =>
|
case index :: Some(_ :: entry :: HNil) :: next :: _ :: HNil =>
|
||||||
LinkedFields(index, entry, next)
|
Attempt.Successful(LinkedFields(index, entry, next))
|
||||||
|
case data =>
|
||||||
|
Attempt.Failure(Err(s"LinkedFields: unsupported decoding format - $data"))
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
case LinkedFields(255, _, _) =>
|
case LinkedFields(255, _, _) =>
|
||||||
255 :: None :: None :: None :: HNil
|
Attempt.Successful(255 :: None :: None :: None :: HNil)
|
||||||
case LinkedFields(index, entry, next) =>
|
case LinkedFields(index, entry, next) =>
|
||||||
index :: Some(true :: entry :: HNil) :: next :: None :: HNil
|
Attempt.Successful(index :: Some(true :: entry :: HNil) :: next :: None :: HNil)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -1355,6 +1367,8 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
||||||
{
|
{
|
||||||
case SquadPositionDetail(Some(closed), Some(role), Some(orders), Some(requirements), Some(char_id), Some(name)) =>
|
case SquadPositionDetail(Some(closed), Some(role), Some(orders), Some(requirements), Some(char_id), Some(name)) =>
|
||||||
Attempt.Successful(6 :: closed :: role :: orders :: char_id :: name :: CertificationType.toEncodedLong(defaultRequirements ++ requirements) :: HNil)
|
Attempt.Successful(6 :: closed :: role :: orders :: char_id :: name :: CertificationType.toEncodedLong(defaultRequirements ++ requirements) :: HNil)
|
||||||
|
case data =>
|
||||||
|
Attempt.Failure(Err(s"can not encode a SquadDetailDefinitionUpdate member's data - $data"))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ object PlayerData extends Marshallable[PlayerData] {
|
||||||
* @return the number of bits needed to pad it
|
* @return the number of bits needed to pad it
|
||||||
*/
|
*/
|
||||||
def ByteAlignmentPadding(length : Long) : Int = {
|
def ByteAlignmentPadding(length : Long) : Int = {
|
||||||
val pad = (length - math.floor(length / 8) * 8).toInt
|
val pad = (length - math.floor(length.toDouble / 8) * 8).toInt
|
||||||
if(pad > 0) {
|
if(pad > 0) {
|
||||||
8 - pad
|
8 - pad
|
||||||
}
|
}
|
||||||
|
|
@ -204,7 +204,7 @@ object PlayerData extends Marshallable[PlayerData] {
|
||||||
PlayerData(None, app, data, inv, hand)(false)
|
PlayerData(None, app, data, inv, hand)(false)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
case PlayerData(None, app, data, inv, hand) =>
|
case PlayerData(_, app, data, inv, hand) =>
|
||||||
app :: data :: inv :: hand :: false :: HNil
|
app :: data :: inv :: hand :: false :: HNil
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ abstract class SupportActor[A <: SupportActor.Entry] extends Actor {
|
||||||
|
|
||||||
def HurrySpecific(targets : List[PlanetSideGameObject], zone : Zone) : Unit
|
def HurrySpecific(targets : List[PlanetSideGameObject], zone : Zone) : Unit
|
||||||
|
|
||||||
def HurryAll()
|
def HurryAll() : Unit
|
||||||
|
|
||||||
def ClearSpecific(targets : List[PlanetSideGameObject], zone : Zone) : Unit
|
def ClearSpecific(targets : List[PlanetSideGameObject], zone : Zone) : Unit
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,21 +4,23 @@ package base
|
||||||
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
|
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
|
||||||
import akka.testkit.{ImplicitSender, TestKit}
|
import akka.testkit.{ImplicitSender, TestKit}
|
||||||
import com.typesafe.config.ConfigFactory
|
import com.typesafe.config.ConfigFactory
|
||||||
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
|
import org.scalatest.BeforeAndAfterAll
|
||||||
|
import org.scalatest.matchers.should.Matchers
|
||||||
|
import org.scalatest.wordspec.AnyWordSpecLike
|
||||||
import org.specs2.specification.Scope
|
import org.specs2.specification.Scope
|
||||||
|
|
||||||
import scala.collection.mutable
|
import scala.collection.mutable
|
||||||
import scala.concurrent.duration.FiniteDuration
|
import scala.concurrent.duration.FiniteDuration
|
||||||
|
|
||||||
abstract class ActorTest(sys : ActorSystem = ActorSystem("system", ConfigFactory.parseMap(ActorTest.LoggingConfig)))
|
abstract class ActorTest(sys : ActorSystem = ActorSystem("system", ConfigFactory.parseMap(ActorTest.LoggingConfig)))
|
||||||
extends TestKit(sys) with Scope with ImplicitSender with WordSpecLike with Matchers with BeforeAndAfterAll {
|
extends TestKit(sys) with Scope with ImplicitSender with AnyWordSpecLike with Matchers with BeforeAndAfterAll {
|
||||||
override def afterAll {
|
override def afterAll : Unit = {
|
||||||
TestKit.shutdownActorSystem(system)
|
TestKit.shutdownActorSystem(system)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object ActorTest {
|
object ActorTest {
|
||||||
import scala.collection.JavaConverters._
|
import scala.jdk.CollectionConverters._
|
||||||
private val LoggingConfig = Map(
|
private val LoggingConfig = Map(
|
||||||
"akka.loggers" -> List("akka.testkit.TestEventListener").asJava,
|
"akka.loggers" -> List("akka.testkit.TestEventListener").asJava,
|
||||||
"akka.loglevel" -> "OFF",
|
"akka.loglevel" -> "OFF",
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ class BuildingControl2Test extends ActorTest {
|
||||||
|
|
||||||
"Building Control" should {
|
"Building Control" should {
|
||||||
"convert and assert faction affinity on convert request" in {
|
"convert and assert faction affinity on convert request" in {
|
||||||
expectNoMsg(500 milliseconds)
|
expectNoMessage(500 milliseconds)
|
||||||
|
|
||||||
assert(bldg.Faction == PlanetSideEmpire.TR)
|
assert(bldg.Faction == PlanetSideEmpire.TR)
|
||||||
bldg.Actor ! FactionAffinity.ConvertFactionAffinity(PlanetSideEmpire.VS)
|
bldg.Actor ! FactionAffinity.ConvertFactionAffinity(PlanetSideEmpire.VS)
|
||||||
|
|
@ -164,7 +164,7 @@ class BuildingControl3Test extends ActorTest {
|
||||||
|
|
||||||
"Building Control" should {
|
"Building Control" should {
|
||||||
"convert and assert faction affinity on convert request, and for each of its amenities" in {
|
"convert and assert faction affinity on convert request, and for each of its amenities" in {
|
||||||
expectNoMsg(500 milliseconds)
|
expectNoMessage(500 milliseconds)
|
||||||
|
|
||||||
assert(bldg.Faction == PlanetSideEmpire.TR)
|
assert(bldg.Faction == PlanetSideEmpire.TR)
|
||||||
assert(bldg.Amenities.length == 2)
|
assert(bldg.Amenities.length == 2)
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ class DamageableEntityDamageTest extends ActorTest {
|
||||||
Vector3(1,0,0)
|
Vector3(1,0,0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"DamageableEntity" should {
|
"DamageableEntity" should {
|
||||||
"handle taking damage" in {
|
"handle taking damage" in {
|
||||||
|
|
@ -323,7 +323,7 @@ class DamageableEntityDestroyedTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"DamageableEntity" should {
|
"DamageableEntity" should {
|
||||||
|
|
@ -387,7 +387,7 @@ class DamageableEntityNotDestroyTwice extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"DamageableEntity" should {
|
"DamageableEntity" should {
|
||||||
|
|
@ -402,7 +402,7 @@ class DamageableEntityNotDestroyTwice extends ActorTest {
|
||||||
|
|
||||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
avatarProbe.receiveOne(500 milliseconds) //only one message
|
avatarProbe.receiveOne(500 milliseconds) //only one message
|
||||||
avatarProbe.expectNoMsg(500 milliseconds) //only one message
|
avatarProbe.expectNoMessage(500 milliseconds) //only one message
|
||||||
activityProbe.receiveOne(500 milliseconds) //triggers activity hotspot, like it's not a killing blow
|
activityProbe.receiveOne(500 milliseconds) //triggers activity hotspot, like it's not a killing blow
|
||||||
assert(gen.Health < originalHealth)
|
assert(gen.Health < originalHealth)
|
||||||
assert(gen.Destroyed)
|
assert(gen.Destroyed)
|
||||||
|
|
@ -448,7 +448,7 @@ class DamageableAmenityTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"DamageableAmenity" should {
|
"DamageableAmenity" should {
|
||||||
|
|
@ -532,7 +532,7 @@ class DamageableMountableDamageTest extends ActorTest {
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
mech.Seats(0).Occupant = player2 //seat the player
|
mech.Seats(0).Occupant = player2 //seat the player
|
||||||
player2.VehicleSeated = Some(mech.GUID) //seat the player
|
player2.VehicleSeated = Some(mech.GUID) //seat the player
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"DamageableMountable" should {
|
"DamageableMountable" should {
|
||||||
|
|
@ -612,7 +612,7 @@ class DamageableMountableDestroyTest extends ActorTest {
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
mech.Seats(0).Occupant = player2 //seat the player
|
mech.Seats(0).Occupant = player2 //seat the player
|
||||||
player2.VehicleSeated = Some(mech.GUID) //seat the player
|
player2.VehicleSeated = Some(mech.GUID) //seat the player
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"DamageableMountable" should {
|
"DamageableMountable" should {
|
||||||
|
|
@ -623,7 +623,7 @@ class DamageableMountableDestroyTest extends ActorTest {
|
||||||
|
|
||||||
mech.Actor ! Vitality.Damage(applyDamageTo)
|
mech.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
val msg12 = avatarProbe.receiveN(2, 500 milliseconds)
|
val msg12 = avatarProbe.receiveN(2, 500 milliseconds)
|
||||||
player1Probe.expectNoMsg(500 milliseconds)
|
player1Probe.expectNoMessage(500 milliseconds)
|
||||||
val msg3 = player2Probe.receiveOne(200 milliseconds)
|
val msg3 = player2Probe.receiveOne(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg12.head match {
|
msg12.head match {
|
||||||
|
|
@ -689,7 +689,7 @@ class DamageableWeaponTurretDamageTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"DamageableWeaponTurret" should {
|
"DamageableWeaponTurret" should {
|
||||||
|
|
@ -773,7 +773,7 @@ class DamageableWeaponTurretJammerTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"DamageableWeaponTurret" should {
|
"DamageableWeaponTurret" should {
|
||||||
|
|
@ -867,7 +867,7 @@ class DamageableWeaponTurretDestructionTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageToB = resolvedB.damage_model.Calculate(resolvedB)
|
val applyDamageToB = resolvedB.damage_model.Calculate(resolvedB)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"DamageableWeaponTurret" should {
|
"DamageableWeaponTurret" should {
|
||||||
|
|
@ -886,7 +886,7 @@ class DamageableWeaponTurretDestructionTest extends ActorTest {
|
||||||
|
|
||||||
turret.Actor ! Vitality.Damage(applyDamageToB) //destroy
|
turret.Actor ! Vitality.Damage(applyDamageToB) //destroy
|
||||||
val msg12_4 = avatarProbe.receiveN(3, 500 milliseconds)
|
val msg12_4 = avatarProbe.receiveN(3, 500 milliseconds)
|
||||||
player1Probe.expectNoMsg(500 milliseconds)
|
player1Probe.expectNoMessage(500 milliseconds)
|
||||||
val msg3 = player2Probe.receiveOne(200 milliseconds)
|
val msg3 = player2Probe.receiveOne(200 milliseconds)
|
||||||
val msg56 = vehicleProbe.receiveN(2, 200 milliseconds)
|
val msg56 = vehicleProbe.receiveN(2, 200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
|
|
@ -977,7 +977,7 @@ class DamageableVehicleDamageTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"DamageableVehicle" should {
|
"DamageableVehicle" should {
|
||||||
|
|
@ -1091,7 +1091,7 @@ class DamageableVehicleDamageMountedTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"handle damage with mounted vehicles" in {
|
"handle damage with mounted vehicles" in {
|
||||||
|
|
@ -1217,7 +1217,7 @@ class DamageableVehicleJammeringMountedTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"handle jammering with mounted vehicles" in {
|
"handle jammering with mounted vehicles" in {
|
||||||
|
|
@ -1228,10 +1228,10 @@ class DamageableVehicleJammeringMountedTest extends ActorTest {
|
||||||
|
|
||||||
lodestar.Actor ! Vitality.Damage(applyDamageTo)
|
lodestar.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
val msg12 = vehicleProbe.receiveOne(500 milliseconds)
|
val msg12 = vehicleProbe.receiveOne(500 milliseconds)
|
||||||
avatarProbe.expectNoMsg(500 milliseconds)
|
avatarProbe.expectNoMessage(500 milliseconds)
|
||||||
player1Probe.expectNoMsg(200 milliseconds)
|
player1Probe.expectNoMessage(200 milliseconds)
|
||||||
player2Probe.expectNoMsg(200 milliseconds)
|
player2Probe.expectNoMessage(200 milliseconds)
|
||||||
player3Probe.expectNoMsg(200 milliseconds)
|
player3Probe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg12 match {
|
msg12 match {
|
||||||
case VehicleServiceMessage("test", VehicleAction.PlanetsideAttribute(Service.defaultPlayerGUID, PlanetSideGUID(4), 27, 1))=> true
|
case VehicleServiceMessage("test", VehicleAction.PlanetsideAttribute(Service.defaultPlayerGUID, PlanetSideGUID(4), 27, 1))=> true
|
||||||
|
|
@ -1293,7 +1293,7 @@ class DamageableVehicleDestroyTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"DamageableVehicle" should {
|
"DamageableVehicle" should {
|
||||||
|
|
@ -1419,7 +1419,7 @@ class DamageableVehicleDestroyMountedTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageToB = resolvedB.damage_model.Calculate(resolvedB)
|
val applyDamageToB = resolvedB.damage_model.Calculate(resolvedB)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"handle jammering with mounted vehicles" in {
|
"handle jammering with mounted vehicles" in {
|
||||||
|
|
@ -1435,10 +1435,10 @@ class DamageableVehicleDestroyMountedTest extends ActorTest {
|
||||||
|
|
||||||
lodestar.Actor ! Vitality.Damage(applyDamageToA)
|
lodestar.Actor ! Vitality.Damage(applyDamageToA)
|
||||||
vehicleProbe.receiveOne(500 milliseconds) //flush jammered message
|
vehicleProbe.receiveOne(500 milliseconds) //flush jammered message
|
||||||
avatarProbe.expectNoMsg(200 milliseconds)
|
avatarProbe.expectNoMessage(200 milliseconds)
|
||||||
player1Probe.expectNoMsg(200 milliseconds)
|
player1Probe.expectNoMessage(200 milliseconds)
|
||||||
player2Probe.expectNoMsg(200 milliseconds)
|
player2Probe.expectNoMessage(200 milliseconds)
|
||||||
player3Probe.expectNoMsg(200 milliseconds)
|
player3Probe.expectNoMessage(200 milliseconds)
|
||||||
assert(lodestar.Health > lodestar.Definition.DamageDestroysAt)
|
assert(lodestar.Health > lodestar.Definition.DamageDestroysAt)
|
||||||
assert(lodestar.Jammed)
|
assert(lodestar.Jammed)
|
||||||
assert(!lodestar.Destroyed)
|
assert(!lodestar.Destroyed)
|
||||||
|
|
@ -1449,13 +1449,13 @@ class DamageableVehicleDestroyMountedTest extends ActorTest {
|
||||||
|
|
||||||
lodestar.Actor ! Vitality.Damage(applyDamageToB)
|
lodestar.Actor ! Vitality.Damage(applyDamageToB)
|
||||||
val msg_avatar = avatarProbe.receiveN(5, 500 milliseconds)
|
val msg_avatar = avatarProbe.receiveN(5, 500 milliseconds)
|
||||||
avatarProbe.expectNoMsg(10 milliseconds)
|
avatarProbe.expectNoMessage(10 milliseconds)
|
||||||
val msg_player2 = player2Probe.receiveOne(200 milliseconds)
|
val msg_player2 = player2Probe.receiveOne(200 milliseconds)
|
||||||
player2Probe.expectNoMsg(10 milliseconds)
|
player2Probe.expectNoMessage(10 milliseconds)
|
||||||
val msg_player3 = player3Probe.receiveOne(200 milliseconds)
|
val msg_player3 = player3Probe.receiveOne(200 milliseconds)
|
||||||
player3Probe.expectNoMsg(10 milliseconds)
|
player3Probe.expectNoMessage(10 milliseconds)
|
||||||
val msg_vehicle = vehicleProbe.receiveN(2, 200 milliseconds)
|
val msg_vehicle = vehicleProbe.receiveN(2, 200 milliseconds)
|
||||||
vehicleProbe.expectNoMsg(10 milliseconds)
|
vehicleProbe.expectNoMessage(10 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_avatar.exists( {
|
msg_avatar.exists( {
|
||||||
case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(4), 0, _)) => true
|
case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(4), 0, _)) => true
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,7 @@ class ExplosiveDeployableJammerTest extends ActorTest {
|
||||||
j_mine.Actor ! Vitality.Damage(applyDamageToJ)
|
j_mine.Actor ! Vitality.Damage(applyDamageToJ)
|
||||||
val msg_local = localProbe.receiveN(4, 200 milliseconds)
|
val msg_local = localProbe.receiveN(4, 200 milliseconds)
|
||||||
val msg_avatar = avatarProbe.receiveOne(200 milliseconds)
|
val msg_avatar = avatarProbe.receiveOne(200 milliseconds)
|
||||||
activityProbe.expectNoMsg(200 milliseconds)
|
activityProbe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_local.head match {
|
msg_local.head match {
|
||||||
case LocalServiceMessage("TestCharacter2", LocalAction.AlertDestroyDeployable(PlanetSideGUID(0), target)) => target eq j_mine
|
case LocalServiceMessage("TestCharacter2", LocalAction.AlertDestroyDeployable(PlanetSideGUID(0), target)) => target eq j_mine
|
||||||
|
|
@ -532,7 +532,7 @@ class ExplosiveDeployableDestructionTest extends ActorTest {
|
||||||
h_mine.Actor ! Vitality.Damage(applyDamageTo)
|
h_mine.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
val msg_local = localProbe.receiveN(5, 200 milliseconds)
|
val msg_local = localProbe.receiveN(5, 200 milliseconds)
|
||||||
val msg_avatar = avatarProbe.receiveOne(200 milliseconds)
|
val msg_avatar = avatarProbe.receiveOne(200 milliseconds)
|
||||||
activityProbe.expectNoMsg(200 milliseconds)
|
activityProbe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_local.head match {
|
msg_local.head match {
|
||||||
case LocalServiceMessage("TestCharacter2", LocalAction.AlertDestroyDeployable(PlanetSideGUID(0), target)) => target eq h_mine
|
case LocalServiceMessage("TestCharacter2", LocalAction.AlertDestroyDeployable(PlanetSideGUID(0), target)) => target eq h_mine
|
||||||
|
|
@ -595,7 +595,7 @@ class TurretControlInitializeTest extends ActorTest {
|
||||||
assert(obj.Actor == ActorRef.noSender)
|
assert(obj.Actor == ActorRef.noSender)
|
||||||
val init = system.actorOf(Props(classOf[DeployableTest.TurretInitializer], obj), "init_turret_test")
|
val init = system.actorOf(Props(classOf[DeployableTest.TurretInitializer], obj), "init_turret_test")
|
||||||
init ! "initialize"
|
init ! "initialize"
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
assert(obj.Actor != ActorRef.noSender)
|
assert(obj.Actor != ActorRef.noSender)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -608,11 +608,11 @@ class TurretControlUninitializeTest extends ActorTest {
|
||||||
val init = system.actorOf(Props(classOf[DeployableTest.TurretInitializer], obj), "init_turret_test")
|
val init = system.actorOf(Props(classOf[DeployableTest.TurretInitializer], obj), "init_turret_test")
|
||||||
obj.GUID = PlanetSideGUID(1)
|
obj.GUID = PlanetSideGUID(1)
|
||||||
init ! "initialize"
|
init ! "initialize"
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
assert(obj.Actor != ActorRef.noSender)
|
assert(obj.Actor != ActorRef.noSender)
|
||||||
|
|
||||||
init ! "uninitialize"
|
init ! "uninitialize"
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
assert(obj.Actor == ActorRef.noSender)
|
assert(obj.Actor == ActorRef.noSender)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ class GeneratorControlDamageTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"GeneratorControl" should {
|
"GeneratorControl" should {
|
||||||
|
|
@ -96,7 +96,7 @@ class GeneratorControlDamageTest extends ActorTest {
|
||||||
|
|
||||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
val msg_avatar = avatarProbe.receiveN(2, 500 milliseconds)
|
val msg_avatar = avatarProbe.receiveN(2, 500 milliseconds)
|
||||||
buildingProbe.expectNoMsg(200 milliseconds)
|
buildingProbe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_avatar.head match {
|
msg_avatar.head match {
|
||||||
case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 0, _)) => true
|
case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 0, _)) => true
|
||||||
|
|
@ -158,7 +158,7 @@ class GeneratorControlCriticalTest extends ActorTest {
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
val halfHealth = gen.Definition.MaxHealth / 2
|
val halfHealth = gen.Definition.MaxHealth / 2
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"GeneratorControl" should {
|
"GeneratorControl" should {
|
||||||
|
|
@ -238,7 +238,7 @@ class GeneratorControlDestroyedTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"GeneratorControl" should {
|
"GeneratorControl" should {
|
||||||
|
|
@ -250,7 +250,7 @@ class GeneratorControlDestroyedTest extends ActorTest {
|
||||||
|
|
||||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
val msg_avatar1 = avatarProbe.receiveOne(500 milliseconds)
|
val msg_avatar1 = avatarProbe.receiveOne(500 milliseconds)
|
||||||
buildingProbe.expectNoMsg(200 milliseconds)
|
buildingProbe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_avatar1 match {
|
msg_avatar1 match {
|
||||||
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
||||||
|
|
@ -261,8 +261,8 @@ class GeneratorControlDestroyedTest extends ActorTest {
|
||||||
assert(!gen.Destroyed)
|
assert(!gen.Destroyed)
|
||||||
assert(gen.Condition == PlanetSideGeneratorState.Normal)
|
assert(gen.Condition == PlanetSideGeneratorState.Normal)
|
||||||
|
|
||||||
avatarProbe.expectNoMsg(9 seconds)
|
avatarProbe.expectNoMessage(9 seconds)
|
||||||
buildingProbe.expectNoMsg(50 milliseconds) //no prior messages
|
buildingProbe.expectNoMessage(50 milliseconds) //no prior messages
|
||||||
val msg_avatar2 = avatarProbe.receiveN(3, 1000 milliseconds) //see DamageableEntity test file
|
val msg_avatar2 = avatarProbe.receiveN(3, 1000 milliseconds) //see DamageableEntity test file
|
||||||
val msg_building = buildingProbe.receiveOne(200 milliseconds)
|
val msg_building = buildingProbe.receiveOne(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
|
|
@ -356,7 +356,7 @@ class GeneratorControlKillsTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"GeneratorControl" should {
|
"GeneratorControl" should {
|
||||||
|
|
@ -368,9 +368,9 @@ class GeneratorControlKillsTest extends ActorTest {
|
||||||
|
|
||||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
val msg_avatar1 = avatarProbe.receiveN(2, 500 milliseconds)
|
val msg_avatar1 = avatarProbe.receiveN(2, 500 milliseconds)
|
||||||
buildingProbe.expectNoMsg(200 milliseconds)
|
buildingProbe.expectNoMessage(200 milliseconds)
|
||||||
player1Probe.expectNoMsg(200 milliseconds)
|
player1Probe.expectNoMessage(200 milliseconds)
|
||||||
player2Probe.expectNoMsg(200 milliseconds)
|
player2Probe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_avatar1.head match {
|
msg_avatar1.head match {
|
||||||
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
||||||
|
|
@ -390,7 +390,7 @@ class GeneratorControlKillsTest extends ActorTest {
|
||||||
val msg_building = buildingProbe.receiveOne(10500 milliseconds)
|
val msg_building = buildingProbe.receiveOne(10500 milliseconds)
|
||||||
val msg_avatar2 = avatarProbe.receiveN(3, 200 milliseconds)
|
val msg_avatar2 = avatarProbe.receiveN(3, 200 milliseconds)
|
||||||
val msg_player1 = player1Probe.receiveOne(100 milliseconds)
|
val msg_player1 = player1Probe.receiveOne(100 milliseconds)
|
||||||
player2Probe.expectNoMsg(200 milliseconds)
|
player2Probe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_building match {
|
msg_building match {
|
||||||
case Building.AmenityStateChange(o) => o eq gen
|
case Building.AmenityStateChange(o) => o eq gen
|
||||||
|
|
@ -465,7 +465,7 @@ class GeneratorControlNotDestroyTwice extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"GeneratorControl" should {
|
"GeneratorControl" should {
|
||||||
|
|
@ -480,9 +480,9 @@ class GeneratorControlNotDestroyTwice extends ActorTest {
|
||||||
assert(originalHealth > gen.Definition.DamageDestroysAt)
|
assert(originalHealth > gen.Definition.DamageDestroysAt)
|
||||||
|
|
||||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
avatarProbe.expectNoMsg(500 milliseconds)
|
avatarProbe.expectNoMessage(500 milliseconds)
|
||||||
activityProbe.receiveOne(500 milliseconds)
|
activityProbe.receiveOne(500 milliseconds)
|
||||||
buildingProbe.expectNoMsg(1000 milliseconds)
|
buildingProbe.expectNoMessage(1000 milliseconds)
|
||||||
assert(gen.Health < originalHealth)
|
assert(gen.Health < originalHealth)
|
||||||
assert(gen.Destroyed)
|
assert(gen.Destroyed)
|
||||||
assert(originalHealth < gen.Definition.DefaultHealth)
|
assert(originalHealth < gen.Definition.DefaultHealth)
|
||||||
|
|
@ -494,9 +494,9 @@ class GeneratorControlNotDestroyTwice extends ActorTest {
|
||||||
assert(gen.Health == 1)
|
assert(gen.Health == 1)
|
||||||
assert(gen.Destroyed)
|
assert(gen.Destroyed)
|
||||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
avatarProbe.expectNoMsg(500 milliseconds)
|
avatarProbe.expectNoMessage(500 milliseconds)
|
||||||
activityProbe.receiveOne(500 milliseconds) //activity alert occurs because this was not a kill shot
|
activityProbe.receiveOne(500 milliseconds) //activity alert occurs because this was not a kill shot
|
||||||
buildingProbe.expectNoMsg(1000 milliseconds)
|
buildingProbe.expectNoMessage(1000 milliseconds)
|
||||||
assert(gen.Health == 0)
|
assert(gen.Health == 0)
|
||||||
assert(gen.Destroyed)
|
assert(gen.Destroyed)
|
||||||
}
|
}
|
||||||
|
|
@ -546,7 +546,7 @@ class GeneratorControlNotDamageIfExplodingTest extends ActorTest {
|
||||||
Vector3(1, 0, 0)
|
Vector3(1, 0, 0)
|
||||||
)
|
)
|
||||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"GeneratorControl" should {
|
"GeneratorControl" should {
|
||||||
|
|
@ -558,8 +558,8 @@ class GeneratorControlNotDamageIfExplodingTest extends ActorTest {
|
||||||
|
|
||||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
val msg_avatar = avatarProbe.receiveOne(500 milliseconds)
|
val msg_avatar = avatarProbe.receiveOne(500 milliseconds)
|
||||||
buildingProbe.expectNoMsg(200 milliseconds)
|
buildingProbe.expectNoMessage(200 milliseconds)
|
||||||
player1Probe.expectNoMsg(200 milliseconds)
|
player1Probe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_avatar match {
|
msg_avatar match {
|
||||||
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
||||||
|
|
@ -573,15 +573,15 @@ class GeneratorControlNotDamageIfExplodingTest extends ActorTest {
|
||||||
|
|
||||||
//once
|
//once
|
||||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
avatarProbe.expectNoMsg(500 milliseconds)
|
avatarProbe.expectNoMessage(500 milliseconds)
|
||||||
buildingProbe.expectNoMsg(200 milliseconds)
|
buildingProbe.expectNoMessage(200 milliseconds)
|
||||||
player1Probe.expectNoMsg(200 milliseconds)
|
player1Probe.expectNoMessage(200 milliseconds)
|
||||||
assert(gen.Health == 1)
|
assert(gen.Health == 1)
|
||||||
//twice
|
//twice
|
||||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
avatarProbe.expectNoMsg(500 milliseconds)
|
avatarProbe.expectNoMessage(500 milliseconds)
|
||||||
buildingProbe.expectNoMsg(200 milliseconds)
|
buildingProbe.expectNoMessage(200 milliseconds)
|
||||||
player1Probe.expectNoMsg(200 milliseconds)
|
player1Probe.expectNoMessage(200 milliseconds)
|
||||||
assert(gen.Health == 1)
|
assert(gen.Health == 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -634,7 +634,7 @@ class GeneratorControlNotRepairIfExplodingTest extends ActorTest {
|
||||||
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
||||||
guid.register(tool, 4)
|
guid.register(tool, 4)
|
||||||
guid.register(tool.AmmoSlot.Box, 5)
|
guid.register(tool.AmmoSlot.Box, 5)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"GeneratorControl" should {
|
"GeneratorControl" should {
|
||||||
|
|
@ -646,8 +646,8 @@ class GeneratorControlNotRepairIfExplodingTest extends ActorTest {
|
||||||
|
|
||||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
val msg_avatar1 = avatarProbe.receiveOne(500 milliseconds)
|
val msg_avatar1 = avatarProbe.receiveOne(500 milliseconds)
|
||||||
buildingProbe.expectNoMsg(200 milliseconds)
|
buildingProbe.expectNoMessage(200 milliseconds)
|
||||||
player1Probe.expectNoMsg(200 milliseconds)
|
player1Probe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_avatar1 match {
|
msg_avatar1 match {
|
||||||
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
||||||
|
|
@ -661,15 +661,15 @@ class GeneratorControlNotRepairIfExplodingTest extends ActorTest {
|
||||||
|
|
||||||
//once
|
//once
|
||||||
gen.Actor ! CommonMessages.Use(player1, Some(tool)) //repair?
|
gen.Actor ! CommonMessages.Use(player1, Some(tool)) //repair?
|
||||||
avatarProbe.expectNoMsg(1000 milliseconds) //no messages
|
avatarProbe.expectNoMessage(1000 milliseconds) //no messages
|
||||||
buildingProbe.expectNoMsg(200 milliseconds)
|
buildingProbe.expectNoMessage(200 milliseconds)
|
||||||
player1Probe.expectNoMsg(200 milliseconds)
|
player1Probe.expectNoMessage(200 milliseconds)
|
||||||
assert(gen.Health == 1)
|
assert(gen.Health == 1)
|
||||||
//twice
|
//twice
|
||||||
gen.Actor ! CommonMessages.Use(player1, Some(tool)) //repair?
|
gen.Actor ! CommonMessages.Use(player1, Some(tool)) //repair?
|
||||||
avatarProbe.expectNoMsg(1000 milliseconds) //no messages
|
avatarProbe.expectNoMessage(1000 milliseconds) //no messages
|
||||||
buildingProbe.expectNoMsg(200 milliseconds)
|
buildingProbe.expectNoMessage(200 milliseconds)
|
||||||
player1Probe.expectNoMsg(200 milliseconds)
|
player1Probe.expectNoMessage(200 milliseconds)
|
||||||
assert(gen.Health == 1)
|
assert(gen.Health == 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -711,7 +711,7 @@ class GeneratorControlRepairPastRestorePoint extends ActorTest {
|
||||||
guid.register(player1, 3)
|
guid.register(player1, 3)
|
||||||
guid.register(tool, 4)
|
guid.register(tool, 4)
|
||||||
guid.register(tool.AmmoSlot.Box, 5)
|
guid.register(tool.AmmoSlot.Box, 5)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"GeneratorControl" should {
|
"GeneratorControl" should {
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ class PlayerControlHealTest extends ActorTest {
|
||||||
|
|
||||||
player1.Position = Vector3(10,0,0) //moved more than 5m away
|
player1.Position = Vector3(10,0,0) //moved more than 5m away
|
||||||
player2.Actor ! CommonMessages.Use(player1, Some(tool))
|
player2.Actor ! CommonMessages.Use(player1, Some(tool))
|
||||||
avatarProbe.expectNoMsg(500 milliseconds)
|
avatarProbe.expectNoMessage(500 milliseconds)
|
||||||
assert(raisedHealth == player2.Health)
|
assert(raisedHealth == player2.Health)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -224,7 +224,7 @@ class PlayerControlRepairTest extends ActorTest {
|
||||||
val fixedArmor = player2.Armor
|
val fixedArmor = player2.Armor
|
||||||
player1.Position = Vector3(10,0,0) //moved more than 5m away
|
player1.Position = Vector3(10,0,0) //moved more than 5m away
|
||||||
player2.Actor ! CommonMessages.Use(player1, Some(tool))
|
player2.Actor ! CommonMessages.Use(player1, Some(tool))
|
||||||
avatarProbe.expectNoMsg(500 milliseconds)
|
avatarProbe.expectNoMessage(500 milliseconds)
|
||||||
assert(fixedArmor == player2.Armor)
|
assert(fixedArmor == player2.Armor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -329,7 +329,7 @@ class PlayerControlDamageTest extends ActorTest {
|
||||||
guid.register(player2, 2)
|
guid.register(player2, 2)
|
||||||
guid.register(tool, 3)
|
guid.register(tool, 3)
|
||||||
guid.register(tool.AmmoSlot.Box, 4)
|
guid.register(tool.AmmoSlot.Box, 4)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
"PlayerControl" should {
|
"PlayerControl" should {
|
||||||
"handle damage" in {
|
"handle damage" in {
|
||||||
assert(player2.Health == player2.Definition.DefaultHealth)
|
assert(player2.Health == player2.Definition.DefaultHealth)
|
||||||
|
|
@ -406,7 +406,7 @@ class PlayerControlDeathStandingTest extends ActorTest {
|
||||||
guid.register(player2, 2)
|
guid.register(player2, 2)
|
||||||
guid.register(tool, 3)
|
guid.register(tool, 3)
|
||||||
guid.register(tool.AmmoSlot.Box, 4)
|
guid.register(tool.AmmoSlot.Box, 4)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"PlayerControl" should {
|
"PlayerControl" should {
|
||||||
"handle death" in {
|
"handle death" in {
|
||||||
|
|
@ -421,7 +421,7 @@ class PlayerControlDeathStandingTest extends ActorTest {
|
||||||
|
|
||||||
player2.Actor ! Vitality.Damage(applyDamageTo)
|
player2.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
val msg_avatar = avatarProbe.receiveN(8, 500 milliseconds)
|
val msg_avatar = avatarProbe.receiveN(8, 500 milliseconds)
|
||||||
activityProbe.expectNoMsg(200 milliseconds)
|
activityProbe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_avatar.head match {
|
msg_avatar.head match {
|
||||||
case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 4, _)) => true
|
case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 4, _)) => true
|
||||||
|
|
@ -518,7 +518,7 @@ class PlayerControlDeathSeatedTest extends ActorTest {
|
||||||
guid.register(tool, 3)
|
guid.register(tool, 3)
|
||||||
guid.register(tool.AmmoSlot.Box, 4)
|
guid.register(tool.AmmoSlot.Box, 4)
|
||||||
guid.register(vehicle, 5)
|
guid.register(vehicle, 5)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"PlayerControl" should {
|
"PlayerControl" should {
|
||||||
"handle death when seated (in something)" in {
|
"handle death when seated (in something)" in {
|
||||||
|
|
@ -531,7 +531,7 @@ class PlayerControlDeathSeatedTest extends ActorTest {
|
||||||
|
|
||||||
player2.Actor ! Vitality.Damage(applyDamageTo)
|
player2.Actor ! Vitality.Damage(applyDamageTo)
|
||||||
val msg_avatar = avatarProbe.receiveN(9, 500 milliseconds)
|
val msg_avatar = avatarProbe.receiveN(9, 500 milliseconds)
|
||||||
activityProbe.expectNoMsg(200 milliseconds)
|
activityProbe.expectNoMessage(200 milliseconds)
|
||||||
assert(
|
assert(
|
||||||
msg_avatar.head match {
|
msg_avatar.head match {
|
||||||
case AvatarServiceMessage("TestCharacter2", AvatarAction.Killed(PlanetSideGUID(2))) => true
|
case AvatarServiceMessage("TestCharacter2", AvatarAction.Killed(PlanetSideGUID(2))) => true
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ class RepairableEntityRepairTest extends ActorTest {
|
||||||
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
||||||
guid.register(tool, 4)
|
guid.register(tool, 4)
|
||||||
guid.register(tool.AmmoSlot.Box, 5)
|
guid.register(tool.AmmoSlot.Box, 5)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"RepairableEntity" should {
|
"RepairableEntity" should {
|
||||||
|
|
@ -115,14 +115,14 @@ class RepairableEntityNotRepairTest extends ActorTest {
|
||||||
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
||||||
guid.register(tool, 4)
|
guid.register(tool, 4)
|
||||||
guid.register(tool.AmmoSlot.Box, 5)
|
guid.register(tool.AmmoSlot.Box, 5)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"RepairableEntity" should {
|
"RepairableEntity" should {
|
||||||
"not repair if health is already full" in {
|
"not repair if health is already full" in {
|
||||||
assert(gen.Health == gen.Definition.DefaultHealth) //ideal
|
assert(gen.Health == gen.Definition.DefaultHealth) //ideal
|
||||||
gen.Actor ! CommonMessages.Use(player1, Some(tool)) //repair?
|
gen.Actor ! CommonMessages.Use(player1, Some(tool)) //repair?
|
||||||
avatarProbe.expectNoMsg(1000 milliseconds) //no messages
|
avatarProbe.expectNoMessage(1000 milliseconds) //no messages
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -155,7 +155,7 @@ class RepairableAmenityTest extends ActorTest {
|
||||||
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
||||||
guid.register(tool, 4)
|
guid.register(tool, 4)
|
||||||
guid.register(tool.AmmoSlot.Box, 5)
|
guid.register(tool.AmmoSlot.Box, 5)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
//we're not testing that the math is correct
|
//we're not testing that the math is correct
|
||||||
|
|
||||||
"RepairableAmenity" should {
|
"RepairableAmenity" should {
|
||||||
|
|
@ -390,7 +390,7 @@ class RepairableVehicleRestoration extends ActorTest {
|
||||||
assert(atv.Destroyed)
|
assert(atv.Destroyed)
|
||||||
|
|
||||||
atv.Actor ! CommonMessages.Use(player1, Some(tool))
|
atv.Actor ! CommonMessages.Use(player1, Some(tool))
|
||||||
avatarProbe.expectNoMsg(500 milliseconds)
|
avatarProbe.expectNoMessage(500 milliseconds)
|
||||||
assert(atv.Health == 0) //set to zero explicitly
|
assert(atv.Health == 0) //set to zero explicitly
|
||||||
assert(atv.Destroyed)
|
assert(atv.Destroyed)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,9 +69,9 @@ class ResourceSiloControlStartupTest extends ActorTest {
|
||||||
|
|
||||||
"Resource silo" should {
|
"Resource silo" should {
|
||||||
"startup properly" in {
|
"startup properly" in {
|
||||||
expectNoMsg(500 milliseconds)
|
expectNoMessage(500 milliseconds)
|
||||||
system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
||||||
expectNoMsg(1 seconds)
|
expectNoMessage(1 seconds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -99,16 +99,16 @@ class ResourceSiloControlUseTest extends ActorTest {
|
||||||
guid.register(obj, 2)
|
guid.register(obj, 2)
|
||||||
guid.register(player, 3)
|
guid.register(player, 3)
|
||||||
guid.register(vehicle, 4)
|
guid.register(vehicle, 4)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
zone.Transport ! Zone.Vehicle.Spawn(vehicle)
|
zone.Transport ! Zone.Vehicle.Spawn(vehicle)
|
||||||
vehicle.Seats(0).Occupant = player
|
vehicle.Seats(0).Occupant = player
|
||||||
player.VehicleSeated = vehicle.GUID
|
player.VehicleSeated = vehicle.GUID
|
||||||
val msg = UseItemMessage(PlanetSideGUID(1), PlanetSideGUID(0), PlanetSideGUID(2), 0L, false, Vector3.Zero,Vector3.Zero,0,0,0,0L) //faked
|
val msg = UseItemMessage(PlanetSideGUID(1), PlanetSideGUID(0), PlanetSideGUID(2), 0L, false, Vector3.Zero,Vector3.Zero,0,0,0,0L) //faked
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"Resource silo" should {
|
"Resource silo" should {
|
||||||
"respond when being used" in {
|
"respond when being used" in {
|
||||||
expectNoMsg(1 seconds)
|
expectNoMessage(1 seconds)
|
||||||
obj.Actor ! ResourceSilo.Use(ResourceSiloTest.player, msg)
|
obj.Actor ! ResourceSilo.Use(ResourceSiloTest.player, msg)
|
||||||
|
|
||||||
val reply = receiveOne(500 milliseconds)
|
val reply = receiveOne(500 milliseconds)
|
||||||
|
|
@ -299,9 +299,9 @@ class ResourceSiloControlNoUpdateTest extends ActorTest {
|
||||||
assert(!obj.LowNtuWarningOn)
|
assert(!obj.LowNtuWarningOn)
|
||||||
obj.Actor ! ResourceSilo.UpdateChargeLevel(50)
|
obj.Actor ! ResourceSilo.UpdateChargeLevel(50)
|
||||||
|
|
||||||
expectNoMsg(500 milliseconds)
|
expectNoMessage(500 milliseconds)
|
||||||
zoneEvents.expectNoMsg(500 milliseconds)
|
zoneEvents.expectNoMessage(500 milliseconds)
|
||||||
buildingEvents.expectNoMsg(500 milliseconds)
|
buildingEvents.expectNoMessage(500 milliseconds)
|
||||||
assert(obj.ChargeLevel == 299 || obj.ChargeLevel == 300) // Just in case the capacitor level drops while waiting for the message check 299 & 300
|
assert(obj.ChargeLevel == 299 || obj.ChargeLevel == 300) // Just in case the capacitor level drops while waiting for the message check 299 & 300
|
||||||
assert(obj.CapacitorDisplay == 3)
|
assert(obj.CapacitorDisplay == 3)
|
||||||
assert(!obj.LowNtuWarningOn)
|
assert(!obj.LowNtuWarningOn)
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ class VehicleControlPrepareForDeletionTest extends ActorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
vehicle.GUID = PlanetSideGUID(1)
|
vehicle.GUID = PlanetSideGUID(1)
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"VehicleControl" should {
|
"VehicleControl" should {
|
||||||
"submit for unregistering when marked for deconstruction" in {
|
"submit for unregistering when marked for deconstruction" in {
|
||||||
|
|
@ -369,7 +369,7 @@ class VehicleControlPrepareForDeletionPassengerTest extends ActorTest {
|
||||||
player1.GUID = PlanetSideGUID(2)
|
player1.GUID = PlanetSideGUID(2)
|
||||||
vehicle.Seats(1).Occupant = player1 //passenger seat
|
vehicle.Seats(1).Occupant = player1 //passenger seat
|
||||||
player1.VehicleSeated = vehicle.GUID
|
player1.VehicleSeated = vehicle.GUID
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"VehicleControl" should {
|
"VehicleControl" should {
|
||||||
"kick all players when marked for deconstruction" in {
|
"kick all players when marked for deconstruction" in {
|
||||||
|
|
@ -431,7 +431,7 @@ class VehicleControlPrepareForDeletionMountedInTest extends FreedContextActorTes
|
||||||
val vehicleProbe = new TestProbe(system)
|
val vehicleProbe = new TestProbe(system)
|
||||||
zone.VehicleEvents = vehicleProbe.ref
|
zone.VehicleEvents = vehicleProbe.ref
|
||||||
zone.Transport ! Zone.Vehicle.Spawn(lodestar) //can not fake this
|
zone.Transport ! Zone.Vehicle.Spawn(lodestar) //can not fake this
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"VehicleControl" should {
|
"VehicleControl" should {
|
||||||
"if mounted as cargo, self-eject when marked for deconstruction" in {
|
"if mounted as cargo, self-eject when marked for deconstruction" in {
|
||||||
|
|
@ -534,7 +534,7 @@ class VehicleControlPrepareForDeletionMountedCargoTest extends FreedContextActor
|
||||||
val vehicleProbe = new TestProbe(system)
|
val vehicleProbe = new TestProbe(system)
|
||||||
zone.VehicleEvents = vehicleProbe.ref
|
zone.VehicleEvents = vehicleProbe.ref
|
||||||
zone.Transport ! Zone.Vehicle.Spawn(lodestar) //can not fake this
|
zone.Transport ! Zone.Vehicle.Spawn(lodestar) //can not fake this
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"VehicleControl" should {
|
"VehicleControl" should {
|
||||||
"if with mounted cargo, eject it when marked for deconstruction" in {
|
"if with mounted cargo, eject it when marked for deconstruction" in {
|
||||||
|
|
@ -865,7 +865,7 @@ class VehicleControlShieldsNotChargingVehicleDeadTest extends ActorTest {
|
||||||
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
||||||
vehicle.Actor.tell(Vehicle.ChargeShields(15), probe.ref)
|
vehicle.Actor.tell(Vehicle.ChargeShields(15), probe.ref)
|
||||||
|
|
||||||
probe.expectNoMsg(1 seconds)
|
probe.expectNoMessage(1 seconds)
|
||||||
assert(vehicle.Shields == 0)
|
assert(vehicle.Shields == 0)
|
||||||
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
||||||
}
|
}
|
||||||
|
|
@ -887,7 +887,7 @@ class VehicleControlShieldsNotChargingVehicleShieldsFullTest extends ActorTest {
|
||||||
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
||||||
vehicle.Actor ! Vehicle.ChargeShields(15)
|
vehicle.Actor ! Vehicle.ChargeShields(15)
|
||||||
|
|
||||||
probe.expectNoMsg(1 seconds)
|
probe.expectNoMessage(1 seconds)
|
||||||
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -914,7 +914,7 @@ class VehicleControlShieldsNotChargingTooEarlyTest extends ActorTest {
|
||||||
assert(vehicle.Shields == 15)
|
assert(vehicle.Shields == 15)
|
||||||
|
|
||||||
vehicle.Actor ! Vehicle.ChargeShields(15)
|
vehicle.Actor ! Vehicle.ChargeShields(15)
|
||||||
probe.expectNoMsg(200 milliseconds)
|
probe.expectNoMessage(200 milliseconds)
|
||||||
assert(vehicle.Shields == 15)
|
assert(vehicle.Shields == 15)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -944,7 +944,7 @@ class VehicleControlShieldsNotChargingTooEarlyTest extends ActorTest {
|
||||||
// assert(vehicle.Shields == 0)
|
// assert(vehicle.Shields == 0)
|
||||||
// vehicle.Actor.tell(Vehicle.ChargeShields(15), probe.ref)
|
// vehicle.Actor.tell(Vehicle.ChargeShields(15), probe.ref)
|
||||||
//
|
//
|
||||||
// probe.expectNoMsg(200 milliseconds)
|
// probe.expectNoMessage(200 milliseconds)
|
||||||
// assert(vehicle.Shields == 0)
|
// assert(vehicle.Shields == 0)
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ class ZoneActorTest extends ActorTest {
|
||||||
"have an Actor" in {
|
"have an Actor" in {
|
||||||
val zone = new Zone("test", new ZoneMap("map6"), 1) { override def SetupNumberPools() = { } }
|
val zone = new Zone("test", new ZoneMap("map6"), 1) { override def SetupNumberPools() = { } }
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-actor")
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-actor")
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
assert(zone.Actor != ActorRef.noSender)
|
assert(zone.Actor != ActorRef.noSender)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -152,7 +152,7 @@ class ZoneActorTest extends ActorTest {
|
||||||
zone.GUID(new NumberPoolHub(new LimitedNumberSource(40150)))
|
zone.GUID(new NumberPoolHub(new LimitedNumberSource(40150)))
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-add-pool-actor-init")
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-add-pool-actor-init")
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(Duration.create(500, "ms"))
|
expectNoMessage(Duration.create(500, "ms"))
|
||||||
|
|
||||||
assert( !zone.AddPool("test1", 1 to 2) )
|
assert( !zone.AddPool("test1", 1 to 2) )
|
||||||
}
|
}
|
||||||
|
|
@ -164,7 +164,7 @@ class ZoneActorTest extends ActorTest {
|
||||||
zone.AddPool("test", 1 to 2)
|
zone.AddPool("test", 1 to 2)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-remove-pool-actor-init")
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-remove-pool-actor-init")
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(Duration.create(300, "ms"))
|
expectNoMessage(Duration.create(300, "ms"))
|
||||||
|
|
||||||
assert( !zone.RemovePool("test") )
|
assert( !zone.RemovePool("test") )
|
||||||
}
|
}
|
||||||
|
|
@ -194,7 +194,7 @@ class ZoneActorTest extends ActorTest {
|
||||||
val zone = new Zone("test", map6, 1) { override def SetupNumberPools() = { } }
|
val zone = new Zone("test", map6, 1) { override def SetupNumberPools() = { } }
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-init")
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-init")
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(Duration.create(1, "seconds"))
|
expectNoMessage(Duration.create(1, "seconds"))
|
||||||
|
|
||||||
val groups = zone.SpawnGroups()
|
val groups = zone.SpawnGroups()
|
||||||
assert(groups.size == 2)
|
assert(groups.size == 2)
|
||||||
|
|
@ -232,7 +232,7 @@ class ZoneActorTest extends ActorTest {
|
||||||
val zone = new Zone("test", map6, 1) { override def SetupNumberPools() = { } }
|
val zone = new Zone("test", map6, 1) { override def SetupNumberPools() = { } }
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-spawn")
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-spawn")
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(Duration.create(1, "seconds"))
|
expectNoMessage(Duration.create(1, "seconds"))
|
||||||
val player = Player(Avatar("Chord", PlanetSideEmpire.NEUTRAL, CharacterGender.Male, 0, CharacterVoice.Voice5))
|
val player = Player(Avatar("Chord", PlanetSideEmpire.NEUTRAL, CharacterGender.Male, 0, CharacterVoice.Voice5))
|
||||||
|
|
||||||
val bldg1 = zone.Building(1).get
|
val bldg1 = zone.Building(1).get
|
||||||
|
|
@ -263,7 +263,7 @@ class ZoneActorTest extends ActorTest {
|
||||||
val zone = new Zone("test", map6, 1) { override def SetupNumberPools() = { } }
|
val zone = new Zone("test", map6, 1) { override def SetupNumberPools() = { } }
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-no-spawn")
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-no-spawn")
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(Duration.create(300, "ms"))
|
expectNoMessage(Duration.create(300, "ms"))
|
||||||
val player = Player(Avatar("Chord", PlanetSideEmpire.NEUTRAL, CharacterGender.Male, 0, CharacterVoice.Voice5))
|
val player = Player(Avatar("Chord", PlanetSideEmpire.NEUTRAL, CharacterGender.Male, 0, CharacterVoice.Voice5))
|
||||||
|
|
||||||
zone.Actor ! Zone.Lattice.RequestSpawnPoint(1, player, 7)
|
zone.Actor ! Zone.Lattice.RequestSpawnPoint(1, player, 7)
|
||||||
|
|
@ -282,12 +282,12 @@ class ZonePopulationTest extends ActorTest {
|
||||||
val avatar = Avatar("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
val avatar = Avatar("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
assert(zone.Players.isEmpty)
|
assert(zone.Players.isEmpty)
|
||||||
assert(zone.LivePlayers.isEmpty)
|
assert(zone.LivePlayers.isEmpty)
|
||||||
zone.Population ! Zone.Population.Join(avatar)
|
zone.Population ! Zone.Population.Join(avatar)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
assert(zone.Players.size == 1)
|
assert(zone.Players.size == 1)
|
||||||
assert(zone.Players.head == avatar)
|
assert(zone.Players.head == avatar)
|
||||||
assert(zone.LivePlayers.isEmpty)
|
assert(zone.LivePlayers.isEmpty)
|
||||||
|
|
@ -300,12 +300,12 @@ class ZonePopulationTest extends ActorTest {
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
receiveOne(Duration.create(200, "ms")) //consume
|
receiveOne(Duration.create(200, "ms")) //consume
|
||||||
zone.Population ! Zone.Population.Join(avatar)
|
zone.Population ! Zone.Population.Join(avatar)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
|
|
||||||
assert(zone.Players.size == 1)
|
assert(zone.Players.size == 1)
|
||||||
assert(zone.Players.head == avatar)
|
assert(zone.Players.head == avatar)
|
||||||
zone.Population ! Zone.Population.Leave(avatar)
|
zone.Population ! Zone.Population.Leave(avatar)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
assert(zone.Players.isEmpty)
|
assert(zone.Players.isEmpty)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -315,15 +315,15 @@ class ZonePopulationTest extends ActorTest {
|
||||||
val player = Player(avatar)
|
val player = Player(avatar)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
zone.Population ! Zone.Population.Join(avatar)
|
zone.Population ! Zone.Population.Join(avatar)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
|
|
||||||
assert(zone.Players.size == 1)
|
assert(zone.Players.size == 1)
|
||||||
assert(zone.Players.head == avatar)
|
assert(zone.Players.head == avatar)
|
||||||
assert(zone.LivePlayers.isEmpty)
|
assert(zone.LivePlayers.isEmpty)
|
||||||
zone.Population ! Zone.Population.Spawn(avatar, player)
|
zone.Population ! Zone.Population.Spawn(avatar, player)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
assert(zone.Players.size == 1)
|
assert(zone.Players.size == 1)
|
||||||
assert(zone.Players.head == avatar)
|
assert(zone.Players.head == avatar)
|
||||||
assert(zone.LivePlayers.size == 1)
|
assert(zone.LivePlayers.size == 1)
|
||||||
|
|
@ -336,18 +336,18 @@ class ZonePopulationTest extends ActorTest {
|
||||||
val player = Player(avatar)
|
val player = Player(avatar)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
zone.Population ! Zone.Population.Join(avatar)
|
zone.Population ! Zone.Population.Join(avatar)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
zone.Population ! Zone.Population.Spawn(avatar, player)
|
zone.Population ! Zone.Population.Spawn(avatar, player)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
|
|
||||||
assert(zone.Players.size == 1)
|
assert(zone.Players.size == 1)
|
||||||
assert(zone.Players.head == avatar)
|
assert(zone.Players.head == avatar)
|
||||||
assert(zone.LivePlayers.size == 1)
|
assert(zone.LivePlayers.size == 1)
|
||||||
assert(zone.LivePlayers.head == player)
|
assert(zone.LivePlayers.head == player)
|
||||||
zone.Population ! Zone.Population.Release(avatar)
|
zone.Population ! Zone.Population.Release(avatar)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
assert(zone.Players.size == 1)
|
assert(zone.Players.size == 1)
|
||||||
assert(zone.Players.head == avatar)
|
assert(zone.Players.head == avatar)
|
||||||
assert(zone.LivePlayers.isEmpty)
|
assert(zone.LivePlayers.isEmpty)
|
||||||
|
|
@ -360,11 +360,11 @@ class ZonePopulationTest extends ActorTest {
|
||||||
player.GUID = PlanetSideGUID(1)
|
player.GUID = PlanetSideGUID(1)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
zone.Population ! Zone.Population.Join(avatar)
|
zone.Population ! Zone.Population.Join(avatar)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
zone.Population ! Zone.Population.Spawn(avatar, player)
|
zone.Population ! Zone.Population.Spawn(avatar, player)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
|
|
||||||
assert(zone.Players.size == 1)
|
assert(zone.Players.size == 1)
|
||||||
assert(zone.Players.head == avatar)
|
assert(zone.Players.head == avatar)
|
||||||
|
|
@ -386,11 +386,11 @@ class ZonePopulationTest extends ActorTest {
|
||||||
val player2 = Player(avatar)
|
val player2 = Player(avatar)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
zone.Population ! Zone.Population.Join(avatar)
|
zone.Population ! Zone.Population.Join(avatar)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
zone.Population ! Zone.Population.Spawn(avatar, player1)
|
zone.Population ! Zone.Population.Spawn(avatar, player1)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
|
|
||||||
assert(zone.Players.size == 1)
|
assert(zone.Players.size == 1)
|
||||||
assert(zone.Players.head == avatar)
|
assert(zone.Players.head == avatar)
|
||||||
|
|
@ -412,7 +412,7 @@ class ZonePopulationTest extends ActorTest {
|
||||||
val player = Player(avatar)
|
val player = Player(avatar)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
assert(zone.Players.isEmpty)
|
assert(zone.Players.isEmpty)
|
||||||
assert(zone.LivePlayers.isEmpty)
|
assert(zone.LivePlayers.isEmpty)
|
||||||
|
|
@ -430,9 +430,9 @@ class ZonePopulationTest extends ActorTest {
|
||||||
val avatar = Avatar("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
val avatar = Avatar("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
zone.Population ! Zone.Population.Join(avatar)
|
zone.Population ! Zone.Population.Join(avatar)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
|
|
||||||
assert(zone.Players.size == 1)
|
assert(zone.Players.size == 1)
|
||||||
assert(zone.Players.head == avatar)
|
assert(zone.Players.head == avatar)
|
||||||
|
|
@ -453,11 +453,11 @@ class ZonePopulationTest extends ActorTest {
|
||||||
player.Release
|
player.Release
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
assert(zone.Corpses.isEmpty)
|
assert(zone.Corpses.isEmpty)
|
||||||
zone.Population ! Zone.Corpse.Add(player)
|
zone.Population ! Zone.Corpse.Add(player)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
assert(zone.Corpses.size == 1)
|
assert(zone.Corpses.size == 1)
|
||||||
assert(zone.Corpses.head == player)
|
assert(zone.Corpses.head == player)
|
||||||
}
|
}
|
||||||
|
|
@ -468,14 +468,14 @@ class ZonePopulationTest extends ActorTest {
|
||||||
player.Release
|
player.Release
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
zone.Population ! Zone.Corpse.Add(player)
|
zone.Population ! Zone.Corpse.Add(player)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
|
|
||||||
assert(zone.Corpses.size == 1)
|
assert(zone.Corpses.size == 1)
|
||||||
assert(zone.Corpses.head == player)
|
assert(zone.Corpses.head == player)
|
||||||
zone.Population ! Zone.Corpse.Remove(player)
|
zone.Population ! Zone.Corpse.Remove(player)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
assert(zone.Corpses.isEmpty)
|
assert(zone.Corpses.isEmpty)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -489,18 +489,18 @@ class ZonePopulationTest extends ActorTest {
|
||||||
player3.Release
|
player3.Release
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
zone.Population ! Zone.Corpse.Add(player1)
|
zone.Population ! Zone.Corpse.Add(player1)
|
||||||
zone.Population ! Zone.Corpse.Add(player2)
|
zone.Population ! Zone.Corpse.Add(player2)
|
||||||
zone.Population ! Zone.Corpse.Add(player3)
|
zone.Population ! Zone.Corpse.Add(player3)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
|
|
||||||
assert(zone.Corpses.size == 3)
|
assert(zone.Corpses.size == 3)
|
||||||
assert(zone.Corpses.head == player1)
|
assert(zone.Corpses.head == player1)
|
||||||
assert(zone.Corpses(1) == player2)
|
assert(zone.Corpses(1) == player2)
|
||||||
assert(zone.Corpses(2) == player3)
|
assert(zone.Corpses(2) == player3)
|
||||||
zone.Population ! Zone.Corpse.Remove(player2)
|
zone.Population ! Zone.Corpse.Remove(player2)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
assert(zone.Corpses.size == 2)
|
assert(zone.Corpses.size == 2)
|
||||||
assert(zone.Corpses.head == player1)
|
assert(zone.Corpses.head == player1)
|
||||||
assert(zone.Corpses(1) == player3)
|
assert(zone.Corpses(1) == player3)
|
||||||
|
|
@ -512,11 +512,11 @@ class ZonePopulationTest extends ActorTest {
|
||||||
//player.Release !!important
|
//player.Release !!important
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
assert(zone.Corpses.isEmpty)
|
assert(zone.Corpses.isEmpty)
|
||||||
zone.Population ! Zone.Corpse.Add(player)
|
zone.Population ! Zone.Corpse.Add(player)
|
||||||
expectNoMsg(Duration.create(100, "ms"))
|
expectNoMessage(Duration.create(100, "ms"))
|
||||||
assert(zone.Corpses.isEmpty)
|
assert(zone.Corpses.isEmpty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -530,7 +530,7 @@ class ZoneGroundDropItemTest extends ActorTest {
|
||||||
zone.GUID(hub)
|
zone.GUID(hub)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"DropItem" should {
|
"DropItem" should {
|
||||||
"drop item on ground" in {
|
"drop item on ground" in {
|
||||||
|
|
@ -556,7 +556,7 @@ class ZoneGroundCanNotDropItem1Test extends ActorTest {
|
||||||
zone.GUID(hub)
|
zone.GUID(hub)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"DropItem" should {
|
"DropItem" should {
|
||||||
"not drop an item that is not registered" in {
|
"not drop an item that is not registered" in {
|
||||||
|
|
@ -582,7 +582,7 @@ class ZoneGroundCanNotDropItem2Test extends ActorTest {
|
||||||
//zone.GUID(hub) //!important
|
//zone.GUID(hub) //!important
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"DropItem" should {
|
"DropItem" should {
|
||||||
"not drop an item that is not registered to the zone" in {
|
"not drop an item that is not registered to the zone" in {
|
||||||
|
|
@ -608,7 +608,7 @@ class ZoneGroundCanNotDropItem3Test extends ActorTest {
|
||||||
zone.GUID(hub) //!important
|
zone.GUID(hub) //!important
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"DropItem" should {
|
"DropItem" should {
|
||||||
"not drop an item that has already been dropped" in {
|
"not drop an item that has already been dropped" in {
|
||||||
|
|
@ -642,7 +642,7 @@ class ZoneGroundPickupItemTest extends ActorTest {
|
||||||
zone.GUID(hub)
|
zone.GUID(hub)
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"PickupItem" should {
|
"PickupItem" should {
|
||||||
"pickup an item from ground" in {
|
"pickup an item from ground" in {
|
||||||
|
|
@ -671,7 +671,7 @@ class ZoneGroundCanNotPickupItemTest extends ActorTest {
|
||||||
zone.GUID(hub) //still registered to this zone
|
zone.GUID(hub) //still registered to this zone
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"PickupItem" should {
|
"PickupItem" should {
|
||||||
"not pickup an item if it can not be found" in {
|
"not pickup an item if it can not be found" in {
|
||||||
|
|
@ -696,7 +696,7 @@ class ZoneGroundRemoveItemTest extends ActorTest {
|
||||||
zone.GUID(hub) //still registered to this zone
|
zone.GUID(hub) //still registered to this zone
|
||||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||||
zone.Actor ! Zone.Init()
|
zone.Actor ! Zone.Init()
|
||||||
expectNoMsg(200 milliseconds)
|
expectNoMessage(200 milliseconds)
|
||||||
|
|
||||||
"RemoveItem" should {
|
"RemoveItem" should {
|
||||||
"remove an item from the ground without callback (even if the item is not found)" in {
|
"remove an item from the ground without callback (even if the item is not found)" in {
|
||||||
|
|
@ -707,11 +707,11 @@ class ZoneGroundRemoveItemTest extends ActorTest {
|
||||||
assert(zone.EquipmentOnGround.contains(item)) //dropped
|
assert(zone.EquipmentOnGround.contains(item)) //dropped
|
||||||
|
|
||||||
zone.Ground ! Zone.Ground.RemoveItem(item.GUID)
|
zone.Ground ! Zone.Ground.RemoveItem(item.GUID)
|
||||||
expectNoMsg(500 milliseconds)
|
expectNoMessage(500 milliseconds)
|
||||||
assert(!zone.EquipmentOnGround.contains(item))
|
assert(!zone.EquipmentOnGround.contains(item))
|
||||||
|
|
||||||
zone.Ground ! Zone.Ground.RemoveItem(item.GUID) //repeat
|
zone.Ground ! Zone.Ground.RemoveItem(item.GUID) //repeat
|
||||||
expectNoMsg(500 milliseconds)
|
expectNoMessage(500 milliseconds)
|
||||||
assert(!zone.EquipmentOnGround.contains(item))
|
assert(!zone.EquipmentOnGround.contains(item))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ class UniqueNumberSystemTest9 extends ActorTest() {
|
||||||
guid.AddPool("pool3", (5001 to 6000).toList).Selector = new RandomSelector
|
guid.AddPool("pool3", (5001 to 6000).toList).Selector = new RandomSelector
|
||||||
val uns = system.actorOf(Props(classOf[UniqueNumberSystem], guid, UniqueNumberSystemTest.AllocateNumberPoolActors(guid)), "uns")
|
val uns = system.actorOf(Props(classOf[UniqueNumberSystem], guid, UniqueNumberSystemTest.AllocateNumberPoolActors(guid)), "uns")
|
||||||
val excp = new Exception("EXCEPTION MESSAGE")
|
val excp = new Exception("EXCEPTION MESSAGE")
|
||||||
expectNoMsg(Duration.create(200, "ms"))
|
expectNoMessage(Duration.create(200, "ms"))
|
||||||
|
|
||||||
//GiveNumber
|
//GiveNumber
|
||||||
uns ! NumberPoolActor.GiveNumber(1001, Some("test")) //no task associated with id="test"
|
uns ! NumberPoolActor.GiveNumber(1001, Some("test")) //no task associated with id="test"
|
||||||
|
|
@ -319,7 +319,7 @@ class UniqueNumberSystemTestA extends ActorTest {
|
||||||
val guid : NumberPoolHub = new NumberPoolHub(src)
|
val guid : NumberPoolHub = new NumberPoolHub(src)
|
||||||
guid.AddPool("pool1", (0 until 10).toList).Selector = new RandomSelector
|
guid.AddPool("pool1", (0 until 10).toList).Selector = new RandomSelector
|
||||||
val uns = system.actorOf(Props(classOf[UniqueNumberSystem], guid, UniqueNumberSystemTest.AllocateNumberPoolActors(guid)), "uns")
|
val uns = system.actorOf(Props(classOf[UniqueNumberSystem], guid, UniqueNumberSystemTest.AllocateNumberPoolActors(guid)), "uns")
|
||||||
expectNoMsg(Duration.create(200, "ms"))
|
expectNoMessage(Duration.create(200, "ms"))
|
||||||
|
|
||||||
assert(src.CountUsed == 0)
|
assert(src.CountUsed == 0)
|
||||||
(0 to 4).foreach(i => { assert(guid.register(new EntityTestClass(), i).isSuccess) })
|
(0 to 4).foreach(i => { assert(guid.register(new EntityTestClass(), i).isSuccess) })
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ class ProximityTerminalControlStartTest extends ActorTest {
|
||||||
avatar.GUID = PlanetSideGUID(1)
|
avatar.GUID = PlanetSideGUID(1)
|
||||||
terminal.GUID = PlanetSideGUID(2)
|
terminal.GUID = PlanetSideGUID(2)
|
||||||
terminal.Actor ! Service.Startup()
|
terminal.Actor ! Service.Startup()
|
||||||
expectNoMsg(500 milliseconds) //spacer
|
expectNoMessage(500 milliseconds) //spacer
|
||||||
val probe1 = new TestProbe(system, "local-events")
|
val probe1 = new TestProbe(system, "local-events")
|
||||||
val probe2 = new TestProbe(system, "target-callback")
|
val probe2 = new TestProbe(system, "target-callback")
|
||||||
zone.LocalEvents = probe1.ref
|
zone.LocalEvents = probe1.ref
|
||||||
|
|
@ -160,7 +160,7 @@ class ProximityTerminalControlTwoUsersTest extends ActorTest {
|
||||||
avatar2.GUID = PlanetSideGUID(2)
|
avatar2.GUID = PlanetSideGUID(2)
|
||||||
terminal.GUID = PlanetSideGUID(3)
|
terminal.GUID = PlanetSideGUID(3)
|
||||||
terminal.Actor ! Service.Startup()
|
terminal.Actor ! Service.Startup()
|
||||||
expectNoMsg(500 milliseconds) //spacer
|
expectNoMessage(500 milliseconds) //spacer
|
||||||
val probe1 = new TestProbe(system, "local-events")
|
val probe1 = new TestProbe(system, "local-events")
|
||||||
val probe2 = new TestProbe(system, "target-callback-1")
|
val probe2 = new TestProbe(system, "target-callback-1")
|
||||||
val probe3 = new TestProbe(system, "target-callback-2")
|
val probe3 = new TestProbe(system, "target-callback-2")
|
||||||
|
|
@ -175,7 +175,7 @@ class ProximityTerminalControlTwoUsersTest extends ActorTest {
|
||||||
probe2.expectMsgClass(1 second, classOf[ProximityUnit.Action])
|
probe2.expectMsgClass(1 second, classOf[ProximityUnit.Action])
|
||||||
|
|
||||||
terminal.Actor.tell(CommonMessages.Use(avatar2, Some(avatar2)), probe3.ref)
|
terminal.Actor.tell(CommonMessages.Use(avatar2, Some(avatar2)), probe3.ref)
|
||||||
probe1.expectNoMsg(1 second)
|
probe1.expectNoMessage(1 second)
|
||||||
probe2.expectMsgClass(1 second, classOf[ProximityUnit.Action])
|
probe2.expectMsgClass(1 second, classOf[ProximityUnit.Action])
|
||||||
probe3.expectMsgClass(1 second, classOf[ProximityUnit.Action])
|
probe3.expectMsgClass(1 second, classOf[ProximityUnit.Action])
|
||||||
assert(terminal.NumberUsers == 2)
|
assert(terminal.NumberUsers == 2)
|
||||||
|
|
@ -206,7 +206,7 @@ class ProximityTerminalControlStopTest extends ActorTest {
|
||||||
avatar.GUID = PlanetSideGUID(1)
|
avatar.GUID = PlanetSideGUID(1)
|
||||||
terminal.GUID = PlanetSideGUID(2)
|
terminal.GUID = PlanetSideGUID(2)
|
||||||
terminal.Actor ! Service.Startup()
|
terminal.Actor ! Service.Startup()
|
||||||
expectNoMsg(500 milliseconds) //spacer
|
expectNoMessage(500 milliseconds) //spacer
|
||||||
val probe1 = new TestProbe(system, "local-events")
|
val probe1 = new TestProbe(system, "local-events")
|
||||||
val probe2 = new TestProbe(system, "target-callback-1")
|
val probe2 = new TestProbe(system, "target-callback-1")
|
||||||
zone.LocalEvents = probe1.ref
|
zone.LocalEvents = probe1.ref
|
||||||
|
|
@ -255,7 +255,7 @@ class ProximityTerminalControlNotStopTest extends ActorTest {
|
||||||
avatar2.GUID = PlanetSideGUID(2)
|
avatar2.GUID = PlanetSideGUID(2)
|
||||||
terminal.GUID = PlanetSideGUID(3)
|
terminal.GUID = PlanetSideGUID(3)
|
||||||
terminal.Actor ! Service.Startup()
|
terminal.Actor ! Service.Startup()
|
||||||
expectNoMsg(500 milliseconds) //spacer
|
expectNoMessage(500 milliseconds) //spacer
|
||||||
val probe1 = new TestProbe(system, "local-events")
|
val probe1 = new TestProbe(system, "local-events")
|
||||||
val probe2 = new TestProbe(system, "target-callback-1")
|
val probe2 = new TestProbe(system, "target-callback-1")
|
||||||
val probe3 = new TestProbe(system, "target-callback-2")
|
val probe3 = new TestProbe(system, "target-callback-2")
|
||||||
|
|
@ -270,11 +270,11 @@ class ProximityTerminalControlNotStopTest extends ActorTest {
|
||||||
assert(terminal.NumberUsers == 1)
|
assert(terminal.NumberUsers == 1)
|
||||||
|
|
||||||
terminal.Actor.tell(CommonMessages.Use(avatar2, Some(avatar2)), probe3.ref)
|
terminal.Actor.tell(CommonMessages.Use(avatar2, Some(avatar2)), probe3.ref)
|
||||||
probe1.expectNoMsg(100 millisecond)
|
probe1.expectNoMessage(100 millisecond)
|
||||||
assert(terminal.NumberUsers == 2)
|
assert(terminal.NumberUsers == 2)
|
||||||
|
|
||||||
terminal.Actor ! CommonMessages.Unuse(avatar, Some(avatar))
|
terminal.Actor ! CommonMessages.Unuse(avatar, Some(avatar))
|
||||||
probe1.expectNoMsg(100 millisecond)
|
probe1.expectNoMessage(100 millisecond)
|
||||||
assert(terminal.NumberUsers == 1)
|
assert(terminal.NumberUsers == 1)
|
||||||
|
|
||||||
terminal.Actor ! CommonMessages.Unuse(avatar2, Some(avatar2))
|
terminal.Actor ! CommonMessages.Unuse(avatar2, Some(avatar2))
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class TerminalControl2Test extends ActorTest {
|
||||||
val (_, terminal) = TerminalControlTest.SetUpAgents(GlobalDefinitions.cert_terminal, PlanetSideEmpire.TR)
|
val (_, terminal) = TerminalControlTest.SetUpAgents(GlobalDefinitions.cert_terminal, PlanetSideEmpire.TR)
|
||||||
|
|
||||||
terminal.Actor !"hello"
|
terminal.Actor !"hello"
|
||||||
expectNoMsg(Duration.create(500, "ms"))
|
expectNoMessage(Duration.create(500, "ms"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class LocalService5Test extends ActorTest {
|
||||||
val service = system.actorOf(Props(classOf[LocalService], Zone.Nowhere), "l_service")
|
val service = system.actorOf(Props(classOf[LocalService], Zone.Nowhere), "l_service")
|
||||||
service ! Service.Join("test")
|
service ! Service.Join("test")
|
||||||
service ! "hello"
|
service ! "hello"
|
||||||
expectNoMsg()
|
expectNoMessage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "handle a simple task" in {
|
// "handle a simple task" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val remover = system.actorOf(
|
// val remover = system.actorOf(
|
||||||
// Props(classOf[ActorTest.SupportActorInterface], Props[RemoverActorTest.TestRemover], self),
|
// Props(classOf[ActorTest.SupportActorInterface], Props[RemoverActorTest.TestRemover], self),
|
||||||
// "test-remover"
|
// "test-remover"
|
||||||
|
|
@ -31,7 +31,7 @@ import scala.concurrent.duration._
|
||||||
// assert(reply1.isInstanceOf[RemoverActorTest.InclusionTestAlert])
|
// assert(reply1.isInstanceOf[RemoverActorTest.InclusionTestAlert])
|
||||||
// val reply2 = receiveOne(500 milliseconds)
|
// val reply2 = receiveOne(500 milliseconds)
|
||||||
// assert(reply2.isInstanceOf[RemoverActorTest.InitialJobAlert])
|
// assert(reply2.isInstanceOf[RemoverActorTest.InitialJobAlert])
|
||||||
// expectNoMsg(1 seconds) //delay
|
// expectNoMessage(1 seconds) //delay
|
||||||
// val reply3 = receiveOne(500 milliseconds)
|
// val reply3 = receiveOne(500 milliseconds)
|
||||||
// assert(reply3.isInstanceOf[RemoverActorTest.FirstJobAlert])
|
// assert(reply3.isInstanceOf[RemoverActorTest.FirstJobAlert])
|
||||||
// val reply4 = receiveOne(500 milliseconds)
|
// val reply4 = receiveOne(500 milliseconds)
|
||||||
|
|
@ -51,7 +51,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "handle a simple task (timed)" in {
|
// "handle a simple task (timed)" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val remover = system.actorOf(
|
// val remover = system.actorOf(
|
||||||
// Props(classOf[ActorTest.SupportActorInterface], Props[RemoverActorTest.TestRemover], self),
|
// Props(classOf[ActorTest.SupportActorInterface], Props[RemoverActorTest.TestRemover], self),
|
||||||
// "test-remover"
|
// "test-remover"
|
||||||
|
|
@ -83,7 +83,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "allow only specific objects" in {
|
// "allow only specific objects" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val probe = TestProbe()
|
// val probe = TestProbe()
|
||||||
// val remover = system.actorOf(
|
// val remover = system.actorOf(
|
||||||
// Props(classOf[ActorTest.SupportActorInterface], Props[RemoverActorTest.TestRemover], self),
|
// Props(classOf[ActorTest.SupportActorInterface], Props[RemoverActorTest.TestRemover], self),
|
||||||
|
|
@ -93,7 +93,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// val reply1 = probe.receiveOne(200 milliseconds)
|
// val reply1 = probe.receiveOne(200 milliseconds)
|
||||||
// assert(reply1.isInstanceOf[RemoverActorTest.InclusionTestAlert])
|
// assert(reply1.isInstanceOf[RemoverActorTest.InclusionTestAlert])
|
||||||
// expectNoMsg(2 seconds)
|
// expectNoMessage(2 seconds)
|
||||||
// //RemoverActor is stalled because it received an object that it was not allowed to act upon
|
// //RemoverActor is stalled because it received an object that it was not allowed to act upon
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
@ -105,7 +105,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "work on parallel tasks" in {
|
// "work on parallel tasks" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val probe = TestProbe()
|
// val probe = TestProbe()
|
||||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere)
|
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere)
|
||||||
|
|
@ -139,7 +139,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "be able to hurry certain tasks" in {
|
// "be able to hurry certain tasks" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val probe = TestProbe()
|
// val probe = TestProbe()
|
||||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(10 minutes)) //TEN MINUTE WAIT
|
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(10 minutes)) //TEN MINUTE WAIT
|
||||||
|
|
@ -148,7 +148,7 @@ import scala.concurrent.duration._
|
||||||
// assert(reply1.isInstanceOf[RemoverActorTest.InclusionTestAlert])
|
// assert(reply1.isInstanceOf[RemoverActorTest.InclusionTestAlert])
|
||||||
// val reply2 = probe.receiveOne(200 milliseconds)
|
// val reply2 = probe.receiveOne(200 milliseconds)
|
||||||
// assert(reply2.isInstanceOf[RemoverActorTest.InitialJobAlert])
|
// assert(reply2.isInstanceOf[RemoverActorTest.InitialJobAlert])
|
||||||
// probe.expectNoMsg(3 seconds) //long delay, longer than standard but not yet 10 minutes
|
// probe.expectNoMessage(3 seconds) //long delay, longer than standard but not yet 10 minutes
|
||||||
// remover ! RemoverActor.HurrySpecific(List(RemoverActorTest.TestObject), Zone.Nowhere) //hurried
|
// remover ! RemoverActor.HurrySpecific(List(RemoverActorTest.TestObject), Zone.Nowhere) //hurried
|
||||||
// val reply3 = probe.receiveOne(300 milliseconds)
|
// val reply3 = probe.receiveOne(300 milliseconds)
|
||||||
// assert(reply3.isInstanceOf[RemoverActorTest.FirstJobAlert])
|
// assert(reply3.isInstanceOf[RemoverActorTest.FirstJobAlert])
|
||||||
|
|
@ -170,7 +170,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "be able to hurry certain tasks, but let others finish normally" in {
|
// "be able to hurry certain tasks, but let others finish normally" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val probe = TestProbe()
|
// val probe = TestProbe()
|
||||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||||
|
|
@ -185,7 +185,7 @@ import scala.concurrent.duration._
|
||||||
// case msg => assert(false, s"$msg")
|
// case msg => assert(false, s"$msg")
|
||||||
// }
|
// }
|
||||||
// assert(ita == 2 && ija == 2)
|
// assert(ita == 2 && ija == 2)
|
||||||
// probe.expectNoMsg(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
// probe.expectNoMessage(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||||
// remover ! RemoverActor.HurrySpecific(List(RemoverActorTest.TestObject), Zone.Nowhere) //hurried
|
// remover ! RemoverActor.HurrySpecific(List(RemoverActorTest.TestObject), Zone.Nowhere) //hurried
|
||||||
// //first
|
// //first
|
||||||
// val reply3a = probe.receiveOne(300 milliseconds)
|
// val reply3a = probe.receiveOne(300 milliseconds)
|
||||||
|
|
@ -221,7 +221,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "be able to hurry certain tasks, but only valid ones" in {
|
// "be able to hurry certain tasks, but only valid ones" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val probe = TestProbe()
|
// val probe = TestProbe()
|
||||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||||
|
|
@ -236,7 +236,7 @@ import scala.concurrent.duration._
|
||||||
// case msg => assert(false, s"$msg")
|
// case msg => assert(false, s"$msg")
|
||||||
// }
|
// }
|
||||||
// assert(ita == 2 && ija == 2)
|
// assert(ita == 2 && ija == 2)
|
||||||
// probe.expectNoMsg(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
// probe.expectNoMessage(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||||
// remover ! RemoverActor.HurrySpecific(List(RemoverActorTest.TestObject, TestObject3), Zone.Nowhere) //multiple hurried, only one valid
|
// remover ! RemoverActor.HurrySpecific(List(RemoverActorTest.TestObject, TestObject3), Zone.Nowhere) //multiple hurried, only one valid
|
||||||
// //first
|
// //first
|
||||||
// val reply3a = probe.receiveOne(300 milliseconds)
|
// val reply3a = probe.receiveOne(300 milliseconds)
|
||||||
|
|
@ -273,7 +273,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "be able to hurry certain tasks by their zone" in {
|
// "be able to hurry certain tasks by their zone" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val probe = TestProbe()
|
// val probe = TestProbe()
|
||||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||||
|
|
@ -289,7 +289,7 @@ import scala.concurrent.duration._
|
||||||
// case msg => assert(false, s"$msg")
|
// case msg => assert(false, s"$msg")
|
||||||
// }
|
// }
|
||||||
// assert(ita == 3 && ija == 3)
|
// assert(ita == 3 && ija == 3)
|
||||||
// probe.expectNoMsg(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
// probe.expectNoMessage(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||||
// remover ! RemoverActor.HurrySpecific(List(), Zone.Nowhere) //multiple hurried, only the two entries with Zone.Nowhere
|
// remover ! RemoverActor.HurrySpecific(List(), Zone.Nowhere) //multiple hurried, only the two entries with Zone.Nowhere
|
||||||
// //
|
// //
|
||||||
// val replies2 = probe.receiveN(10, 5 seconds)
|
// val replies2 = probe.receiveN(10, 5 seconds)
|
||||||
|
|
@ -332,7 +332,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "be able to hurry all tasks to completion" in {
|
// "be able to hurry all tasks to completion" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val probe = TestProbe()
|
// val probe = TestProbe()
|
||||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(20 seconds))
|
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(20 seconds))
|
||||||
|
|
@ -348,7 +348,7 @@ import scala.concurrent.duration._
|
||||||
// case msg => assert(false, s"$msg")
|
// case msg => assert(false, s"$msg")
|
||||||
// }
|
// }
|
||||||
// assert(ita == 3 && ija == 3)
|
// assert(ita == 3 && ija == 3)
|
||||||
// probe.expectNoMsg(3 seconds) //long delay, longer than standard but not yet longer than any of the tasks
|
// probe.expectNoMessage(3 seconds) //long delay, longer than standard but not yet longer than any of the tasks
|
||||||
// remover ! RemoverActor.HurryAll() //all hurried
|
// remover ! RemoverActor.HurryAll() //all hurried
|
||||||
// //
|
// //
|
||||||
// val replies2 = probe.receiveN(15, 5 seconds)
|
// val replies2 = probe.receiveN(15, 5 seconds)
|
||||||
|
|
@ -378,7 +378,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "be able to clear certain tasks" in {
|
// "be able to clear certain tasks" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val probe = TestProbe()
|
// val probe = TestProbe()
|
||||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||||
|
|
@ -393,7 +393,7 @@ import scala.concurrent.duration._
|
||||||
// case msg => assert(false, s"$msg")
|
// case msg => assert(false, s"$msg")
|
||||||
// }
|
// }
|
||||||
// assert(ita == 2 && ija == 2)
|
// assert(ita == 2 && ija == 2)
|
||||||
// probe.expectNoMsg(4 seconds) //long delay, longer than standard but not yet 5 seconds
|
// probe.expectNoMessage(4 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||||
// remover ! RemoverActor.ClearSpecific(List(RemoverActorTest.TestObject), Zone.Nowhere) //cleared
|
// remover ! RemoverActor.ClearSpecific(List(RemoverActorTest.TestObject), Zone.Nowhere) //cleared
|
||||||
// //
|
// //
|
||||||
// val reply3 = probe.receiveOne(2 seconds)
|
// val reply3 = probe.receiveOne(2 seconds)
|
||||||
|
|
@ -407,7 +407,7 @@ import scala.concurrent.duration._
|
||||||
// val reply7 = probe.receiveOne(500 milliseconds)
|
// val reply7 = probe.receiveOne(500 milliseconds)
|
||||||
// assert(reply7.isInstanceOf[RemoverActorTest.DeletionTaskRunAlert])
|
// assert(reply7.isInstanceOf[RemoverActorTest.DeletionTaskRunAlert])
|
||||||
// //wait
|
// //wait
|
||||||
// probe.expectNoMsg(2 seconds) //nothing more to do
|
// probe.expectNoMessage(2 seconds) //nothing more to do
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
@ -418,7 +418,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "be able to clear all tasks, with no more work on them" in {
|
// "be able to clear all tasks, with no more work on them" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val probe = TestProbe()
|
// val probe = TestProbe()
|
||||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||||
|
|
@ -433,10 +433,10 @@ import scala.concurrent.duration._
|
||||||
// case msg => assert(false, s"$msg")
|
// case msg => assert(false, s"$msg")
|
||||||
// }
|
// }
|
||||||
// assert(ita == 2 && ija == 2)
|
// assert(ita == 2 && ija == 2)
|
||||||
// probe.expectNoMsg(4 seconds) //long delay, longer than standard but not yet 5 seconds
|
// probe.expectNoMessage(4 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||||
// remover ! RemoverActor.ClearAll() //cleared
|
// remover ! RemoverActor.ClearAll() //cleared
|
||||||
// //wait
|
// //wait
|
||||||
// probe.expectNoMsg(3 seconds) //nothing more to do
|
// probe.expectNoMessage(3 seconds) //nothing more to do
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
@ -447,7 +447,7 @@ import scala.concurrent.duration._
|
||||||
//
|
//
|
||||||
// "RemoverActor" should {
|
// "RemoverActor" should {
|
||||||
// "be able to hurry certain tasks" in {
|
// "be able to hurry certain tasks" in {
|
||||||
// expectNoMsg(500 milliseconds)
|
// expectNoMessage(500 milliseconds)
|
||||||
// val probe = TestProbe()
|
// val probe = TestProbe()
|
||||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||||
|
|
@ -462,7 +462,7 @@ import scala.concurrent.duration._
|
||||||
// case msg => assert(false, s"$msg")
|
// case msg => assert(false, s"$msg")
|
||||||
// }
|
// }
|
||||||
// assert(ita == 2 && ija == 2)
|
// assert(ita == 2 && ija == 2)
|
||||||
// probe.expectNoMsg(2 seconds)
|
// probe.expectNoMessage(2 seconds)
|
||||||
// remover ! akka.actor.PoisonPill
|
// remover ! akka.actor.PoisonPill
|
||||||
// //
|
// //
|
||||||
// val replies2 = probe.receiveN(8, 5 seconds)
|
// val replies2 = probe.receiveN(8, 5 seconds)
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ class RouterTelepadActivationClearAllTest extends ActorTest {
|
||||||
obj ! RouterTelepadActivation.AddTask(telepad2, Zone.Nowhere, Some(2 seconds))
|
obj ! RouterTelepadActivation.AddTask(telepad2, Zone.Nowhere, Some(2 seconds))
|
||||||
obj ! RouterTelepadActivation.AddTask(telepad3, Zone.Nowhere, Some(2 seconds))
|
obj ! RouterTelepadActivation.AddTask(telepad3, Zone.Nowhere, Some(2 seconds))
|
||||||
obj ! SupportActor.ClearAll()
|
obj ! SupportActor.ClearAll()
|
||||||
expectNoMsg(4 seconds)
|
expectNoMessage(4 seconds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ class VehicleService5Test extends ActorTest {
|
||||||
val service = system.actorOf(Props(classOf[VehicleService], Zone.Nowhere), "v-service")
|
val service = system.actorOf(Props(classOf[VehicleService], Zone.Nowhere), "v-service")
|
||||||
service ! Service.Join("test")
|
service ! Service.Join("test")
|
||||||
service ! "hello"
|
service ! "hello"
|
||||||
expectNoMsg()
|
expectNoMessage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@ logLevel := Level.Warn
|
||||||
|
|
||||||
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.12")
|
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.12")
|
||||||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
|
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
|
||||||
addSbtPlugin("io.kamon" % "sbt-kanela-runner" % "2.0.6")
|
//addSbtPlugin("io.kamon" % "sbt-kanela-runner" % "2.0.6")
|
||||||
// https://github.com/sbt/sbt-unidoc
|
// https://github.com/sbt/sbt-unidoc
|
||||||
//addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.2")
|
//addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.2")
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ class LoginSessionActor extends Actor with MDCContextAware {
|
||||||
case FinishAccountLogin(connection, username, newToken, isSuccessfulLogin, isInactive) =>
|
case FinishAccountLogin(connection, username, newToken, isSuccessfulLogin, isInactive) =>
|
||||||
if(isSuccessfulLogin) { // Login OK
|
if(isSuccessfulLogin) { // Login OK
|
||||||
loginSuccessfulResponse(username, newToken)
|
loginSuccessfulResponse(username, newToken)
|
||||||
updateServerListTask = context.system.scheduler.schedule(0 seconds, 2 seconds, self, UpdateServerList())
|
updateServerListTask = context.system.scheduler.scheduleWithFixedDelay(0 seconds, 2 seconds, self, UpdateServerList())
|
||||||
} else {
|
} else {
|
||||||
if (!isInactive && connection.nonEmpty) { // Bad Password
|
if (!isInactive && connection.nonEmpty) { // Bad Password
|
||||||
loginPwdFailureResponse(username, newToken)
|
loginPwdFailureResponse(username, newToken)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import net.psforever.objects.zones.ZoneMap
|
||||||
import zonemaps._
|
import zonemaps._
|
||||||
|
|
||||||
import scala.concurrent.Future
|
import scala.concurrent.Future
|
||||||
import scala.util.Success
|
import scala.util.{Failure, Success}
|
||||||
|
|
||||||
object Maps {
|
object Maps {
|
||||||
import scala.concurrent.ExecutionContext.Implicits.global
|
import scala.concurrent.ExecutionContext.Implicits.global
|
||||||
|
|
@ -57,8 +57,8 @@ object Maps {
|
||||||
def InitZoneMap(future : Future[ZoneMap]): Future[ZoneMap] = {
|
def InitZoneMap(future : Future[ZoneMap]): Future[ZoneMap] = {
|
||||||
future onComplete {
|
future onComplete {
|
||||||
case Success(x) => Projectiles(x)
|
case Success(x) => Projectiles(x)
|
||||||
|
case Failure(_) => throw new RuntimeException("Maps: failure when setting up map") //should not fail?
|
||||||
}
|
}
|
||||||
|
|
||||||
future
|
future
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -30,7 +30,7 @@ import scala.collection.JavaConverters._
|
||||||
import scala.concurrent.Await
|
import scala.concurrent.Await
|
||||||
import scala.concurrent.duration._
|
import scala.concurrent.duration._
|
||||||
|
|
||||||
import kamon.Kamon
|
//import kamon.Kamon
|
||||||
|
|
||||||
object PsLogin {
|
object PsLogin {
|
||||||
private val logger = org.log4s.getLogger
|
private val logger = org.log4s.getLogger
|
||||||
|
|
@ -217,7 +217,7 @@ object PsLogin {
|
||||||
case true =>
|
case true =>
|
||||||
logger.info("Starting Kamon")
|
logger.info("Starting Kamon")
|
||||||
|
|
||||||
Kamon.init()
|
//Kamon.init()
|
||||||
case _ => ;
|
case _ => ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class SessionRouter(role : String, pipeline : List[SessionPipeline]) extends Act
|
||||||
private[this] val log = org.log4s.getLogger(self.path.name)
|
private[this] val log = org.log4s.getLogger(self.path.name)
|
||||||
|
|
||||||
import scala.concurrent.ExecutionContext.Implicits.global
|
import scala.concurrent.ExecutionContext.Implicits.global
|
||||||
val sessionReaper = context.system.scheduler.schedule(10 seconds, 5 seconds, self, SessionReaper())
|
val sessionReaper = context.system.scheduler.scheduleWithFixedDelay(10 seconds, 5 seconds, self, SessionReaper())
|
||||||
|
|
||||||
val idBySocket = mutable.Map[InetSocketAddress, Long]()
|
val idBySocket = mutable.Map[InetSocketAddress, Long]()
|
||||||
val sessionById = mutable.Map[Long, Session]()
|
val sessionById = mutable.Map[Long, Session]()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright (c) 2017 PSForever
|
// Copyright (c) 2017 PSForever
|
||||||
import akka.actor.{Actor, ActorRef}
|
import akka.actor.{Actor, ActorRef}
|
||||||
import akka.io._
|
import akka.io._
|
||||||
import akka.util.ByteString
|
|
||||||
|
|
||||||
import scala.util.Random
|
import scala.util.Random
|
||||||
import scala.collection.mutable
|
import scala.collection.mutable
|
||||||
|
|
@ -25,7 +24,7 @@ case class NetworkSimulatorParameters(packetLoss : Double,
|
||||||
assert(packetReorderingTime >= 0)
|
assert(packetReorderingTime >= 0)
|
||||||
|
|
||||||
override def toString = "NetSimParams: loss %.2f%% / delay %dms / reorder %.2f%% / reorder +/- %dms".format(
|
override def toString = "NetSimParams: loss %.2f%% / delay %dms / reorder %.2f%% / reorder +/- %dms".format(
|
||||||
packetLoss*100, packetDelay, packetReorderingChance*100, packetReorderingTime);
|
packetLoss*100, packetDelay, packetReorderingChance*100, packetReorderingTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -34,10 +33,6 @@ class UdpNetworkSimulator(server : ActorRef, params : NetworkSimulatorParameters
|
||||||
|
|
||||||
import scala.concurrent.ExecutionContext.Implicits.global
|
import scala.concurrent.ExecutionContext.Implicits.global
|
||||||
|
|
||||||
//******* Internal messages
|
|
||||||
private final case class ProcessInputQueue()
|
|
||||||
private final case class ProcessOutputQueue()
|
|
||||||
|
|
||||||
//******* Variables
|
//******* Variables
|
||||||
val packetDelayDuration = (params.packetDelay/2).milliseconds
|
val packetDelayDuration = (params.packetDelay/2).milliseconds
|
||||||
|
|
||||||
|
|
@ -53,7 +48,7 @@ class UdpNetworkSimulator(server : ActorRef, params : NetworkSimulatorParameters
|
||||||
var interface = ActorRef.noSender
|
var interface = ActorRef.noSender
|
||||||
|
|
||||||
def receive = {
|
def receive = {
|
||||||
case ProcessInputQueue() =>
|
case UdpNetworkSimulator.ProcessInputQueue() =>
|
||||||
val time = System.nanoTime()
|
val time = System.nanoTime()
|
||||||
var exit = false
|
var exit = false
|
||||||
|
|
||||||
|
|
@ -68,7 +63,7 @@ class UdpNetworkSimulator(server : ActorRef, params : NetworkSimulatorParameters
|
||||||
exit = true
|
exit = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case ProcessOutputQueue() =>
|
case UdpNetworkSimulator.ProcessOutputQueue() =>
|
||||||
val time = System.nanoTime()
|
val time = System.nanoTime()
|
||||||
var exit = false
|
var exit = false
|
||||||
|
|
||||||
|
|
@ -132,6 +127,12 @@ class UdpNetworkSimulator(server : ActorRef, params : NetworkSimulatorParameters
|
||||||
def schedule(duration : FiniteDuration, outbound : Boolean) = context.system.scheduler.scheduleOnce(
|
def schedule(duration : FiniteDuration, outbound : Boolean) = context.system.scheduler.scheduleOnce(
|
||||||
packetDelayDuration,
|
packetDelayDuration,
|
||||||
self,
|
self,
|
||||||
if(outbound) ProcessOutputQueue() else ProcessInputQueue()
|
if(outbound) UdpNetworkSimulator.ProcessOutputQueue() else UdpNetworkSimulator.ProcessInputQueue()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object UdpNetworkSimulator {
|
||||||
|
//******* Internal messages
|
||||||
|
private final case class ProcessInputQueue()
|
||||||
|
private final case class ProcessOutputQueue()
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -729,7 +729,7 @@ class WorldSessionActor extends Actor
|
||||||
case scala.util.Success(connection) =>
|
case scala.util.Success(connection) =>
|
||||||
val accountUserName : String = account.Username
|
val accountUserName : String = account.Username
|
||||||
connection.sendPreparedStatement(
|
connection.sendPreparedStatement(
|
||||||
"SELECT id, name, faction_id, gender_id, head_id, voice_id, deleted, last_login FROM characters where account_id=? ORDER BY last_login", Array(account.AccountId)
|
"SELECT id, name, faction_id, gender_id, head_id, voice_id, deleted, last_login FROM characters where account_id=? ORDER BY last_login", Array(account.AccountId).toIndexedSeq
|
||||||
).onComplete {
|
).onComplete {
|
||||||
case scala.util.Success(result : QueryResult) =>
|
case scala.util.Success(result : QueryResult) =>
|
||||||
if(connection.isConnected) connection.disconnect
|
if(connection.isConnected) connection.disconnect
|
||||||
|
|
@ -1558,7 +1558,7 @@ class WorldSessionActor extends Actor
|
||||||
Database.getConnection.connect.onComplete {
|
Database.getConnection.connect.onComplete {
|
||||||
case scala.util.Success(connection) =>
|
case scala.util.Success(connection) =>
|
||||||
Database.query(connection.sendPreparedStatement(
|
Database.query(connection.sendPreparedStatement(
|
||||||
"SELECT gm FROM accounts where id=?", Array(account.AccountId)
|
"SELECT gm FROM accounts where id=?", Array(account.AccountId).toIndexedSeq
|
||||||
)).onComplete {
|
)).onComplete {
|
||||||
case scala.util.Success(queryResult) =>
|
case scala.util.Success(queryResult) =>
|
||||||
if(connection.isConnected) connection.disconnect
|
if(connection.isConnected) connection.disconnect
|
||||||
|
|
@ -1945,13 +1945,13 @@ class WorldSessionActor extends Actor
|
||||||
targetBuildings = Nil
|
targetBuildings = Nil
|
||||||
case List(building) =>
|
case List(building) =>
|
||||||
//blocked by a single soi; find space just outside of this soi and confirm no new overlap
|
//blocked by a single soi; find space just outside of this soi and confirm no new overlap
|
||||||
val radius = Vector3(0, building.Definition.SOIRadius + 5, 0)
|
val radius = Vector3(0, building.Definition.SOIRadius.toFloat + 5f, 0)
|
||||||
whereToDroppod = building.Position.xy + Vector3.Rz(radius, math.abs(scala.util.Random.nextInt() % 360))
|
whereToDroppod = building.Position.xy + Vector3.Rz(radius, math.abs(scala.util.Random.nextInt() % 360).toFloat)
|
||||||
case buildings =>
|
case buildings =>
|
||||||
//probably blocked by a facility and its tower (maximum overlap potential is 2?); find space outside of largest soi
|
//probably blocked by a facility and its tower (maximum overlap potential is 2?); find space outside of largest soi
|
||||||
val largestBuilding = buildings.maxBy(_.Definition.SOIRadius)
|
val largestBuilding = buildings.maxBy(_.Definition.SOIRadius)
|
||||||
val radius = Vector3(0, largestBuilding.Definition.SOIRadius + 5, 0)
|
val radius = Vector3(0, largestBuilding.Definition.SOIRadius.toFloat + 5f, 0)
|
||||||
whereToDroppod = largestBuilding.Position.xy + Vector3.Rz(radius, math.abs(scala.util.Random.nextInt() % 360))
|
whereToDroppod = largestBuilding.Position.xy + Vector3.Rz(radius, math.abs(scala.util.Random.nextInt() % 360).toFloat)
|
||||||
targetBuildings = buildings
|
targetBuildings = buildings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2191,8 +2191,8 @@ class WorldSessionActor extends Actor
|
||||||
val now = System.currentTimeMillis()
|
val now = System.currentTimeMillis()
|
||||||
val (location, time, distanceSq) : (Vector3, Long, Float) = if(spectating) {
|
val (location, time, distanceSq) : (Vector3, Long, Float) = if(spectating) {
|
||||||
val r = new scala.util.Random
|
val r = new scala.util.Random
|
||||||
val r1 = 2 + r.nextInt(30)
|
val r1 = 2 + r.nextInt(30).toFloat
|
||||||
val r2 = 2 + r.nextInt(4000)
|
val r2 = 2 + r.nextInt(4000).toFloat
|
||||||
(Vector3(r2, r2, r1), 0L, 0f)
|
(Vector3(r2, r2, r1), 0L, 0f)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -3680,10 +3680,14 @@ class WorldSessionActor extends Actor
|
||||||
inf.foreach {
|
inf.foreach {
|
||||||
case (index, loadout : InfantryLoadout) =>
|
case (index, loadout : InfantryLoadout) =>
|
||||||
sendResponse(FavoritesMessage(LoadoutType.Infantry, guid, index, loadout.label, InfantryLoadout.DetermineSubtypeB(loadout.exosuit, loadout.subtype)))
|
sendResponse(FavoritesMessage(LoadoutType.Infantry, guid, index, loadout.label, InfantryLoadout.DetermineSubtypeB(loadout.exosuit, loadout.subtype)))
|
||||||
|
case (_, data) =>
|
||||||
|
log.warn(s"HandleSetCurrentAvatar: unknown loadout information $data in infantry list")
|
||||||
}
|
}
|
||||||
veh.foreach {
|
veh.foreach {
|
||||||
case (index, loadout : VehicleLoadout) =>
|
case (index, loadout : VehicleLoadout) =>
|
||||||
sendResponse(FavoritesMessage(LoadoutType.Vehicle, guid, index - 10, loadout.label))
|
sendResponse(FavoritesMessage(LoadoutType.Vehicle, guid, index - 10, loadout.label))
|
||||||
|
case (_, data) =>
|
||||||
|
log.warn(s"HandleSetCurrentAvatar: unknown loadout information $data in vehicle list")
|
||||||
}
|
}
|
||||||
sendResponse(SetChatFilterMessage(ChatChannel.Platoon, false, ChatChannel.values.toList)) //TODO will not always be "on" like this
|
sendResponse(SetChatFilterMessage(ChatChannel.Platoon, false, ChatChannel.values.toList)) //TODO will not always be "on" like this
|
||||||
deadState = DeadState.Alive
|
deadState = DeadState.Alive
|
||||||
|
|
@ -3798,6 +3802,8 @@ class WorldSessionActor extends Actor
|
||||||
avatar.SquadLoadouts.Loadouts.foreach {
|
avatar.SquadLoadouts.Loadouts.foreach {
|
||||||
case (index, loadout : SquadLoadout) =>
|
case (index, loadout : SquadLoadout) =>
|
||||||
sendResponse(SquadDefinitionActionMessage(PlanetSideGUID(0), index, SquadAction.ListSquadFavorite(loadout.task)))
|
sendResponse(SquadDefinitionActionMessage(PlanetSideGUID(0), index, SquadAction.ListSquadFavorite(loadout.task)))
|
||||||
|
case (_, data) =>
|
||||||
|
log.warn(s"HandleSetCurrentAvatar: unknown loadout information $data in squad definition list")
|
||||||
}
|
}
|
||||||
//non-squad GUID-0 counts as the settings when not joined with a squad
|
//non-squad GUID-0 counts as the settings when not joined with a squad
|
||||||
sendResponse(SquadDefinitionActionMessage(PlanetSideGUID(0), 0, SquadAction.AssociateWithSquad()))
|
sendResponse(SquadDefinitionActionMessage(PlanetSideGUID(0), 0, SquadAction.AssociateWithSquad()))
|
||||||
|
|
@ -3921,7 +3927,7 @@ class WorldSessionActor extends Actor
|
||||||
Thread.sleep(40)
|
Thread.sleep(40)
|
||||||
import scala.concurrent.ExecutionContext.Implicits.global
|
import scala.concurrent.ExecutionContext.Implicits.global
|
||||||
clientKeepAlive.cancel
|
clientKeepAlive.cancel
|
||||||
clientKeepAlive = context.system.scheduler.schedule(0 seconds, 500 milliseconds, self, PokeClient())
|
clientKeepAlive = context.system.scheduler.scheduleWithFixedDelay(0 seconds, 500 milliseconds, self, PokeClient())
|
||||||
accountIntermediary ! RetrieveAccountData(token)
|
accountIntermediary ! RetrieveAccountData(token)
|
||||||
|
|
||||||
case msg@MountVehicleCargoMsg(player_guid, cargo_guid, carrier_guid, unk4) =>
|
case msg@MountVehicleCargoMsg(player_guid, cargo_guid, carrier_guid, unk4) =>
|
||||||
|
|
@ -3994,7 +4000,7 @@ class WorldSessionActor extends Actor
|
||||||
Database.getConnection.connect.onComplete {
|
Database.getConnection.connect.onComplete {
|
||||||
case scala.util.Success(connection) =>
|
case scala.util.Success(connection) =>
|
||||||
Database.query(connection.sendPreparedStatement(
|
Database.query(connection.sendPreparedStatement(
|
||||||
"UPDATE characters SET deleted = true where id=?", Array(charId)
|
"UPDATE characters SET deleted = true where id=?", Array(charId).toIndexedSeq
|
||||||
)).onComplete {
|
)).onComplete {
|
||||||
case scala.util.Success(_) =>
|
case scala.util.Success(_) =>
|
||||||
if(connection.isConnected) connection.disconnect
|
if(connection.isConnected) connection.disconnect
|
||||||
|
|
@ -4015,7 +4021,7 @@ class WorldSessionActor extends Actor
|
||||||
Database.getConnection.connect.onComplete {
|
Database.getConnection.connect.onComplete {
|
||||||
case scala.util.Success(connection) =>
|
case scala.util.Success(connection) =>
|
||||||
Database.query(connection.sendPreparedStatement(
|
Database.query(connection.sendPreparedStatement(
|
||||||
"SELECT id, name, faction_id, gender_id, head_id, voice_id FROM characters where id=?", Array(charId)
|
"SELECT id, name, faction_id, gender_id, head_id, voice_id FROM characters where id=?", Array(charId).toIndexedSeq
|
||||||
)).onComplete {
|
)).onComplete {
|
||||||
case Success(queryResult) =>
|
case Success(queryResult) =>
|
||||||
if(connection.isConnected) connection.disconnect
|
if(connection.isConnected) connection.disconnect
|
||||||
|
|
@ -6292,7 +6298,7 @@ class WorldSessionActor extends Actor
|
||||||
|
|
||||||
case msg @ AvatarFirstTimeEventMessage(avatar_guid, object_guid, unk1, event_name) =>
|
case msg @ AvatarFirstTimeEventMessage(avatar_guid, object_guid, unk1, event_name) =>
|
||||||
log.info(s"AvatarFirstTimeEvent: $event_name")
|
log.info(s"AvatarFirstTimeEvent: $event_name")
|
||||||
avatar.FirstTimeEvents += event_name
|
avatar.FirstTimeEvents = avatar.FirstTimeEvents :+ event_name
|
||||||
|
|
||||||
case msg @ WarpgateRequest(continent_guid, building_guid, dest_building_guid, dest_continent_guid, unk1, unk2) =>
|
case msg @ WarpgateRequest(continent_guid, building_guid, dest_building_guid, dest_continent_guid, unk1, unk2) =>
|
||||||
log.info(s"WarpgateRequest: $msg")
|
log.info(s"WarpgateRequest: $msg")
|
||||||
|
|
@ -10474,7 +10480,7 @@ class WorldSessionActor extends Actor
|
||||||
Database.getConnection.connect.onComplete {
|
Database.getConnection.connect.onComplete {
|
||||||
case scala.util.Success(connection) =>
|
case scala.util.Success(connection) =>
|
||||||
Database.query(connection.sendPreparedStatement(
|
Database.query(connection.sendPreparedStatement(
|
||||||
"SELECT id, exosuit_id, name, items FROM loadouts where characters_id = ? AND loadout_number = ?", Array(charId, line)
|
"SELECT id, exosuit_id, name, items FROM loadouts where characters_id = ? AND loadout_number = ?", Array(charId, line).toIndexedSeq
|
||||||
)).onComplete {
|
)).onComplete {
|
||||||
case scala.util.Success(queryResult) =>
|
case scala.util.Success(queryResult) =>
|
||||||
queryResult match {
|
queryResult match {
|
||||||
|
|
@ -10554,7 +10560,7 @@ class WorldSessionActor extends Actor
|
||||||
Database.getConnection.connect.onComplete {
|
Database.getConnection.connect.onComplete {
|
||||||
case scala.util.Success(connection) =>
|
case scala.util.Success(connection) =>
|
||||||
connection.sendPreparedStatement(
|
connection.sendPreparedStatement(
|
||||||
"SELECT id, loadout_number, exosuit_id, name, items FROM loadouts where characters_id = ?", Array(owner.CharId)
|
"SELECT id, loadout_number, exosuit_id, name, items FROM loadouts where characters_id = ?", Array(owner.CharId).toIndexedSeq
|
||||||
).onComplete {
|
).onComplete {
|
||||||
case Success(queryResult) =>
|
case Success(queryResult) =>
|
||||||
if(connection.isConnected) connection.disconnect
|
if(connection.isConnected) connection.disconnect
|
||||||
|
|
|
||||||
|
|
@ -432,9 +432,9 @@ object Zones {
|
||||||
def StandardRemapping(scale : MapScale, longDivNum : Int, latDivNum : Int)(pos : Vector3) : Vector3 = {
|
def StandardRemapping(scale : MapScale, longDivNum : Int, latDivNum : Int)(pos : Vector3) : Vector3 = {
|
||||||
Vector3(
|
Vector3(
|
||||||
//x
|
//x
|
||||||
FindClosestDivision(pos.x, scale.width, longDivNum),
|
FindClosestDivision(pos.x, scale.width, longDivNum.toFloat),
|
||||||
//y
|
//y
|
||||||
FindClosestDivision(pos.y, scale.height, latDivNum),
|
FindClosestDivision(pos.y, scale.height, latDivNum.toFloat),
|
||||||
//z is always zero - maps are flat 2D planes
|
//z is always zero - maps are flat 2D planes
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ object CSRWarp {
|
||||||
CSRWarp.reply(traveler, CSRZoneImpl.listLocations(zone) + "; " + CSRZoneImpl.listWarpgates(zone))
|
CSRWarp.reply(traveler, CSRZoneImpl.listLocations(zone) + "; " + CSRZoneImpl.listWarpgates(zone))
|
||||||
return (false, Vector3.Zero)
|
return (false, Vector3.Zero)
|
||||||
}
|
}
|
||||||
val dest : Option[Vector3] = if(coords.nonEmpty) Some(Vector3(coords(0), coords(1), coords(2)))
|
val dest : Option[Vector3] = if(coords.nonEmpty) Some(Vector3(coords(0).toFloat, coords(1).toFloat, coords(2).toFloat))
|
||||||
else CSRZoneImpl.getWarpLocation(zone, destId) //coords before destId
|
else CSRZoneImpl.getWarpLocation(zone, destId) //coords before destId
|
||||||
if(dest.isEmpty) {
|
if(dest.isEmpty) {
|
||||||
CSRWarp.error(traveler, "Invalid location")
|
CSRWarp.error(traveler, "Invalid location")
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ object CSRZoneImpl {
|
||||||
* Only the warpgate keys are searchable by the `/zone` command.
|
* Only the warpgate keys are searchable by the `/zone` command.
|
||||||
*/
|
*/
|
||||||
def setup() : Unit = {
|
def setup() : Unit = {
|
||||||
zones("z1").gates += (
|
zones("z1").gates ++= Map(
|
||||||
"gate1" -> Vector3(4150, 7341, 82),
|
"gate1" -> Vector3(4150, 7341, 82),
|
||||||
"gate2" -> Vector3(5698, 3404, 129),
|
"gate2" -> Vector3(5698, 3404, 129),
|
||||||
"gate3" -> Vector3(2650, 5363, 176),
|
"gate3" -> Vector3(2650, 5363, 176),
|
||||||
|
|
@ -237,7 +237,7 @@ object CSRZoneImpl {
|
||||||
"geowarp1" -> Vector3(3678, 2895, 108),
|
"geowarp1" -> Vector3(3678, 2895, 108),
|
||||||
"geowarp2" -> Vector3(5672, 4750, 70)
|
"geowarp2" -> Vector3(5672, 4750, 70)
|
||||||
)
|
)
|
||||||
zones("z1").locations += (
|
zones("z1").locations ++= Map(
|
||||||
"amun" -> Vector3(4337, 2278, 68),
|
"amun" -> Vector3(4337, 2278, 68),
|
||||||
"aton" -> Vector3(3772, 5463, 54),
|
"aton" -> Vector3(3772, 5463, 54),
|
||||||
"bastet" -> Vector3(5412, 5588, 56),
|
"bastet" -> Vector3(5412, 5588, 56),
|
||||||
|
|
@ -250,7 +250,7 @@ object CSRZoneImpl {
|
||||||
"lake" -> Vector3(4317, 4008, 37),
|
"lake" -> Vector3(4317, 4008, 37),
|
||||||
"monolith" -> Vector3(5551, 5047, 64)
|
"monolith" -> Vector3(5551, 5047, 64)
|
||||||
)
|
)
|
||||||
zones("z2").gates += (
|
zones("z2").gates ++= Map(
|
||||||
"gate1" -> Vector3(1881, 4873, 19),
|
"gate1" -> Vector3(1881, 4873, 19),
|
||||||
"gate2" -> Vector3(4648, 4625, 28),
|
"gate2" -> Vector3(4648, 4625, 28),
|
||||||
"gate3" -> Vector3(3296, 2045, 21),
|
"gate3" -> Vector3(3296, 2045, 21),
|
||||||
|
|
@ -258,7 +258,7 @@ object CSRZoneImpl {
|
||||||
"geowarp1" -> Vector3(5199, 4869, 39),
|
"geowarp1" -> Vector3(5199, 4869, 39),
|
||||||
"geowarp2" -> Vector3(3911, 2407, 15)
|
"geowarp2" -> Vector3(3911, 2407, 15)
|
||||||
)
|
)
|
||||||
zones("z2").locations += (
|
zones("z2").locations ++= Map(
|
||||||
"acan" -> Vector3(3534, 4015, 30),
|
"acan" -> Vector3(3534, 4015, 30),
|
||||||
"bitol" -> Vector3(4525, 2632, 30),
|
"bitol" -> Vector3(4525, 2632, 30),
|
||||||
"chac" -> Vector3(4111, 5950, 39),
|
"chac" -> Vector3(4111, 5950, 39),
|
||||||
|
|
@ -272,7 +272,7 @@ object CSRZoneImpl {
|
||||||
"zotz" -> Vector3(6677, 2342, 129),
|
"zotz" -> Vector3(6677, 2342, 129),
|
||||||
"monolith" -> Vector3(2938, 2485, 14)
|
"monolith" -> Vector3(2938, 2485, 14)
|
||||||
)
|
)
|
||||||
zones("z3").gates += (
|
zones("z3").gates ++= Map(
|
||||||
"gate1" -> Vector3(2616, 6567, 58),
|
"gate1" -> Vector3(2616, 6567, 58),
|
||||||
"gate2" -> Vector3(6980, 5336, 57),
|
"gate2" -> Vector3(6980, 5336, 57),
|
||||||
"gate3" -> Vector3(1199, 1332, 66),
|
"gate3" -> Vector3(1199, 1332, 66),
|
||||||
|
|
@ -280,7 +280,7 @@ object CSRZoneImpl {
|
||||||
"geowarp1" -> Vector3(2403, 4278, 60),
|
"geowarp1" -> Vector3(2403, 4278, 60),
|
||||||
"geowarp2" -> Vector3(4722, 2665, 78)
|
"geowarp2" -> Vector3(4722, 2665, 78)
|
||||||
)
|
)
|
||||||
zones("z3").locations += (
|
zones("z3").locations ++= Map(
|
||||||
"aja" -> Vector3(754, 5435, 48),
|
"aja" -> Vector3(754, 5435, 48),
|
||||||
"chuku" -> Vector3(4208, 7021, 54),
|
"chuku" -> Vector3(4208, 7021, 54),
|
||||||
"bomazi" -> Vector3(1198, 4492, 58),
|
"bomazi" -> Vector3(1198, 4492, 58),
|
||||||
|
|
@ -301,7 +301,7 @@ object CSRZoneImpl {
|
||||||
"monolith" -> Vector3(4515, 4105, 38),
|
"monolith" -> Vector3(4515, 4105, 38),
|
||||||
"peak" -> Vector3(3215, 5063, 579)
|
"peak" -> Vector3(3215, 5063, 579)
|
||||||
)
|
)
|
||||||
zones("z4").gates += (
|
zones("z4").gates ++= Map(
|
||||||
"gate1" -> Vector3(4702, 6768, 30),
|
"gate1" -> Vector3(4702, 6768, 30),
|
||||||
"gate2" -> Vector3(5515, 3368, 69),
|
"gate2" -> Vector3(5515, 3368, 69),
|
||||||
"gate3" -> Vector3(1564, 3356, 46),
|
"gate3" -> Vector3(1564, 3356, 46),
|
||||||
|
|
@ -309,7 +309,7 @@ object CSRZoneImpl {
|
||||||
"geowarp1" -> Vector3(4202, 4325, 68),
|
"geowarp1" -> Vector3(4202, 4325, 68),
|
||||||
"geowarp2" -> Vector3(2384, 1925, 37)
|
"geowarp2" -> Vector3(2384, 1925, 37)
|
||||||
)
|
)
|
||||||
zones("z4").locations += (
|
zones("z4").locations ++= Map(
|
||||||
"akkan" -> Vector3(2746, 4260, 39),
|
"akkan" -> Vector3(2746, 4260, 39),
|
||||||
"baal" -> Vector3(825, 5470, 72),
|
"baal" -> Vector3(825, 5470, 72),
|
||||||
"dagon" -> Vector3(1739, 5681, 40),
|
"dagon" -> Vector3(1739, 5681, 40),
|
||||||
|
|
@ -325,7 +325,7 @@ object CSRZoneImpl {
|
||||||
"monolith" -> Vector3(5165, 4083, 35),
|
"monolith" -> Vector3(5165, 4083, 35),
|
||||||
"stonehenge" -> Vector3(4992, 3776, 56)
|
"stonehenge" -> Vector3(4992, 3776, 56)
|
||||||
)
|
)
|
||||||
zones("z5").gates += (
|
zones("z5").gates ++= Map(
|
||||||
"gate1" -> Vector3(3432, 6498, 73),
|
"gate1" -> Vector3(3432, 6498, 73),
|
||||||
"gate2" -> Vector3(7196, 3917, 47),
|
"gate2" -> Vector3(7196, 3917, 47),
|
||||||
"gate3" -> Vector3(1533, 3540, 56),
|
"gate3" -> Vector3(1533, 3540, 56),
|
||||||
|
|
@ -333,7 +333,7 @@ object CSRZoneImpl {
|
||||||
"geowarp1" -> Vector3(4899, 5633, 38),
|
"geowarp1" -> Vector3(4899, 5633, 38),
|
||||||
"geowarp2" -> Vector3(5326, 2558, 54)
|
"geowarp2" -> Vector3(5326, 2558, 54)
|
||||||
)
|
)
|
||||||
zones("z5").locations += (
|
zones("z5").locations ++= Map(
|
||||||
"anu" -> Vector3(3479, 2556, 56),
|
"anu" -> Vector3(3479, 2556, 56),
|
||||||
"bel" -> Vector3(3665, 4626, 58),
|
"bel" -> Vector3(3665, 4626, 58),
|
||||||
"caer" -> Vector3(4570, 2601, 56),
|
"caer" -> Vector3(4570, 2601, 56),
|
||||||
|
|
@ -348,7 +348,7 @@ object CSRZoneImpl {
|
||||||
"islands1" -> Vector3(6680, 6217, 125),
|
"islands1" -> Vector3(6680, 6217, 125),
|
||||||
"islands2" -> Vector3(1059, 6213, 120)
|
"islands2" -> Vector3(1059, 6213, 120)
|
||||||
)
|
)
|
||||||
zones("z6").gates += (
|
zones("z6").gates ++= Map(
|
||||||
"gate1" -> Vector3(5040, 4327, 46),
|
"gate1" -> Vector3(5040, 4327, 46),
|
||||||
"gate2" -> Vector3(2187, 5338, 30),
|
"gate2" -> Vector3(2187, 5338, 30),
|
||||||
"gate3" -> Vector3(4960, 1922, 15),
|
"gate3" -> Vector3(4960, 1922, 15),
|
||||||
|
|
@ -356,7 +356,7 @@ object CSRZoneImpl {
|
||||||
"geowarp1" -> Vector3(3221, 5328, 242),
|
"geowarp1" -> Vector3(3221, 5328, 242),
|
||||||
"geowarp2" -> Vector3(2237, 1783, 238)
|
"geowarp2" -> Vector3(2237, 1783, 238)
|
||||||
)
|
)
|
||||||
zones("z6").locations += (
|
zones("z6").locations ++= Map(
|
||||||
"akna" -> Vector3(4509, 3732, 219),
|
"akna" -> Vector3(4509, 3732, 219),
|
||||||
"anguta" -> Vector3(3999, 4170, 266),
|
"anguta" -> Vector3(3999, 4170, 266),
|
||||||
"igaluk" -> Vector3(3241, 5658, 235),
|
"igaluk" -> Vector3(3241, 5658, 235),
|
||||||
|
|
@ -369,7 +369,7 @@ object CSRZoneImpl {
|
||||||
"monolith" -> Vector3(4011, 4851, 32),
|
"monolith" -> Vector3(4011, 4851, 32),
|
||||||
"bridge" -> Vector3(3729, 4859, 234)
|
"bridge" -> Vector3(3729, 4859, 234)
|
||||||
)
|
)
|
||||||
zones("z7").gates += (
|
zones("z7").gates ++= Map(
|
||||||
"gate1" -> Vector3(1516, 6448, 61),
|
"gate1" -> Vector3(1516, 6448, 61),
|
||||||
"gate2" -> Vector3(5249, 3819, 69),
|
"gate2" -> Vector3(5249, 3819, 69),
|
||||||
"gate3" -> Vector3(2763, 2961, 86),
|
"gate3" -> Vector3(2763, 2961, 86),
|
||||||
|
|
@ -377,7 +377,7 @@ object CSRZoneImpl {
|
||||||
"geowarp1" -> Vector3(6345, 4802, 90),
|
"geowarp1" -> Vector3(6345, 4802, 90),
|
||||||
"geowarp2" -> Vector3(3800, 2197, 64)
|
"geowarp2" -> Vector3(3800, 2197, 64)
|
||||||
)
|
)
|
||||||
zones("z7").locations += (
|
zones("z7").locations ++= Map(
|
||||||
"andvari" -> Vector3(3233, 7207, 78),
|
"andvari" -> Vector3(3233, 7207, 78),
|
||||||
"dagur" -> Vector3(4026, 6191, 60),
|
"dagur" -> Vector3(4026, 6191, 60),
|
||||||
"eisa" -> Vector3(3456, 4513, 75),
|
"eisa" -> Vector3(3456, 4513, 75),
|
||||||
|
|
@ -393,7 +393,7 @@ object CSRZoneImpl {
|
||||||
"ymir" -> Vector3(1911, 4008, 69),
|
"ymir" -> Vector3(1911, 4008, 69),
|
||||||
"monolith" -> Vector3(6390, 1622, 63)
|
"monolith" -> Vector3(6390, 1622, 63)
|
||||||
)
|
)
|
||||||
zones("z8").gates += (
|
zones("z8").gates ++= Map(
|
||||||
"gate1" -> Vector3(5437, 5272, 32),
|
"gate1" -> Vector3(5437, 5272, 32),
|
||||||
"gate2" -> Vector3(3251, 5650, 60),
|
"gate2" -> Vector3(3251, 5650, 60),
|
||||||
"gate3" -> Vector3(5112, 2616, 40),
|
"gate3" -> Vector3(5112, 2616, 40),
|
||||||
|
|
@ -401,7 +401,7 @@ object CSRZoneImpl {
|
||||||
"geowarp1" -> Vector3(3979, 5370, 47),
|
"geowarp1" -> Vector3(3979, 5370, 47),
|
||||||
"geowarp2" -> Vector3(6018, 3136, 35)
|
"geowarp2" -> Vector3(6018, 3136, 35)
|
||||||
)
|
)
|
||||||
zones("z8").locations += (
|
zones("z8").locations ++= Map(
|
||||||
"atar" -> Vector3(3609, 2730, 47),
|
"atar" -> Vector3(3609, 2730, 47),
|
||||||
"dahaka" -> Vector3(4633, 5379, 54),
|
"dahaka" -> Vector3(4633, 5379, 54),
|
||||||
"hvar" -> Vector3(3857, 4764, 49),
|
"hvar" -> Vector3(3857, 4764, 49),
|
||||||
|
|
@ -415,14 +415,14 @@ object CSRZoneImpl {
|
||||||
"arch2" -> Vector3(4688, 5272, 68),
|
"arch2" -> Vector3(4688, 5272, 68),
|
||||||
"pride" -> Vector3(2913, 4412, 63)
|
"pride" -> Vector3(2913, 4412, 63)
|
||||||
)
|
)
|
||||||
zones("z9").gates += (
|
zones("z9").gates ++= Map(
|
||||||
"gate1" -> Vector3(1505, 6981, 65),
|
"gate1" -> Vector3(1505, 6981, 65),
|
||||||
"gate2" -> Vector3(6835, 3517, 56),
|
"gate2" -> Vector3(6835, 3517, 56),
|
||||||
"gate3" -> Vector3(1393, 1376, 53),
|
"gate3" -> Vector3(1393, 1376, 53),
|
||||||
"geowarp1" -> Vector3(7081, 5552, 46),
|
"geowarp1" -> Vector3(7081, 5552, 46),
|
||||||
"geowarp2" -> Vector3(3776, 1092, 49)
|
"geowarp2" -> Vector3(3776, 1092, 49)
|
||||||
)
|
)
|
||||||
zones("z9").locations += (
|
zones("z9").locations ++= Map(
|
||||||
"akua" -> Vector3(5258, 4041, 346),
|
"akua" -> Vector3(5258, 4041, 346),
|
||||||
"drakulu" -> Vector3(3806, 2647, 151),
|
"drakulu" -> Vector3(3806, 2647, 151),
|
||||||
"hiro" -> Vector3(4618, 5761, 190),
|
"hiro" -> Vector3(4618, 5761, 190),
|
||||||
|
|
@ -439,7 +439,7 @@ object CSRZoneImpl {
|
||||||
"wakea" -> Vector3(1785, 5241, 63),
|
"wakea" -> Vector3(1785, 5241, 63),
|
||||||
"monolith" -> Vector3(3246, 6507, 105)
|
"monolith" -> Vector3(3246, 6507, 105)
|
||||||
)
|
)
|
||||||
zones("z10").gates += (
|
zones("z10").gates ++= Map(
|
||||||
"gate1" -> Vector3(6140, 6599, 71),
|
"gate1" -> Vector3(6140, 6599, 71),
|
||||||
"gate2" -> Vector3(4814, 4608, 59),
|
"gate2" -> Vector3(4814, 4608, 59),
|
||||||
"gate3" -> Vector3(3152, 3480, 54),
|
"gate3" -> Vector3(3152, 3480, 54),
|
||||||
|
|
@ -447,7 +447,7 @@ object CSRZoneImpl {
|
||||||
"geowarp1" -> Vector3(3612, 6918, 38),
|
"geowarp1" -> Vector3(3612, 6918, 38),
|
||||||
"geowarp2" -> Vector3(3668, 3327, 55)
|
"geowarp2" -> Vector3(3668, 3327, 55)
|
||||||
)
|
)
|
||||||
zones("z10").locations += (
|
zones("z10").locations ++= Map(
|
||||||
"azeban" -> Vector3(6316, 5160, 62),
|
"azeban" -> Vector3(6316, 5160, 62),
|
||||||
"cetan" -> Vector3(3587, 2522, 48),
|
"cetan" -> Vector3(3587, 2522, 48),
|
||||||
"heyoka" -> Vector3(4395, 2327, 47),
|
"heyoka" -> Vector3(4395, 2327, 47),
|
||||||
|
|
@ -462,19 +462,19 @@ object CSRZoneImpl {
|
||||||
"xelas" -> Vector3(6609, 4479, 56),
|
"xelas" -> Vector3(6609, 4479, 56),
|
||||||
"monolith" -> Vector3(5651, 6024, 38)
|
"monolith" -> Vector3(5651, 6024, 38)
|
||||||
)
|
)
|
||||||
zones("home1").gates += (
|
zones("home1").gates ++= Map(
|
||||||
"gate1" -> Vector3(4158, 6344, 44),
|
"gate1" -> Vector3(4158, 6344, 44),
|
||||||
"gate2" -> Vector3(2214, 5797, 48),
|
"gate2" -> Vector3(2214, 5797, 48),
|
||||||
"gate3" -> Vector3(5032, 3241, 53)
|
"gate3" -> Vector3(5032, 3241, 53)
|
||||||
)
|
)
|
||||||
zones("home1").locations += "hart_c" -> Vector3(2352, 5523, 66)
|
zones("home1").locations += "hart_c" -> Vector3(2352, 5523, 66)
|
||||||
zones("home2").gates += (
|
zones("home2").gates ++= Map(
|
||||||
"gate1" -> Vector3(5283, 4317, 44),
|
"gate1" -> Vector3(5283, 4317, 44),
|
||||||
"gate2" -> Vector3(3139, 4809, 40),
|
"gate2" -> Vector3(3139, 4809, 40),
|
||||||
"gate3" -> Vector3(3659, 2894, 26)
|
"gate3" -> Vector3(3659, 2894, 26)
|
||||||
)
|
)
|
||||||
zones("home2").locations += "hart_c" -> Vector3(3125, 2864, 35)
|
zones("home2").locations += "hart_c" -> Vector3(3125, 2864, 35)
|
||||||
zones("home3").gates += (
|
zones("home3").gates ++= Map(
|
||||||
"gate1" -> Vector3(5657, 4681, 98),
|
"gate1" -> Vector3(5657, 4681, 98),
|
||||||
"gate2" -> Vector3(2639, 5366, 57),
|
"gate2" -> Vector3(2639, 5366, 57),
|
||||||
"gate3" -> Vector3(4079, 2467, 155)
|
"gate3" -> Vector3(4079, 2467, 155)
|
||||||
|
|
@ -482,93 +482,93 @@ object CSRZoneImpl {
|
||||||
zones("home3").locations += "hart_c" -> Vector3(3675, 2727, 91)
|
zones("home3").locations += "hart_c" -> Vector3(3675, 2727, 91)
|
||||||
zones("tzshtr").locations += "roof" -> Vector3(499, 1568, 25)
|
zones("tzshtr").locations += "roof" -> Vector3(499, 1568, 25)
|
||||||
zones("tzcotr").locations += "spawn" -> Vector3(960, 1002, 32)
|
zones("tzcotr").locations += "spawn" -> Vector3(960, 1002, 32)
|
||||||
zones("tzdrtr").locations += (
|
zones("tzdrtr").locations ++= Map(
|
||||||
"start" -> Vector3(2457, 1864, 23),
|
"start" -> Vector3(2457, 1864, 23),
|
||||||
"air_pad" -> Vector3(1700, 1900, 32)
|
"air_pad" -> Vector3(1700, 1900, 32)
|
||||||
)
|
)
|
||||||
zones("tzshvs").locations += "roof" -> Vector3(499, 1568, 25)
|
zones("tzshvs").locations += "roof" -> Vector3(499, 1568, 25)
|
||||||
zones("tzcovs").locations += "spawn" -> Vector3(960, 1002, 32)
|
zones("tzcovs").locations += "spawn" -> Vector3(960, 1002, 32)
|
||||||
zones("tzdrvs").locations += (
|
zones("tzdrvs").locations ++= Map(
|
||||||
"start" -> Vector3(2457, 1864, 23),
|
"start" -> Vector3(2457, 1864, 23),
|
||||||
"air_pad" -> Vector3(1700, 1900, 32)
|
"air_pad" -> Vector3(1700, 1900, 32)
|
||||||
)
|
)
|
||||||
zones("tzshnc").locations += "roof" -> Vector3(499, 1568, 25)
|
zones("tzshnc").locations += "roof" -> Vector3(499, 1568, 25)
|
||||||
zones("tzconc").locations += "spawn" -> Vector3(960, 1002, 32)
|
zones("tzconc").locations += "spawn" -> Vector3(960, 1002, 32)
|
||||||
zones("tzdrnc").locations += (
|
zones("tzdrnc").locations ++= Map(
|
||||||
"start" -> Vector3(2457, 1864, 23),
|
"start" -> Vector3(2457, 1864, 23),
|
||||||
"air_pad" -> Vector3(1700, 1900, 32)
|
"air_pad" -> Vector3(1700, 1900, 32)
|
||||||
)
|
)
|
||||||
zones("c1").gates += (
|
zones("c1").gates ++= Map(
|
||||||
"geowarp1" -> Vector3(998, 2038, 103),
|
"geowarp1" -> Vector3(998, 2038, 103),
|
||||||
"geowarp2" -> Vector3(231, 1026, 82),
|
"geowarp2" -> Vector3(231, 1026, 82),
|
||||||
"geowarp3" -> Vector3(2071, 1405, 102),
|
"geowarp3" -> Vector3(2071, 1405, 102),
|
||||||
"geowarp4" -> Vector3(1051, 370, 103)
|
"geowarp4" -> Vector3(1051, 370, 103)
|
||||||
)
|
)
|
||||||
zones("c2").gates += (
|
zones("c2").gates ++= Map(
|
||||||
"geowarp1" -> Vector3(999, 2386, 243),
|
"geowarp1" -> Vector3(999, 2386, 243),
|
||||||
"geowarp2" -> Vector3(283, 1249, 172),
|
"geowarp2" -> Vector3(283, 1249, 172),
|
||||||
"geowarp3" -> Vector3(1887, 1307, 192),
|
"geowarp3" -> Vector3(1887, 1307, 192),
|
||||||
"geowarp4" -> Vector3(1039, 155, 143)
|
"geowarp4" -> Vector3(1039, 155, 143)
|
||||||
)
|
)
|
||||||
zones("c3").gates += (
|
zones("c3").gates ++= Map(
|
||||||
"geowarp1" -> Vector3(1095, 1725, 25),
|
"geowarp1" -> Vector3(1095, 1725, 25),
|
||||||
"geowarp2" -> Vector3(226, 832, 42),
|
"geowarp2" -> Vector3(226, 832, 42),
|
||||||
"geowarp3" -> Vector3(1832, 1026, 43),
|
"geowarp3" -> Vector3(1832, 1026, 43),
|
||||||
"geowarp4" -> Vector3(981, 320, 46)
|
"geowarp4" -> Vector3(981, 320, 46)
|
||||||
)
|
)
|
||||||
zones("c4").gates += (
|
zones("c4").gates ++= Map(
|
||||||
"geowarp1" -> Vector3(902, 1811, 93),
|
"geowarp1" -> Vector3(902, 1811, 93),
|
||||||
"geowarp2" -> Vector3(185, 922, 113),
|
"geowarp2" -> Vector3(185, 922, 113),
|
||||||
"geowarp3" -> Vector3(1696, 1188, 92),
|
"geowarp3" -> Vector3(1696, 1188, 92),
|
||||||
"geowarp4" -> Vector3(887, 227, 115)
|
"geowarp4" -> Vector3(887, 227, 115)
|
||||||
)
|
)
|
||||||
zones("c5").gates += (
|
zones("c5").gates ++= Map(
|
||||||
"geowarp1" -> Vector3(1195, 1752, 244),
|
"geowarp1" -> Vector3(1195, 1752, 244),
|
||||||
"geowarp2" -> Vector3(290, 1104, 235),
|
"geowarp2" -> Vector3(290, 1104, 235),
|
||||||
"geowarp3" -> Vector3(1803, 899, 243),
|
"geowarp3" -> Vector3(1803, 899, 243),
|
||||||
"geowarp4" -> Vector3(1042, 225, 246)
|
"geowarp4" -> Vector3(1042, 225, 246)
|
||||||
)
|
)
|
||||||
zones("c6").gates += (
|
zones("c6").gates ++= Map(
|
||||||
"geowarp1" -> Vector3(1067, 2044, 95),
|
"geowarp1" -> Vector3(1067, 2044, 95),
|
||||||
"geowarp2" -> Vector3(290, 693, 73),
|
"geowarp2" -> Vector3(290, 693, 73),
|
||||||
"geowarp3" -> Vector3(1922, 928, 33),
|
"geowarp3" -> Vector3(1922, 928, 33),
|
||||||
"geowarp4" -> Vector3(1174, 249, 114)
|
"geowarp4" -> Vector3(1174, 249, 114)
|
||||||
)
|
)
|
||||||
zones("i3").gates += (
|
zones("i3").gates ++= Map(
|
||||||
"gate1" -> Vector3(1219, 2580, 30),
|
"gate1" -> Vector3(1219, 2580, 30),
|
||||||
"gate2" -> Vector3(2889, 2919, 33),
|
"gate2" -> Vector3(2889, 2919, 33),
|
||||||
"gate3" -> Vector3(2886, 1235, 32)
|
"gate3" -> Vector3(2886, 1235, 32)
|
||||||
)
|
)
|
||||||
zones("i3").locations += (
|
zones("i3").locations ++= Map(
|
||||||
"dahaka" -> Vector3(1421, 2216, 30),
|
"dahaka" -> Vector3(1421, 2216, 30),
|
||||||
"jamshid" -> Vector3(2500, 2543, 30),
|
"jamshid" -> Vector3(2500, 2543, 30),
|
||||||
"izha" -> Vector3(2569, 1544, 30),
|
"izha" -> Vector3(2569, 1544, 30),
|
||||||
"oasis" -> Vector3(2084, 1935, 40)
|
"oasis" -> Vector3(2084, 1935, 40)
|
||||||
)
|
)
|
||||||
zones("i2").gates += (
|
zones("i2").gates ++= Map(
|
||||||
"gate1" -> Vector3(1243, 1393, 12),
|
"gate1" -> Vector3(1243, 1393, 12),
|
||||||
"gate2" -> Vector3(2510, 2544, 12),
|
"gate2" -> Vector3(2510, 2544, 12),
|
||||||
"gate3" -> Vector3(2634, 1477, 12)
|
"gate3" -> Vector3(2634, 1477, 12)
|
||||||
)
|
)
|
||||||
zones("i2").locations += (
|
zones("i2").locations ++= Map(
|
||||||
"rashnu" -> Vector3(1709, 1802, 91),
|
"rashnu" -> Vector3(1709, 1802, 91),
|
||||||
"sraosha" -> Vector3(2729, 2349, 91),
|
"sraosha" -> Vector3(2729, 2349, 91),
|
||||||
"zal" -> Vector3(1888, 2728, 91),
|
"zal" -> Vector3(1888, 2728, 91),
|
||||||
"center" -> Vector3(2082, 2192, 160),
|
"center" -> Vector3(2082, 2192, 160),
|
||||||
"vpad" -> Vector3(1770, 2686, 92)
|
"vpad" -> Vector3(1770, 2686, 92)
|
||||||
)
|
)
|
||||||
zones("i1").gates += (
|
zones("i1").gates ++= Map(
|
||||||
"gate1" -> Vector3(1225, 2036, 67),
|
"gate1" -> Vector3(1225, 2036, 67),
|
||||||
"gate2" -> Vector3(2548, 2801, 65),
|
"gate2" -> Vector3(2548, 2801, 65),
|
||||||
"gate3" -> Vector3(2481, 1194, 89)
|
"gate3" -> Vector3(2481, 1194, 89)
|
||||||
)
|
)
|
||||||
zones("i1").locations += (
|
zones("i1").locations ++= Map(
|
||||||
"hvar" -> Vector3(1559, 1268, 88),
|
"hvar" -> Vector3(1559, 1268, 88),
|
||||||
"mithra" -> Vector3(2855, 2850, 89),
|
"mithra" -> Vector3(2855, 2850, 89),
|
||||||
"yazata" -> Vector3(1254, 2583, 88),
|
"yazata" -> Vector3(1254, 2583, 88),
|
||||||
"south_of_volcano" -> Vector3(2068, 1686, 88)
|
"south_of_volcano" -> Vector3(2068, 1686, 88)
|
||||||
)
|
)
|
||||||
zones("i4").gates += (
|
zones("i4").gates ++= Map(
|
||||||
"gate1" -> Vector3(2359, 2717, 36),
|
"gate1" -> Vector3(2359, 2717, 36),
|
||||||
"gate2" -> Vector3(2732, 1355, 36),
|
"gate2" -> Vector3(2732, 1355, 36),
|
||||||
"geowarp" -> Vector3(1424, 1640, 45)
|
"geowarp" -> Vector3(1424, 1640, 45)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ object CmdInternal {
|
||||||
}
|
}
|
||||||
|
|
||||||
def cmdThreadDump(args : Array[String]) = {
|
def cmdThreadDump(args : Array[String]) = {
|
||||||
import scala.collection.JavaConverters._
|
import scala.jdk.CollectionConverters._
|
||||||
|
|
||||||
var data = Map[String,Any]()
|
var data = Map[String,Any]()
|
||||||
val traces = Thread.getAllStackTraces().asScala
|
val traces = Thread.getAllStackTraces().asScala
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class PacketCodingActor2Test extends ActorTest {
|
||||||
val pca : ActorRef = system.actorOf(Props[PacketCodingActor], "pca")
|
val pca : ActorRef = system.actorOf(Props[PacketCodingActor], "pca")
|
||||||
within(200 millis) {
|
within(200 millis) {
|
||||||
pca ! HelloFriend(135, List.empty[ActorRef].iterator)
|
pca ! HelloFriend(135, List.empty[ActorRef].iterator)
|
||||||
expectNoMsg
|
expectNoMessage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -382,7 +382,7 @@ class PacketCodingActorETest extends ActorTest {
|
||||||
val reply = probe1.receiveN(2, 400 milli)
|
val reply = probe1.receiveN(2, 400 milli)
|
||||||
assert(reply.head == string_obj1)
|
assert(reply.head == string_obj1)
|
||||||
assert(reply(1) == string_obj2)
|
assert(reply(1) == string_obj2)
|
||||||
probe1.expectNoMsg(300 milli)
|
probe1.expectNoMessage(300 milli)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -403,7 +403,7 @@ class PacketCodingActorFTest extends ActorTest {
|
||||||
val reply = probe1.receiveN(1, 400 milli)
|
val reply = probe1.receiveN(1, 400 milli)
|
||||||
assert(reply.head == string_obj)
|
assert(reply.head == string_obj)
|
||||||
//the RelatedB message - 00 15 02 98 - is consumed by pca
|
//the RelatedB message - 00 15 02 98 - is consumed by pca
|
||||||
probe1.expectNoMsg(300 milli)
|
probe1.expectNoMessage(300 milli)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -424,7 +424,7 @@ class PacketCodingActorGTest extends ActorTest {
|
||||||
val reply = probe1.receiveN(1, 400 milli)
|
val reply = probe1.receiveN(1, 400 milli)
|
||||||
assert(reply.head == string_obj)
|
assert(reply.head == string_obj)
|
||||||
//the RelatedA message - 00 11 02 98 - is consumed by pca; should see error log message in console
|
//the RelatedA message - 00 11 02 98 - is consumed by pca; should see error log message in console
|
||||||
probe1.expectNoMsg(300 milli)
|
probe1.expectNoMessage(300 milli)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -446,7 +446,7 @@ class PacketCodingActorHTest extends ActorTest {
|
||||||
val reply = probe1.receiveN(2, 400 milli)
|
val reply = probe1.receiveN(2, 400 milli)
|
||||||
assert(reply.head == string_obj1)
|
assert(reply.head == string_obj1)
|
||||||
assert(reply(1) == string_obj2)
|
assert(reply(1) == string_obj2)
|
||||||
probe1.expectNoMsg(300 milli)
|
probe1.expectNoMessage(300 milli)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
|
// Copyright (c) 2017 PSForever
|
||||||
package actor.base
|
package actor.base
|
||||||
|
|
||||||
// Copyright (c) 2017 PSForever
|
import akka.actor.ActorSystem
|
||||||
|
import akka.testkit.{ImplicitSender, TestKit}
|
||||||
import akka.actor.{ActorRef, ActorSystem, MDCContextAware}
|
|
||||||
import akka.testkit.{ImplicitSender, TestKit, TestProbe}
|
|
||||||
import com.typesafe.config.ConfigFactory
|
import com.typesafe.config.ConfigFactory
|
||||||
import net.psforever.packet.{ControlPacket, GamePacket}
|
import org.scalatest.BeforeAndAfterAll
|
||||||
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
|
import org.scalatest.matchers.should.Matchers
|
||||||
|
import org.scalatest.wordspec.AnyWordSpecLike
|
||||||
import org.specs2.specification.Scope
|
import org.specs2.specification.Scope
|
||||||
|
|
||||||
abstract class ActorTest(sys : ActorSystem = ActorSystem("system", ConfigFactory.parseMap(ActorTest.LoggingConfig)))
|
abstract class ActorTest(sys : ActorSystem = ActorSystem("system", ConfigFactory.parseMap(ActorTest.LoggingConfig)))
|
||||||
extends TestKit(sys) with Scope with ImplicitSender with WordSpecLike with Matchers with BeforeAndAfterAll {
|
extends TestKit(sys) with Scope with ImplicitSender with AnyWordSpecLike with Matchers with BeforeAndAfterAll {
|
||||||
override def afterAll {
|
override def afterAll : Unit = {
|
||||||
TestKit.shutdownActorSystem(system)
|
TestKit.shutdownActorSystem(system)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object ActorTest {
|
object ActorTest {
|
||||||
import scala.collection.JavaConverters._
|
import scala.jdk.CollectionConverters._
|
||||||
private val LoggingConfig = Map(
|
private val LoggingConfig = Map(
|
||||||
"akka.loggers" -> List("akka.testkit.TestEventListener").asJava,
|
"akka.loggers" -> List("akka.testkit.TestEventListener").asJava,
|
||||||
"akka.loglevel" -> "OFF",
|
"akka.loglevel" -> "OFF",
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ class VehicleSpawnControl4Test extends ActorTest {
|
||||||
case _ => false
|
case _ => false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
probe.expectNoMsg(5 seconds)
|
probe.expectNoMessage(5 seconds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ class AvatarService5Test extends ActorTest {
|
||||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||||
service ! Service.Join("test")
|
service ! Service.Join("test")
|
||||||
service ! "hello"
|
service ! "hello"
|
||||||
expectNoMsg()
|
expectNoMessage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -424,13 +424,13 @@ class AvatarReleaseTest extends ActorTest {
|
||||||
|
|
||||||
"AvatarService" should {
|
"AvatarService" should {
|
||||||
"pass Release" in {
|
"pass Release" in {
|
||||||
expectNoMsg(100 milliseconds) //spacer
|
expectNoMessage(100 milliseconds) //spacer
|
||||||
|
|
||||||
service ! Service.Join("test")
|
service ! Service.Join("test")
|
||||||
taskResolver ! GUIDTask.RegisterObjectTask(obj)(zone.GUID)
|
taskResolver ! GUIDTask.RegisterObjectTask(obj)(zone.GUID)
|
||||||
assert(zone.Corpses.isEmpty)
|
assert(zone.Corpses.isEmpty)
|
||||||
zone.Population ! Zone.Corpse.Add(obj)
|
zone.Population ! Zone.Corpse.Add(obj)
|
||||||
expectNoMsg(200 milliseconds) //spacer
|
expectNoMessage(200 milliseconds) //spacer
|
||||||
|
|
||||||
assert(zone.Corpses.size == 1)
|
assert(zone.Corpses.size == 1)
|
||||||
assert(obj.HasGUID)
|
assert(obj.HasGUID)
|
||||||
|
|
@ -453,7 +453,7 @@ class AvatarReleaseTest extends ActorTest {
|
||||||
assert(reply2msg.replyMessage.isInstanceOf[AvatarResponse.ObjectDelete])
|
assert(reply2msg.replyMessage.isInstanceOf[AvatarResponse.ObjectDelete])
|
||||||
assert(reply2msg.replyMessage.asInstanceOf[AvatarResponse.ObjectDelete].item_guid == guid)
|
assert(reply2msg.replyMessage.asInstanceOf[AvatarResponse.ObjectDelete].item_guid == guid)
|
||||||
|
|
||||||
expectNoMsg(1 seconds)
|
expectNoMessage(1 seconds)
|
||||||
assert(zone.Corpses.isEmpty)
|
assert(zone.Corpses.isEmpty)
|
||||||
assert(!obj.HasGUID)
|
assert(!obj.HasGUID)
|
||||||
}
|
}
|
||||||
|
|
@ -473,13 +473,13 @@ class AvatarReleaseEarly1Test extends ActorTest {
|
||||||
|
|
||||||
"AvatarService" should {
|
"AvatarService" should {
|
||||||
"pass Release" in {
|
"pass Release" in {
|
||||||
expectNoMsg(100 milliseconds) //spacer
|
expectNoMessage(100 milliseconds) //spacer
|
||||||
|
|
||||||
service ! Service.Join("test")
|
service ! Service.Join("test")
|
||||||
taskResolver ! GUIDTask.RegisterObjectTask(obj)(zone.GUID)
|
taskResolver ! GUIDTask.RegisterObjectTask(obj)(zone.GUID)
|
||||||
assert(zone.Corpses.isEmpty)
|
assert(zone.Corpses.isEmpty)
|
||||||
zone.Population ! Zone.Corpse.Add(obj)
|
zone.Population ! Zone.Corpse.Add(obj)
|
||||||
expectNoMsg(200 milliseconds) //spacer
|
expectNoMessage(200 milliseconds) //spacer
|
||||||
|
|
||||||
assert(zone.Corpses.size == 1)
|
assert(zone.Corpses.size == 1)
|
||||||
assert(obj.HasGUID)
|
assert(obj.HasGUID)
|
||||||
|
|
@ -503,7 +503,7 @@ class AvatarReleaseEarly1Test extends ActorTest {
|
||||||
assert(reply2msg.replyMessage.isInstanceOf[AvatarResponse.ObjectDelete])
|
assert(reply2msg.replyMessage.isInstanceOf[AvatarResponse.ObjectDelete])
|
||||||
assert(reply2msg.replyMessage.asInstanceOf[AvatarResponse.ObjectDelete].item_guid == guid)
|
assert(reply2msg.replyMessage.asInstanceOf[AvatarResponse.ObjectDelete].item_guid == guid)
|
||||||
|
|
||||||
expectNoMsg(1 seconds)
|
expectNoMessage(1 seconds)
|
||||||
assert(zone.Corpses.isEmpty)
|
assert(zone.Corpses.isEmpty)
|
||||||
assert(!obj.HasGUID)
|
assert(!obj.HasGUID)
|
||||||
}
|
}
|
||||||
|
|
@ -524,13 +524,13 @@ class AvatarReleaseEarly2Test extends ActorTest {
|
||||||
|
|
||||||
"AvatarService" should {
|
"AvatarService" should {
|
||||||
"pass Release" in {
|
"pass Release" in {
|
||||||
expectNoMsg(100 milliseconds) //spacer
|
expectNoMessage(100 milliseconds) //spacer
|
||||||
|
|
||||||
service ! Service.Join("test")
|
service ! Service.Join("test")
|
||||||
taskResolver ! GUIDTask.RegisterObjectTask(obj)(zone.GUID)
|
taskResolver ! GUIDTask.RegisterObjectTask(obj)(zone.GUID)
|
||||||
assert(zone.Corpses.isEmpty)
|
assert(zone.Corpses.isEmpty)
|
||||||
zone.Population ! Zone.Corpse.Add(obj)
|
zone.Population ! Zone.Corpse.Add(obj)
|
||||||
expectNoMsg(200 milliseconds) //spacer
|
expectNoMessage(200 milliseconds) //spacer
|
||||||
|
|
||||||
assert(zone.Corpses.size == 1)
|
assert(zone.Corpses.size == 1)
|
||||||
assert(obj.HasGUID)
|
assert(obj.HasGUID)
|
||||||
|
|
@ -554,7 +554,7 @@ class AvatarReleaseEarly2Test extends ActorTest {
|
||||||
assert(reply2msg.replyMessage.isInstanceOf[AvatarResponse.ObjectDelete])
|
assert(reply2msg.replyMessage.isInstanceOf[AvatarResponse.ObjectDelete])
|
||||||
assert(reply2msg.replyMessage.asInstanceOf[AvatarResponse.ObjectDelete].item_guid == guid)
|
assert(reply2msg.replyMessage.asInstanceOf[AvatarResponse.ObjectDelete].item_guid == guid)
|
||||||
|
|
||||||
expectNoMsg(1 seconds)
|
expectNoMessage(1 seconds)
|
||||||
assert(zone.Corpses.isEmpty)
|
assert(zone.Corpses.isEmpty)
|
||||||
assert(!obj.HasGUID)
|
assert(!obj.HasGUID)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue