Esempio n. 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));
        }
Esempio n. 2
0
 public static void OnActionOffline(ActionDM action)
 => DashboardSocketsServer.SendToAll(new ActionUpdateModel()
 {
     Data = action
 }.Pack(DashboardEvents.ACTION_UPDATE));
Esempio n. 3
0
        ///
        /// ACTIONS
        ///

        public static void OnActionInsert(ActionDM action)
        => DashboardSocketsServer.SendToAll(new ActionUpdateModel()
        {
            Data = action
        }.Pack(DashboardEvents.ACTION_INSERT));
Esempio n. 4
0
 public static void AdminDisconnected(AdminDM admin)
 => DashboardSocketsServer.SendToAll(new AdminDisconnectedModel()
 {
     Username = admin.username
 }
                                     .Pack(DashboardEvents.ADMIN_DISCONNECTED));
Esempio n. 5
0
 public static void ActionDisconnected(string actionid)
 => DashboardSocketsServer.SendToAll(new ActionConnectedDisconnectedModel()
 {
     ID = actionid
 }.Pack(DashboardEvents.ACTION_DISCONNECT));
Esempio n. 6
0
        ///
        /// ACTION CONNECT / DISCONNECT
        ///

        public static void ActionConnected(ActionLiveModel model)
        => DashboardSocketsServer.SendToAll(model.Pack(DashboardEvents.ACTION_CONNECT));
Esempio n. 7
0
        ///
        /// ERRORS
        ///

        public static void OnFatal(string sessionID, string exception)
        => DashboardSocketsServer.SendToAll(new ExceptionModel()
        {
            SessionID = sessionID, Exception = exception
        }.Pack(DashboardEvents.FATAL));
Esempio n. 8
0
 public static void OnNewUpsell(string provider, string actionID)
 => DashboardSocketsServer.SendToAll(new PostbackTransaction()
 {
     ProviderName = provider, ActionID = actionID
 }.Pack(DashboardEvents.POSTBACK_UPSELL));
Esempio n. 9
0
 public static void OnNewChargeback(string provider, string actionID)
 => DashboardSocketsServer.SendToAll(new PostbackTransaction()
 {
     ProviderName = provider, ActionID = actionID
 }.Pack(DashboardEvents.POSTABACK_CHARGEBACK));
Esempio n. 10
0
 public void Send(DashboardSocketDistributionModel data)
 => DashboardSocketsServer.Send(this, data);