mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-07-08 13:04:41 +00:00
reorganized the services.base classes; streamlined the class inheritance structure and param requirements for certain classes; messed up all imports
This commit is contained in:
parent
775d9dca5e
commit
4dc5d7f01e
149 changed files with 460 additions and 506 deletions
|
|
@ -16,13 +16,13 @@ import net.psforever.packet.game.{ObjectCreateMessage, PlayerStateMessageUpstrea
|
|||
import net.psforever.types._
|
||||
import net.psforever.services.{RemoverActor, Service, ServiceManager}
|
||||
import net.psforever.services.avatar._
|
||||
import net.psforever.services.base.messages.{ChangeAmmo, ChangeFireState_Start, ChangeFireState_Stop, ObjectDelete, PlanetsideAttribute, WeaponDryFire}
|
||||
import net.psforever.services.base.message.{ChangeAmmo, ChangeFireState_Start, ChangeFireState_Stop, ConcealPlayer, ObjectDelete, PlanetsideAttribute, ReloadTool, WeaponDryFire}
|
||||
|
||||
class AvatarService1Test extends ActorTest {
|
||||
"AvatarService" should {
|
||||
"construct" in {
|
||||
ServiceManager.boot(system)
|
||||
system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
assert(true)
|
||||
}
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ class AvatarService2Test extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"subscribe" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
assert(true)
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ class AvatarService3Test extends ActorTest {
|
|||
"AvatarService" should {
|
||||
ServiceManager.boot(system)
|
||||
"subscribe to a specific channel" in {
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! Service.Leave()
|
||||
assert(true)
|
||||
|
|
@ -55,7 +55,7 @@ class AvatarService4Test extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"subscribe" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! Service.LeaveAll()
|
||||
assert(true)
|
||||
|
|
@ -67,7 +67,7 @@ class AvatarService5Test extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass an unhandled message" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! "hello"
|
||||
expectNoMessage()
|
||||
|
|
@ -79,7 +79,7 @@ class ArmorChangedTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass ArmorChanged" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", PlanetSideGUID(10), AvatarAction.ArmorChanged(ExoSuitType.Reinforced, 0))
|
||||
expectMsg(
|
||||
|
|
@ -97,17 +97,17 @@ class ConcealPlayerTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass ConcealPlayer" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", AvatarAction.ConcealPlayer(PlanetSideGUID(10)))
|
||||
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), AvatarAction.ConcealPlayer(PlanetSideGUID(10))))
|
||||
service ! AvatarServiceMessage("test", ConcealPlayer(PlanetSideGUID(10)))
|
||||
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), ConcealPlayer(PlanetSideGUID(10))))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class EquipmentInHandTest extends ActorTest {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), "release-test-service")
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), "release-test-service")
|
||||
val toolDef = GlobalDefinitions.beamer
|
||||
val tool = Tool(toolDef)
|
||||
tool.GUID = PlanetSideGUID(40)
|
||||
|
|
@ -134,7 +134,7 @@ class EquipmentInHandTest extends ActorTest {
|
|||
|
||||
class DroptItemTest extends ActorTest {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), "release-test-service")
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), "release-test-service")
|
||||
val toolDef = GlobalDefinitions.beamer
|
||||
val tool = Tool(toolDef)
|
||||
tool.Position = Vector3(1, 2, 3)
|
||||
|
|
@ -173,7 +173,7 @@ class LoadPlayerTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass LoadPlayer" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
//no parent data
|
||||
service ! AvatarServiceMessage(
|
||||
|
|
@ -197,7 +197,7 @@ class ObjectDeleteTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass ObjectDelete" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", PlanetSideGUID(10), ObjectDelete(PlanetSideGUID(11)))
|
||||
expectMsg(
|
||||
|
|
@ -216,7 +216,7 @@ class ObjectHeldTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass ObjectHeld" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", PlanetSideGUID(10), AvatarAction.ObjectHeld(1, 2))
|
||||
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), AvatarAction.ObjectHeld(1, 2)))
|
||||
|
|
@ -228,7 +228,7 @@ class PutDownFDUTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass PutDownFDU" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", AvatarAction.PutDownFDU(PlanetSideGUID(10)))
|
||||
expectMsg(
|
||||
|
|
@ -242,7 +242,7 @@ class PlanetsideAttributeTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass PlanetsideAttribute" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", PlanetSideGUID(10), PlanetsideAttribute(PlanetSideGUID(10), 5, 1200L))
|
||||
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), PlanetsideAttribute(PlanetSideGUID(10), 5, 1200L)))
|
||||
|
|
@ -271,7 +271,7 @@ class PlayerStateTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass PlayerState" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage(
|
||||
"test",
|
||||
|
|
@ -322,7 +322,7 @@ class PickupItemTest extends ActorTest {
|
|||
|
||||
"pass PickUpItem" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! PickupItemMessage("test", AvatarAction.PickupItem(tool), Zone.Nowhere)
|
||||
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), ObjectDelete(tool.GUID, 0)))
|
||||
|
|
@ -333,10 +333,10 @@ class ReloadTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass Reload" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", PlanetSideGUID(10), AvatarAction.Reload(PlanetSideGUID(40)))
|
||||
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), AvatarAction.Reload(PlanetSideGUID(40))))
|
||||
service ! AvatarServiceMessage("test", PlanetSideGUID(10), ReloadTool(PlanetSideGUID(40)))
|
||||
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), ReloadTool(PlanetSideGUID(40))))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -348,7 +348,7 @@ class ChangeAmmoTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass ChangeAmmo" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage(
|
||||
"test",
|
||||
|
|
@ -387,7 +387,7 @@ class ChangeFireModeTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass ChangeFireMode" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", PlanetSideGUID(10), AvatarAction.ChangeFireMode(PlanetSideGUID(40), 0))
|
||||
expectMsg(
|
||||
|
|
@ -401,7 +401,7 @@ class ChangeFireStateStartTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass ChangeFireState_Start" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", PlanetSideGUID(10), ChangeFireState_Start(PlanetSideGUID(40)))
|
||||
expectMsg(
|
||||
|
|
@ -419,7 +419,7 @@ class ChangeFireStateStopTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass ChangeFireState_Stop" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", PlanetSideGUID(10), ChangeFireState_Stop(PlanetSideGUID(40)))
|
||||
expectMsg(
|
||||
|
|
@ -437,7 +437,7 @@ class WeaponDryFireTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass WeaponDryFire" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage("test", PlanetSideGUID(10), WeaponDryFire(PlanetSideGUID(40)))
|
||||
expectMsg(
|
||||
|
|
@ -453,7 +453,7 @@ class AvatarStowEquipmentTest extends ActorTest {
|
|||
"AvatarService" should {
|
||||
"pass StowEquipment" in {
|
||||
ServiceManager.boot(system)
|
||||
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
|
||||
val service = system.actorOf(Props(classOf[AvatarService]), AvatarServiceTest.TestName)
|
||||
service ! Service.Join("test")
|
||||
service ! AvatarServiceMessage(
|
||||
"test",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue