mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-14 09:50:37 +00:00
switched NumberPoolAccessorActor out for UniqueNumberSystem; created file that enumerates object types for future reference
cleaned up folder object/guid, except for contents of objects/guid/selectors
This commit is contained in:
parent
0a0a416585
commit
92b6883fa0
14 changed files with 103 additions and 1291 deletions
|
|
@ -2,16 +2,11 @@
|
|||
package objects
|
||||
|
||||
import akka.actor.{ActorSystem, Props}
|
||||
import akka.testkit.TestProbe
|
||||
import net.psforever.objects.entity.IdentifiableEntity
|
||||
import net.psforever.objects.guid.NumberPoolHub
|
||||
import net.psforever.objects.guid.actor.{NumberPoolAccessorActor, NumberPoolActor, Register}
|
||||
import net.psforever.objects.guid.actor.NumberPoolActor
|
||||
import net.psforever.objects.guid.pool.ExclusivePool
|
||||
import net.psforever.objects.guid.selector.RandomSelector
|
||||
import net.psforever.objects.guid.source.LimitedNumberSource
|
||||
|
||||
import scala.concurrent.duration.Duration
|
||||
import scala.util.Success
|
||||
|
||||
class NumberPoolActorTest extends ActorTest(ActorSystem("test")) {
|
||||
"NumberPoolActor" should {
|
||||
|
|
@ -53,23 +48,3 @@ class NumberPoolActorTest2 extends ActorTest(ActorSystem("test")) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
class NumberPoolActorTest3 extends ActorTest(ActorSystem("test")) {
|
||||
"NumberPoolAccessorActor" should {
|
||||
class TestEntity extends IdentifiableEntity
|
||||
|
||||
"register" in {
|
||||
val hub = new NumberPoolHub(new LimitedNumberSource(51))
|
||||
val pool = hub.AddPool("test", (25 to 50).toList)
|
||||
pool.Selector = new RandomSelector
|
||||
val poolActor = system.actorOf(Props(classOf[NumberPoolActor], pool), name = "poolActor")
|
||||
val poolAccessor = system.actorOf(Props(classOf[NumberPoolAccessorActor], hub, pool, poolActor), name = "accessor")
|
||||
|
||||
val obj : TestEntity = new TestEntity
|
||||
val probe = new TestProbe(system)
|
||||
poolAccessor ! Register(obj, probe.ref)
|
||||
probe.expectMsg(Success(obj))
|
||||
assert({obj.GUID; true}) //NoGUIDException if failure
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue