Ejemplo n.º 1
0
        /// <summary>
        /// Sends current runtime status of apps and plans to subcribed clients
        /// </summary>
        void RefreshClients()
        {
            // clients
            {
                foreach ((var id, var state) in _allClientStates.ClientStates)
                {
                    var m = new Net.ClientStateMessage(DateTime.UtcNow, state);
                    _server.SendToAllSubscribed(m, EMsgRecipCateg.Gui);
                }
            }

            // apps
            {
                var m = new Net.AppsStateMessage(_allAppStates.AppStates, DateTime.UtcNow);
                _server.SendToAllSubscribed(m, EMsgRecipCateg.Gui);
            }

            // plans
            {
                var m = new Net.PlansStateMessage(_plans.PlanStates);
                _server.SendToAllSubscribed(m, EMsgRecipCateg.Gui);
            }

            // scripts
            {
                var m = new Net.ScriptStateMessage(_scripts.ScriptStates);
                _server.SendToAllSubscribed(m, EMsgRecipCateg.Gui);
            }
        }
Ejemplo n.º 2
0
        void FeedGui(ClientIdent ident)
        {
            // send the full list of clients
            {
                foreach ((var id, var state) in _allClientStates.ClientStates)
                {
                    var m = new Net.ClientStateMessage(DateTime.UtcNow, state);
                    _server.SendToSingle(m, ident.Name);
                }
            }

            // send the full list of plans
            {
                var m = new Net.PlanDefsMessage(from p in _plans.Plans.Values select p.Def, incremental: false);
                _server.SendToSingle(m, ident.Name);
            }

            // send the full list of plan states
            {
                var m = new Net.PlansStateMessage(_plans.PlanStates);
                _server.SendToSingle(m, ident.Name);
            }

            // send the full list of app states
            {
                var m = new Net.AppsStateMessage(_allAppStates.AppStates, DateTime.UtcNow);
                _server.SendToSingle(m, ident.Name);
            }

            // send the full list of app defs
            {
                var m = new Net.AppDefsMessage(_allAppDefs.AppDefs.Values, incremental: false);
                _server.SendToSingle(m, ident.Name);
            }

            // send the full list of scripts
            {
                var m = new Net.ScriptDefsMessage(from p in _scripts.Scripts.Values select p.Def, incremental: false);
                _server.SendToSingle(m, ident.Name);
            }

            // send the full list of script states
            {
                var m = new Net.ScriptStateMessage(_scripts.ScriptStates);
                _server.SendToSingle(m, ident.Name);
            }
        }