Beispiel #1
0
        /// <summary>
        /// 类型:方法
        /// 名称:OnLoginButtonDown
        /// 作者:taixihuase
        /// 作用:当按下登录按钮时触发登录事件,将登录信息发送给服务端
        /// 编写日期:2015/7/17
        /// </summary>
        public void OnRegistButtonDown()
        {
            if (PhotonSingleton.Service.ServerConnected)
            {

                    var info = new RegistInfo(Account.text, "1234", Password.text);

                    byte[] data = Serialization.Serialize(info);
                    var parameter = new Dictionary<byte, object>
                    {
                        {(byte) ParameterCode.Regist, data}
                    };

                    PhotonSingleton.Service.Peer.OpCustom((byte)OperationCode.Regist, parameter, true);
            }
        }
 /// <summary>
 /// 类型:方法
 /// 名称:RegistUser
 /// 作者:taixihuase
 /// 作用:注册一个新的用户
 /// 编写日期:2015/8/26
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 public UserReturn RegistUser(RegistInfo info)
 {
     return Server.Data.UserData.RegistNewUser(info);
 }
Beispiel #3
0
        public UserCollection.UserReturn RegistNewUser(RegistInfo info)
        {
            UserCollection.UserReturn userReturn = new UserCollection.UserReturn();

            if (info.Account != "siege" && info.Account != "online" && info.Account != "test")
            {
                if (info.Nickname != "abcd" && info.Nickname != "efgh" && info.Nickname != "test")
                {
                    userReturn.ReturnCode = Default;
                    userReturn.DebugMessage.Append("注册账号成功");
                }
                else
                {
                    userReturn.ReturnCode = NicknameExist;
                    userReturn.DebugMessage.Append("昵称已被使用");
                }
            }
            else
            {
                userReturn.ReturnCode = AccountExist;
                userReturn.DebugMessage.Append("账号名已存在");
            }

            return userReturn;
        }