Esempio n. 1
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        private async void GetUserInfo()
        {
            try
            {
                Gamer           user     = GameTools.GetUser();
                G2C_GetUserInfo userinfo =
                    await SessionComponent.Instance.Session.Call(new C2G_GetUserInfo()
                {
                    UserID = GameTools.GetUserID()
                }) as G2C_GetUserInfo;

                user.Loses    = userinfo.Loses;
                user.Money    = userinfo.Money;
                user.NickName = userinfo.NickName;
                user.Wins     = userinfo.Wins;
                Log.Debug($"{user.NickName} | {user.Money}");

                this.txt_NameSetting.text  = userinfo.NickName;
                this.txt_MoneySetting.text = userinfo.Money.ToString();
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 设置用户信息
        /// </summary>
        /// <param name="id"></param>
        private async void SetUserInfo()
        {
            G2C_GetUserInfo g2C_GetUserInfo = await SessionWrapComponent.Instance.Session.Call(new C2G_GetUserInfo()
            {
                UserID = this.GetParent <Gamer>().UserID
            }) as G2C_GetUserInfo;

            if (this.Panel != null)
            {
                name.text     = g2C_GetUserInfo.NickName;
                GoldText.text = g2C_GetUserInfo.Gold.ToString();
            }
        }
Esempio n. 3
0
        public async void ApplyUserInfo()
        {
            //获取玩家数据
            long            userId          = ClientComponent.Instance.LocalPlayer.UserID;
            C2G_GetUserInfo c2G_GetUserInfo = new C2G_GetUserInfo()
            {
                UserID = userId
            };
            G2C_GetUserInfo g2C_GetUserInfo = await SessionWrapComponent.Instance.Session.Call(c2G_GetUserInfo) as G2C_GetUserInfo;

            //显示用户信息
            nameText.text = g2C_GetUserInfo.NickName;
            goldText.text = g2C_GetUserInfo.Gold.ToString();
        }
        private async ETVoid GetUserInfo()
        {
            G2C_GetUserInfo g2CGetUserInfo = (G2C_GetUserInfo)await Game.Scene.GetComponent <SessionComponent>().Session
                                             .Call(new C2G_GetUserInfo()
            {
                PlayerId = ETModel.Game.Scene.GetComponent <PlayerComponent>().MyPlayer.Id
            });

            FUILobby fuiLobby = (FUILobby)Game.Scene.GetComponent <FUIComponent>().Get(FUIPackage.FUILobby);

            fuiLobby.userName.text     = g2CGetUserInfo.UserName;
            fuiLobby.UserLevel.text    = "Lv " + g2CGetUserInfo.Level;
            fuiLobby.m_goldenInfo.text = g2CGetUserInfo.Goldens.ToString();
            fuiLobby.m_pointInfo.text  = g2CGetUserInfo.Point.ToString();
            fuiLobby.m_gemInfo.text    = g2CGetUserInfo.Diamods.ToString();

            Game.EventSystem.Run(EventIdType.LobbyUIAllDataLoadComplete);
        }