Ejemplo n.º 1
0
 public void Login(ICSharpServerSession session,dynamic msg)
 {
     string appkey = msg.Appkey;
     string appInstanceId = msg.AppInstanceId;
     var response = new
     {
         IsValidate = true
     };
     session.RegistUser(new ChicagoUser());
     this.SendJsonResponse(session, response, ExtensionName, "Login");
 }
Ejemplo n.º 2
0
 public void ClientBeat(ICSharpServerSession session, dynamic msg)
 {
     this.SendJsonResponse(session, new { smile = ":)" }, ExtensionName, "Beat");
 }
Ejemplo n.º 3
0
 public void Logout(ICSharpServerSession session, dynamic msg)
 {
 }
Ejemplo n.º 4
0
 public void Logout(ICSharpServerSession session, dynamic msg)
 {
     string appToken = msg.AppToken;
     string appkey = msg.Appkey;
     string userId = msg.UserId;
     var user = session.User as BahamutAppUser;
     if (NotificaionCenterExtension.Instance.RemoveUser(user))
     {
         LogManager.GetLogger("Info").Info("Logout Success:{0}", userId);
         this.CloseSession(session);
     }
     else
     {
         LogManager.GetLogger("Info").Info("Logout Failed:{0}", userId);
     }
 }
Ejemplo n.º 5
0
 public void Login(ICSharpServerSession session, dynamic msg)
 {
     string appToken = msg.AppToken;
     string appkey = msg.Appkey;
     string userId = msg.UserId;
     Task.Run(async () =>
     {
         var result = await ChicagoServer.TokenService.ValidateAppTokenAsync(appkey, userId, appToken);
         if (result != null)
         {
             var sharelinker = new BahamutAppUser()
             {
                 Session = session,
                 UserData = result,
                 IsOnline = true
             };
             session.RegistUser(sharelinker);
             this.SendJsonResponse(session, new { IsValidate = "true" }, ExtensionName, "Login");
             LogManager.GetLogger("Info").Info("Login Success:{0}", userId);
             NotificaionCenterExtension.Instance.RegistUser(result.UserId, session);
         }
         else
         {
             LogManager.GetLogger("Info").Info("Login Failed:{0}", userId);
             this.SendJsonResponse(session, new { IsValidate = "false" }, ExtensionName, "Login");
         }
     });
 }
 public void RegistUser(string userId, ICSharpServerSession session)
 {
     //userManager.RegistUser(userId, session, this);
 }
        public void RegistDeviceToken(ICSharpServerSession session, dynamic msg)
        {
            var appUser = session.User as BahamutAppUser;

            var dt = new DeviceToken
            {
                Token = msg.DeviceToken,
                Type = msg.DeviceType
            };
            Task.Run(async () =>
            {
                await userManager.UpdateUserDeviceTokenAynce(appUser, dt);
            });
        }