mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-04-29 16:25:30 +00:00
accomodations for tests; adjusting conditions for proximity terminal operations; adding the medical terminals in Anguta
This commit is contained in:
parent
4049be68e4
commit
a31207322b
4 changed files with 63 additions and 31 deletions
|
|
@ -3,7 +3,7 @@ package objects.terminal
|
|||
|
||||
import akka.actor.ActorRef
|
||||
import net.psforever.objects.serverobject.terminals.{MedicalTerminalDefinition, ProximityTerminal, Terminal}
|
||||
import net.psforever.objects.{GlobalDefinitions, Player}
|
||||
import net.psforever.objects.{Avatar, GlobalDefinitions, Player}
|
||||
import net.psforever.packet.game.{ItemTransactionMessage, PlanetSideGUID}
|
||||
import net.psforever.types.{CharacterGender, PlanetSideEmpire, TransactionType}
|
||||
import org.specs2.mutable.Specification
|
||||
|
|
@ -64,14 +64,14 @@ class MedicalTerminalTest extends Specification {
|
|||
ProximityTerminal(GlobalDefinitions.medical_terminal).Actor mustEqual ActorRef.noSender
|
||||
}
|
||||
|
||||
"can add a a player to a list of users" in {
|
||||
"can add a player to a list of users" in {
|
||||
val terminal = ProximityTerminal(GlobalDefinitions.medical_terminal)
|
||||
terminal.NumberUsers mustEqual 0
|
||||
terminal.AddUser(PlanetSideGUID(10))
|
||||
terminal.NumberUsers mustEqual 1
|
||||
}
|
||||
|
||||
"can remove a a player to a list of users" in {
|
||||
"can remove a player from a list of users" in {
|
||||
val terminal = ProximityTerminal(GlobalDefinitions.medical_terminal)
|
||||
terminal.AddUser(PlanetSideGUID(10))
|
||||
terminal.NumberUsers mustEqual 1
|
||||
|
|
@ -81,7 +81,7 @@ class MedicalTerminalTest extends Specification {
|
|||
|
||||
"player can not interact with the proximity terminal normally (buy)" in {
|
||||
val terminal = ProximityTerminal(GlobalDefinitions.medical_terminal)
|
||||
val player = Player("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, 0)
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, 0))
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 1, "lite_armor", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package objects.terminal
|
|||
|
||||
import akka.actor.{ActorSystem, Props}
|
||||
import net.psforever.objects.serverobject.CommonMessages
|
||||
import net.psforever.objects.{GlobalDefinitions, Player}
|
||||
import net.psforever.objects.{Avatar, GlobalDefinitions, Player}
|
||||
import net.psforever.objects.serverobject.terminals._
|
||||
import net.psforever.packet.game.PlanetSideGUID
|
||||
import net.psforever.types.{CharacterGender, PlanetSideEmpire}
|
||||
|
|
@ -35,7 +35,7 @@ class MedicalTerminalControl1Test extends ActorTest() {
|
|||
"ProximityTerminalControl sends a message to the first new user only" in {
|
||||
val (player, terminal) = ProximityTerminalControlTest.SetUpAgents(GlobalDefinitions.medical_terminal, PlanetSideEmpire.TR)
|
||||
player.GUID = PlanetSideGUID(10)
|
||||
val player2 = Player("someothertest", PlanetSideEmpire.TR, CharacterGender.Male, 0, 0)
|
||||
val player2 = Player(Avatar("someothertest", PlanetSideEmpire.TR, CharacterGender.Male, 0, 0))
|
||||
player2.GUID = PlanetSideGUID(11)
|
||||
|
||||
terminal.Actor ! CommonMessages.Use(player)
|
||||
|
|
@ -58,7 +58,7 @@ class MedicalTerminalControl2Test extends ActorTest() {
|
|||
"ProximityTerminalControl sends a message to the last user only" in {
|
||||
val (player, terminal) : (Player, ProximityTerminal) = ProximityTerminalControlTest.SetUpAgents(GlobalDefinitions.medical_terminal, PlanetSideEmpire.TR)
|
||||
player.GUID = PlanetSideGUID(10)
|
||||
val player2 = Player("someothertest", PlanetSideEmpire.TR, CharacterGender.Male, 0, 0)
|
||||
val player2 = Player(Avatar("someothertest", PlanetSideEmpire.TR, CharacterGender.Male, 0, 0))
|
||||
player2.GUID = PlanetSideGUID(11)
|
||||
|
||||
terminal.Actor ! CommonMessages.Use(player)
|
||||
|
|
@ -87,7 +87,7 @@ class MedicalTerminalControl3Test extends ActorTest() {
|
|||
"ProximityTerminalControl sends a message to the last user only (confirmation of test #2)" in {
|
||||
val (player, terminal) : (Player, ProximityTerminal) = ProximityTerminalControlTest.SetUpAgents(GlobalDefinitions.medical_terminal, PlanetSideEmpire.TR)
|
||||
player.GUID = PlanetSideGUID(10)
|
||||
val player2 = Player("someothertest", PlanetSideEmpire.TR, CharacterGender.Male, 0, 0)
|
||||
val player2 = Player(Avatar("someothertest", PlanetSideEmpire.TR, CharacterGender.Male, 0, 0))
|
||||
player2.GUID = PlanetSideGUID(11)
|
||||
|
||||
terminal.Actor ! CommonMessages.Use(player)
|
||||
|
|
@ -116,6 +116,6 @@ object ProximityTerminalControlTest {
|
|||
def SetUpAgents(tdef : MedicalTerminalDefinition, faction : PlanetSideEmpire.Value)(implicit system : ActorSystem) : (Player, ProximityTerminal) = {
|
||||
val terminal = ProximityTerminal(tdef)
|
||||
terminal.Actor = system.actorOf(Props(classOf[ProximityTerminalControl], terminal), "test-term")
|
||||
(Player("test", faction, CharacterGender.Male, 0, 0), terminal)
|
||||
(Player(Avatar("test", faction, CharacterGender.Male, 0, 0)), terminal)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue