Example #1
0
 private void LoginResponse(Protocol.LoginResponse e)
 {
     if (e.Success)
     {
         Protocol.ListRoom listroom = new Protocol.ListRoom();
         mClient.Send(listroom);
         mIsLogin = e.Success;
     }
 }
Example #2
0
 protected override void OnExecute(Protocol.Login message, EC.ISession session, Interfaces.IUserAgent agent, Interfaces.ISiqiServer server)
 {
     Protocol.LoginResponse response = new Protocol.LoginResponse();
     response.MsgID   = message.MsgID;
     response.Success = false;
     try
     {
         Interfaces.Data.Model.User user = server.LoginHandler.Login(message.EMail, message.Password);
         if (user != null)
         {
             agent = server.GetUser(message.EMail);
             if (agent == null)
             {
                 agent = new UserAgent(user, session);
                 server.AddUser(agent);
             }
             else
             {
                 agent.Session = session;
             }
             session[SESSION_KEY.USER] = agent;
             response.Tokey            = message.EMail;
             response.Success          = true;
             session.Channel.Status    = Beetle.Express.ChannelStatus.security;
         }
         else
         {
             response.Message = "用户名和密码不正确!";
         }
     }
     catch (Exception e_)
     {
         response.Message = e_.Message;
     }
     server.Send(response, session);
 }