Ejemplo n.º 1
0
 public void Update(LogicUpdate update)
 {
     foreach (var system in LogicSystems)
     {
         system.Update(update);
     }
 }
Ejemplo n.º 2
0
        public static void SubscribeCompilationError(int sceneId)
        {
            try
            {
                LogManager.GetCurrentClassLogger().Info($"subscribe compilation error to scene {sceneId}");

                IModel channel   = GetChanel();
                string queueName = ExchangeDeclareIfNotExist(ExchangeNames.CompilationError, "topic", true);

                string key = $"scene.{sceneId}";

                channel.QueueBind(queueName,
                                  ExchangeNames.CompilationError,
                                  key);

                EventingBasicConsumer consumer = new EventingBasicConsumer(channel);

                consumer.Received += (model, ea) =>
                {
                    LogManager.GetCurrentClassLogger().Info("Compilation error was received");

                    LogicUpdate groupLogicUpdate = new LogicUpdate(Contexts.sharedInstance, null, sceneId);
                    groupLogicUpdate.Execute();
                    GameStateData.ClearLogic();
                };

                string tag = channel.BasicConsume(queueName,
                                                  true,
                                                  consumer);

                if (!SubscribeCompilationTags.ContainsKey(sceneId))
                {
                    SubscribeCompilationTags.Add(sceneId, string.Empty);
                }

                SubscribeCompilationTags[sceneId] = tag;
            }
            catch (Exception ex)
            {
                LogManager.GetCurrentClassLogger()
                .Fatal($"RabbitMQ error! subscribe to compilation error! {ex.Message}");
                VRErrorManager.Instance.ShowFatal("RabbitMQ error! Subscribe to compilation error!");
            }
        }
Ejemplo n.º 3
0
 protected override void Compute(LogicUpdate state, in DefaultEcs.Entity e)