mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-26 14:25:21 +00:00
Facility Turrets (#223)
* object class, actor class, and definitions for base turrets; untested * wired base turrets into existence, with hoop jumping; created interface for objects with mounted weapons (vehicles and turrets); working example phalanx_sgl_hevgatcan in Anguta, Ceryshen * re-wiring manned turrets so that the turreted weapon itself never changes externally but merely identifies different and changes internally; workflow for upgrading wall turrets in place (30s); clarifications and documentation for HackMessage and UseItemMessage; getting rid of orphaned packages from previous location of services * added a simple task that reverts upgraded manned turrets to their None state after a certain amount of time has passed; it works but need improvement * turret weapon upgrades now last for a duration of 30 minutes before reverting; created a service support actor base actor that underlies all current support actors; nano-dispenser now properly loads 1 unit of upgrade canister, rather than 100 units; all canister types have appropriate 2x3 inventory size * forgot to hurry; moved over the Services tests from main/test folder into the common/test folder and needed to change the location of ActorTest to accommodate it; test and documentation for MannedTurret; codecov ignore update * wired facility turrets in Anguta, Ceryshen; Akna tower, Ceryshen; and S.Villa tower, home3 (Anguta tower is a watchtower); attempted workaround for Travis CI issues with receiveN; re-introduced RemoveActorTest, at least the first test; expanded how ZoneActor performs tests on MannedTurret setup * getting rid of useless commented-out code; making common operations for mounting and dismounting * removed outdated comment; added ResourceSilo tests; added extra test for Zone
This commit is contained in:
parent
61a51c1dd1
commit
b81ff2bbf4
75 changed files with 2246 additions and 680 deletions
118
common/src/test/scala/service/LocalServiceTest.scala
Normal file
118
common/src/test/scala/service/LocalServiceTest.scala
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
package service
|
||||
|
||||
// Copyright (c) 2017 PSForever
|
||||
import akka.actor.Props
|
||||
import base.ActorTest
|
||||
import net.psforever.objects.serverobject.PlanetSideServerObject
|
||||
import net.psforever.packet.game.PlanetSideGUID
|
||||
import net.psforever.types.{PlanetSideEmpire, Vector3}
|
||||
import services.Service
|
||||
import services.local._
|
||||
|
||||
class LocalService1Test extends ActorTest {
|
||||
"LocalService" should {
|
||||
"construct" in {
|
||||
system.actorOf(Props[LocalService], "service")
|
||||
assert(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class LocalService2Test extends ActorTest {
|
||||
"LocalService" should {
|
||||
"subscribe" in {
|
||||
val service = system.actorOf(Props[LocalService], "service")
|
||||
service ! Service.Join("test")
|
||||
assert(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class LocalService3Test extends ActorTest {
|
||||
"LocalService" should {
|
||||
"subscribe to a specific channel" in {
|
||||
val service = system.actorOf(Props[LocalService], "service")
|
||||
service ! Service.Join("test")
|
||||
service ! Service.Leave()
|
||||
assert(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class LocalService4Test extends ActorTest {
|
||||
"LocalService" should {
|
||||
"subscribe" in {
|
||||
val service = system.actorOf(Props[LocalService], "service")
|
||||
service ! Service.Join("test")
|
||||
service ! Service.LeaveAll()
|
||||
assert(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class LocalService5Test extends ActorTest {
|
||||
"LocalService" should {
|
||||
"pass an unhandled message" in {
|
||||
val service = system.actorOf(Props[LocalService], "service")
|
||||
service ! Service.Join("test")
|
||||
service ! "hello"
|
||||
expectNoMsg()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DoorClosesTest extends ActorTest {
|
||||
"LocalService" should {
|
||||
"pass DoorCloses" in {
|
||||
val service = system.actorOf(Props[LocalService], "service")
|
||||
service ! Service.Join("test")
|
||||
service ! LocalServiceMessage("test", LocalAction.DoorCloses(PlanetSideGUID(10), PlanetSideGUID(40)))
|
||||
expectMsg(LocalServiceResponse("/test/Local", PlanetSideGUID(10), LocalResponse.DoorCloses(PlanetSideGUID(40))))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class HackClearTest extends ActorTest {
|
||||
val obj = new PlanetSideServerObject() {
|
||||
def Faction = PlanetSideEmpire.NEUTRAL
|
||||
def Definition = null
|
||||
GUID = PlanetSideGUID(40)
|
||||
}
|
||||
|
||||
"LocalService" should {
|
||||
"pass HackClear" in {
|
||||
val service = system.actorOf(Props[LocalService], "service")
|
||||
service ! Service.Join("test")
|
||||
service ! LocalServiceMessage("test", LocalAction.HackClear(PlanetSideGUID(10), obj, 0L, 1000L))
|
||||
expectMsg(LocalServiceResponse("/test/Local", PlanetSideGUID(10), LocalResponse.HackClear(PlanetSideGUID(40), 0L, 1000L)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ProximityTerminalEffectTest extends ActorTest {
|
||||
"LocalService" should {
|
||||
"pass ProximityTerminalEffect" in {
|
||||
val service = system.actorOf(Props[LocalService], "service")
|
||||
service ! Service.Join("test")
|
||||
service ! LocalServiceMessage("test", LocalAction.ProximityTerminalEffect(PlanetSideGUID(10), PlanetSideGUID(40), true))
|
||||
expectMsg(LocalServiceResponse("/test/Local", PlanetSideGUID(10), LocalResponse.ProximityTerminalEffect(PlanetSideGUID(40), true)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TriggerSoundTest extends ActorTest {
|
||||
import net.psforever.packet.game.TriggeredSound
|
||||
|
||||
"LocalService" should {
|
||||
"pass TriggerSound" in {
|
||||
val service = system.actorOf(Props[LocalService], "service")
|
||||
service ! Service.Join("test")
|
||||
service ! LocalServiceMessage("test", LocalAction.TriggerSound(PlanetSideGUID(10), TriggeredSound.LockedOut, Vector3(1.1f, 2.2f, 3.3f), 0, 0.75f))
|
||||
expectMsg(LocalServiceResponse("/test/Local", PlanetSideGUID(10), LocalResponse.TriggerSound(TriggeredSound.LockedOut, Vector3(1.1f, 2.2f, 3.3f), 0, 0.75f)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object LocalServiceTest {
|
||||
//decoy
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue