PSF-BotServer/common/src/test/scala/objects/guidtask/GUIDTaskUnregisterAvatarTest.scala

45 lines
1.8 KiB
Scala
Raw Normal View History

// Copyright (c) 2017 PSForever
package objects.guidtask
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
2018-07-14 21:25:44 -04:00
import base.ActorTest
import net.psforever.objects._
import net.psforever.objects.guid.{GUIDTask, TaskResolver}
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire}
Deployables (#230) * functions for certifcation ui updates (that don't work) * initialization of combat engineering deployables ui on load and certification change * representation classes for ACE and FDU; ability to pull ACE and FDU from equipment terminals * ammo change functionality and fire mode change functionality for ConstructionItems refactored from Tool operations and supported properly (switch between deployable options) * zone-specific structure for keeping track of deployables; abaility to dismiss deployables from the map screen (previous functionality); local client creation of explosive-type deployables * refactored MannedTurret into FacilityTurret and lesser traits to be used in the deployable spitfires and the OMFT's; all ACE deployables are available for placement; partial management of the construction items after the deployable is placed; boomers create boomer triggers * Avatar-specific storage for deployables and for updating UI elements * refactored quite a bit of code in WSA for the benefit of deployable management; refinements to deployable creation; server messages about deployable quantities; corrected the FDU encoding pattern; lots of work dedicated just to synchronizing BoomerTrigger objects * added RemoverActor for deployables and redistributed deconstruction functionality away from WSA to new DeployableRemover; added events to facilitate activities not inheritable with this model * refactored and distributed Deployables classes; copious amounts of testing and document-writing * boomers now explode from trigger; support for deployables being destroyed by weapon discharge, including individual health, soure identification, and damage model; shuffled deployable classes to build different hierarchy * sensor_shield was skipped by accident * identified stray object in Hanish, Ishundar, and added Irkalla, Ishundar's capture console; fixed issue with Warp command and 'Irkalla'; modified building amenity setup and setup testing in Zone; players load and die properly when seated in an omft; reserve ammunition in omft properly registered * added local service channel, capture consoles, fixed tests as much as posible * fixed LocalService tests by booting the ServiceManager; added avatar and local tests * a simple attempt to refactor Actor messages in a way that is acceptable to Travis CI * making the explosive deployables vanish upon explosion; sensor health bars are now supported
2018-09-23 08:00:58 -04:00
class GUIDTaskUnregisterAvatarTest extends ActorTest {
"UnregisterAvatar" in {
val (guid, uns, taskResolver, probe) = GUIDTaskTest.CommonTestSetup
val obj = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
val obj_wep = Tool(GlobalDefinitions.beamer)
obj.Slot(0).Equipment = obj_wep
val obj_wep_ammo = AmmoBox(GlobalDefinitions.energy_cell)
obj_wep.AmmoSlots.head.Box = obj_wep_ammo
val obj_inv_ammo = AmmoBox(GlobalDefinitions.energy_cell)
obj.Slot(6).Equipment = obj_inv_ammo
val obj_locker = obj.Slot(5).Equipment.get
val obj_locker_ammo = AmmoBox(GlobalDefinitions.energy_cell)
Let's Move Item, Together (#429) * mix-in code for akka messaging move item, currently testing on infantry only * adjusted structure of COntainable so callbacks are separate from message-producing functions, are separate from message-sending functionality; massaged LockerContainer until it could support control agency and created a wrapper for its Equipment interfacing; the control structure starts and stops when PlayerControl starts and stops, and it converts whenever necessary * added failsafe conditions to Containable, such as blocking certain messages while completing a MoveItem call, or blocking all messages to reset disruptive MoveItem calls; depiction message callbacks for Player, Locker, and Vehicle, to properly depict the manipulation of items; eliminated the old code from WSA * added useful comments to Containable; moved functionality for deployables, and for container'ing, and dropping logic out from WSA and distributed it appropriately * handling terminal operations - buying an exosuit and selecting an infantry loadout; starting work on support for more persistent equipment timers local to the avatar (that were removed in this update; see wsa changes) * linked terminal page/message with routing policy * tuning vehicle loadout management and display * separated use time from purchase time and applied a system that limits either if that same event would recur too soon; tuning exosuit and loadout changes * some ask timeout handling and comments * normalizing item on ground interactions * rearranging the project structure * merged with master; commas removed * fixing tests * added description strings to Tasks; adjusted the completion conditions for some Tasks * a failed purchase will not block future purchases; increased timeout on move-item tasks * corpses, even one's own, should have properly moveable inventories * for better persistence, until GlobalDefinitions is renovated, moved the object id->name map onto the avatar object, for the purpose of timers; replaced a use of values in GridInventory for a map conversion * max loadouts and max exosuit switch use same cooldown now; hopefully better clarifcation regarding held arm position
2020-05-16 12:18:08 -04:00
obj_locker.asInstanceOf[LockerEquipment].Inventory += 0 -> obj_locker_ammo
guid.register(obj, "dynamic")
guid.register(obj_wep, "dynamic")
guid.register(obj_wep_ammo, "dynamic")
guid.register(obj_inv_ammo, "dynamic")
guid.register(obj_locker, "dynamic")
guid.register(obj_locker_ammo, "dynamic")
assert(obj.HasGUID)
assert(obj_wep.HasGUID)
assert(obj_wep_ammo.HasGUID)
assert(obj_inv_ammo.HasGUID)
assert(obj_locker.HasGUID)
assert(obj_locker_ammo.HasGUID)
taskResolver ! TaskResolver.GiveTask(new GUIDTaskTest.RegisterTestTask(probe.ref), List(GUIDTask.UnregisterAvatar(obj)(uns)))
probe.expectMsg(scala.util.Success)
assert(!obj.HasGUID)
assert(!obj_wep.HasGUID)
assert(!obj_wep_ammo.HasGUID)
assert(!obj_inv_ammo.HasGUID)
assert(!obj_locker.HasGUID)
assert(!obj_locker_ammo.HasGUID)
}
}