Exemplo n.º 1
0
        /// <summary>
        /// 修改资料
        /// </summary>
        /// <param name="unick"></param>
        /// <param name="uface"></param>
        /// <param name="usex"></param>
        public void EditProfile(string unick, int uface, int usex)
        {
            if (unick.Length <= 0)
            {
                return;
            }
            if (uface < 0 || uface > 7)
            {
                return;
            }
            if (usex != 0 && usex != 1)
            {
                return;
            }

            _editProfileReq = new EditProfileReq
            {
                usex = usex, uface = uface, unick = unick
            };

            NetworkMgr.Instance.SendProtobufCmd(
                (int)ServiceType.Auth,
                (int)LoginCmd.eEditProfileReq,
                _editProfileReq);
        }
    public void edit_profile(string unick, int uface, int usex)
    {
        if (unick.Length <= 0)
        {
            return;
        }
        if (uface <= 0 || uface > 9)
        {
            return;
        }
        if (usex != 0 && usex != 1)
        {
            return;
        }

        //提交我们修改资料的请求
        EditProfileReq req = new EditProfileReq();

        req.unick    = unick;
        req.uface    = uface;
        req.usex     = usex;
        this.tmp_req = req;
        Debug.LogError(unick + "  " + uface + "  " + usex);
        network.Instance.send_protobuf_cmd(Stype.Auth, Cmd.eEditProfileReq, req);
        //end
    }
Exemplo n.º 3
0
    public void EditProfile(string unick, int uface, int usex)
    {
        if (unick.Length <= 0)
        {
            return;
        }

        if (uface <= 0 || uface > 9)
        {
            return;
        }
        if (usex != 0 && usex != 1)
        {
            return;
        }
        //提交修改资料的请求
        EditProfileReq req = new EditProfileReq();

        req.unick     = unick;
        req.uface     = uface;
        req.usex      = usex;
        this._tempReq = req;
        network.Instance.SendProtobufCmd((int)Stype.Auth, (int)Cmd
                                         .eEditProfileReq, req);
    }
Exemplo n.º 4
0
    void on_edit_profile_return(cmd_msg msg)
    {
        EditProfileRes res = proto_man.protobuf_deserialize <EditProfileRes>(msg.body);

        if (res == null)
        {
            return;
        }
        if (res.status != Respones.OK)
        {
            Debug.Log("edit profile status: " + res.status);
            return;
        }

        ugame.Instance.save_edit_profile(this.temp_req.unick, this.temp_req.uface, this.temp_req.usex);
        this.temp_req = null;
        event_manager.Instance.dispatch_event("sync_uinfo", null);
    }
Exemplo n.º 5
0
    private void OnEditProfileReturn(cmd_msg msg)
    {
        EditProfileRes res = proto_man
                             .protobuf_deserialize <EditProfileRes>(msg.body);

        if (res == null)
        {
            return;
        }
        if (res.status != Response.OK)
        {
            Debug.Log("Edit Profile status:" + res.status);
            return;
        }
        UGame.Instance.SaveEditProfile(this._tempReq.unick, this
                                       ._tempReq.uface, this._tempReq.usex);
        this._tempReq = null;
        EventManager.Instance.DispatchEvent("sync_uinfo", null);
    }
Exemplo n.º 6
0
        /// <summary>
        /// 修改信息服务器回调
        /// </summary>
        /// <param name="pk"></param>
        private void OnEditProfileReturn(CmdPackageProtocol.CmdPackage pk)
        {
            var res = CmdPackageProtocol.ProtobufDeserialize <EditProfileRes>(pk.body);

            if (null == res)
            {
                Debug.LogError("解码失败");
                return;
            }

            if (res.status != Responce.Ok)
            {
                Debug.LogError("Error Status: " + res.status);
                return;
            }

            Assert.IsNotNull(_editProfileReq);
            NetInfo.SaveEditProfile(_editProfileReq.unick, _editProfileReq.uface, _editProfileReq.usex);
            _editProfileReq = null;
            //通知更新
            CEventCenter.BroadMessage(Message.SyncAuthInfo);
        }
Exemplo n.º 7
0
    public void edit_profile(string unick, int uface, int usex)
    {
        if (unick.Length < 1)
        {
            return;
        }
        if (uface <= 0 || uface > 9)
        {
            return;
        }
        if (usex != 0 && usex != 1)
        {
            return;
        }
        EditProfileReq req = new EditProfileReq();

        req.unick           = unick;
        req.uface           = uface;
        req.usex            = usex;
        this.editProfileReq = req;
        network.Instance.send_protobuf_cmd((int)Stype.Auth, (int)Cmd.eEditProfileReq, req);
    }