Beispiel #1
0
        public void InitData(UserLoginRes userLoginRes, UserDepartmentPB userDepartmentPb)
        {
            CreateTime       = userLoginRes.User.CreateTime;
            Level            = userDepartmentPb.Level;
            Exp              = userDepartmentPb.Exp;
            Gold             = userLoginRes.UserMoney.Gold;
            Gem              = userLoginRes.UserMoney.Gem;
            LogoId           = userLoginRes.User.Logo;
            AccountId        = userLoginRes.User.AccountId;
            ChannelAccountId = userLoginRes.User.ChannelAccountId;
            Index            = userLoginRes.User.Index;
            UserId           = userLoginRes.User.UserId;
            UserName         = userLoginRes.User.UserName;

            Apparel = userLoginRes.User.Apparel;

            Birthday = userLoginRes.User.Birthday;
            //HasGetFreeGemGift = false;


            NpcId = (Apparel[0] / 100) % 10;

            Energy     = userLoginRes.UserPower.Energy;
            EnergyTime = userLoginRes.UserPower.EnergyTime;

            EncourageEnergy     = userLoginRes.UserPower.EncourageEnergy;
            EncourageEnergyTime = userLoginRes.UserPower.EncourageEnergyTime;

            RecollectionEnergy     = userLoginRes.UserPower.MemoriesEnergy;
            RecollectionEnergyTime = userLoginRes.UserPower.MemoriesEnergyTime;


            //获取购买金币次数
            GoldNum = userLoginRes.UserBuyGemInfo.GoldNum;


            //获取购买体力次数
            PowerNum = userLoginRes.UserBuyGemInfo.PowerNum;


            //购买应援体力次数
            EncourageNum = userLoginRes.UserBuyGemInfo.EncourageNum;

            FirstRecharges = userLoginRes.FirstRecharge;
            UserMonthCard  = userLoginRes.UserMonthCard;

            ExtInfo = userLoginRes.UserExtraInfo;
            //            var pushDic = new Dictionary<string, string>();
            //            pushDic.Add((ClientTimer.Instance.GetCurrentTimeStamp()+86400000).ToString(),I18NManager.Get("Push_HintOldPlayer"));
            //

            UserOther = userLoginRes.User.UserOther;


            SdkHelper.PushAgent.InitPushData();
            SdkHelper.PushAgent.Refeash();
        }
Beispiel #2
0
 void HandleUserLoginRes(UserLoginRes msg)
 {
     if (msg.Res == 0)
     {
         Log.Info("User {0}, login succ.", new Guid(msg.UserId));
     }
     else
     {
         Log.Info("User {0}, login failed!", new Guid(msg.UserId));
     }
 }
Beispiel #3
0
        private void OnUserLogin(UserLoginRes res)
        {
            //登陆状态不再走登陆流程
            if (SdkHelper.AccountAgent.IsLogin)
            {
                BuglyAgent.ReportException("OnUserLogin", "SdkHelper.AccountAgent.IsLogin=true", "none");
                return;
            }

            SdkHelper.AccountAgent.IsLogin      = true;
            GlobalData.PlayerModel.UserLoginRes = res;
            SendMessage(new Message(MessageConst.CMD_LOGIN_LOAD_DATA));
        }
Beispiel #4
0
        async Task <byte[]> HandleUserLoginReq(byte[] msg)
        {
            var req = ProtoUtil.Deserialize <UserLoginReq>(msg);

            //todo

            var res = new UserLoginRes
            {
                Res    = 0,
                UserId = Guid.NewGuid().ToByteArray()
            };

            return(ProtoUtil.Serialize(res));
        }
Beispiel #5
0
 public static void PlayerAccountLogin(UserLoginRes ret)
 {
     if (ret.errcode == 0)
     {
         PlayerManager.info = ret.info;
         if (UIManager.Instance == null)
         {
             TcpNet.Instance.send_proto_msg_to_client((int)Stype.System, (int)Cmd.eGetPlayerDataReq, null);//向系统服务器获取数据
         }
         else
         {
             PlayerReLoginPanel.Instance.Close();
         }
     }
     else
     {
         string  ErrTips = ErrCodeConfig.GetTipsById(ret.errcode);
         PopItem item    = UIManager.AddItem <PopItem>("PopItem", UIManager.PopPanelRoot);
         if (!string.IsNullOrEmpty(ErrTips))
         {
             item.SetTips(ErrTips);
         }
     }
 }