Exemple #1
0
        private static void OnRegistry(MsgBase msgBase)
        {
            MsgRegistry msgRegistry = (MsgRegistry)msgBase;
            LoginScence loginScence = ContainerBuilder.Resolve <LoginScence>();

            Console.WriteLine(msgRegistry.result);
            loginScence.IsResgistoryCallBack = true;
        }
Exemple #2
0
        public static User FromMsg(MsgRegistry msg)
        {
            User user = new User();

            user.Password = msg.password;
            user.Username = msg.username;
            return(user);
        }
Exemple #3
0
        public static void MsgRegistry(ClientState c, MsgBase msg)
        {
            Debug.WriteLine("MsgRegistry");
            MsgRegistry msgResgistory = (MsgRegistry)msg;
            User        user          = UserWrapper.FromMsg(msgResgistory);

            bool checkOut = UserManager.Check(user, out msgResgistory.result);

            if (!checkOut)
            {
                msgResgistory.code = HttpStatusCode.InternalServerError;
                NetManager.Send(c, msgResgistory);
            }
            else
            {
                user.Score  = 0;
                user.Userid = UUIDUtils.GetUUID();
                UserManager.Add(user);
                msgResgistory.code   = HttpStatusCode.OK;
                msgResgistory.result = "注册成功";
                NetManager.Send(c, msgResgistory);
            }
        }