コード例 #1
0
        ///
        /// Base implementation of the sockets
        ///

        public async void OnRegister()
        {
            this.Session = await new AdminSessionDM(this.Context.Database)
            {
                adminid = this.Admin.ID.Value,
                guid    = this.Key
            }.InsertAsync <AdminSessionDM>();

            // init
            DashboardSocketsServer.Send(this, new InitDashboardModel()
            {
                Privileges        = this.Admin.privileges,
                AdminStatus       = this.Admin.GetStatus().ToString(),
                Actions           = ApiSocketServer.ActiveActions,
                DashboardSessions = DashboardSocketsServer.ActiveSessions,
                Countries         = CountryCache.Instance.GetModel(),
                Landers           = LandersCache.Instance.GetLandersModel(),
                LanderTypes       = LandersCache.Instance.GetLanderTypesModel(),
                Prelanders        = PrelandersCache.Instance.GetPrelandersModel(),
                PrelanderTypes    = PrelandersCache.Instance.GetPrelanderTypesModel(),
                Providers         = ProvidersCache.Instance.GetAll()
            }
                                        .Pack(DashboardEvents.INIT));
        }
コード例 #2
0
 public void Send(DashboardSocketDistributionModel data)
 => DashboardSocketsServer.Send(this, data);