public UserActorTest(ITestOutputHelper output, ClusterContextFixture clusterContextFixture) : base(output: output) { clusterContextFixture.Initialize(Sys); _clusterContext = clusterContextFixture.Context; _client = new MockClient(_clusterContext); }
public GameWorker(ClusterNodeContext context, Config config) { _context = context; _channelType = (ChannelType)Enum.Parse(typeof(ChannelType), config.GetString("type", "Tcp"), true); _listenEndPoint = new IPEndPoint(IPAddress.Any, config.GetInt("port", 0)); _connectEndPoint = new IPEndPoint(IPAddress.Parse(config.GetString("address", "127.0.0.1")), config.GetInt("port", 0)); }
public GameBotActor(ClusterNodeContext clusterContext, GameRef game, long userId, string userName) { _logger = LogManager.GetLogger($"GameBotActor({userId}, {userName})"); _game = game; _userId = userId; _userName = userName; }
public GamePairMakerActor(ClusterNodeContext clusterContext) { _clusterContext = clusterContext; _clusterContext.ClusterActorDiscovery.Tell( new ClusterActorDiscoveryMessage.RegisterActor(Self, nameof(IGamePairMaker)), Self); _pairingQueue = new List<QueueEntity>(); }
public void Dispose() { if (Context == null) { return; } Context.System.Terminate().Wait(); Context = null; }
public UserWorker(ClusterNodeContext context, Config config) { _context = context; _channelType = (ChannelType)Enum.Parse(typeof(ChannelType), config.GetString("type", "Tcp"), true); _listenEndPoint = new IPEndPoint(IPAddress.Any, config.GetInt("port", 0)); var connectAddress = config.GetString("connect-address"); var connectPort = config.GetInt("connect-port", _listenEndPoint.Port); _connectEndPoint = new IPEndPoint(connectAddress != null ? IPAddress.Parse(connectAddress) : IPAddress.Loopback, connectPort); }
public GamePairMakerActor(ClusterNodeContext clusterContext) { _clusterContext = clusterContext; _clusterContext.ClusterActorDiscovery.Tell( new ClusterActorDiscoveryMessage.RegisterActor(Self, nameof(IGamePairMaker)), Self); _pairingQueue = new List <QueueEntity>(); }
public MockClient(ClusterNodeContext clusterContex) { _clusterContext = clusterContex; var channel = new TestActorRef <TestActorBoundChannel>( _clusterContext.System, Props.Create(() => new TestActorBoundChannel(CreateInitialActor))); Channel = channel.UnderlyingActor; ChannelRef = channel.Cast <ActorBoundChannelRef>(); UserLogin = Channel.CreateRef <UserLoginRef>(); }
public void Initialize(ActorSystem system) { DeadRequestProcessingActor.Install(system); var context = new ClusterNodeContext { System = system }; context.ClusterActorDiscovery = system.ActorOf(Props.Create( () => new ClusterActorDiscovery(null))); context.UserTable = new DistributedActorTableRef <long>(system.ActorOf( Props.Create(() => new DistributedActorTable <long>( "User", context.ClusterActorDiscovery, null, null)), "UserTable")); _userTableContainer = new DistributedActorTableContainerRef <long>(system.ActorOf( Props.Create(() => new DistributedActorTableContainer <long>( "User", context.ClusterActorDiscovery, typeof(UserActorFactory), new object[] { context }, InterfacedPoisonPill.Instance)), "UserTableContainer")); Context = context; }
public UserTableWorker(ClusterNodeContext context, Config config) { _context = context; }
public GamePairMakerWorker(ClusterNodeContext context, Config config) { _context = context; }
public GameActor(ClusterNodeContext clusterContext, long id, CreateGameParam param) { _logger = LogManager.GetLogger($"GameActor({id})"); _clusterContext = clusterContext; _id = id; }
public void Initialize(object[] args) { _clusterContext = (ClusterNodeContext)args[0]; }
public UserActor(ClusterNodeContext clusterContext, long id) { _logger = LogManager.GetLogger($"UserActor({id})"); _clusterContext = clusterContext; _id = id; }
public UserLoginActor(ClusterNodeContext clusterContext, ActorBoundChannelRef channel, EndPoint clientRemoteEndPoint) { _logger = LogManager.GetLogger($"UserLoginActor({clientRemoteEndPoint})"); _clusterContext = clusterContext; _channel = channel; }