/// <summary> /// redisMessageHandler is a single entry point for processing all inbound redis messages from simulators. /// </summary> /// <param name="simulatorConfig"></param> /// <param name="redisServer"></param> /// <param name="redisMessageHandler"></param> public SimulatorManager(SimulatorConfig simulatorConfig, RedisServer redisServer, EventHandler <NetworkMessageContainer> messageHandler) { _redisServer = redisServer; _config = simulatorConfig; _areaIdToSimulatorInterface = new Dictionary <int, SimulatorInterface>(); _messageHandler = messageHandler; }
/// <summary> /// Must call .Spawn() to launch a simulator process /// </summary> /// <param name="redisServer"></param> public SimulatorInterface(int simulatorID, SimulatorConfig config, RedisServer redisServer) { SimulatorID = simulatorID; SimulatedAreaIDs = new List <int>(); _redisServer = redisServer; _config = config; _redisServer.Subscribe(ChannelTypes.SimulatorToServer_Network, SimulatorID, _handleSimulatorMessage); }