/// <summary> /// 更新用户数据 /// </summary> /// <param name="bytes"></param> private void GetUserInfoResponse(byte[] bytes) { GetUserInfoS2C package = NetMgr.Instance.DeSerializes <GetUserInfoS2C>(bytes); this.UserInfo.UserName = package.userName; foreach (UserItem item in package.userItems) { if (!this.UserInfo.UserItems.ContainsKey(item.type)) { this.UserInfo.UserItems.Add(item.type, item); } else { this.UserInfo.UserItems[item.type] = item; } } this.UserInfo.ShowID = package.showId; //string ip = package.ip; //ip = ip.Substring(0, ip.Length - 5); //ip = ip.Replace("/", ""); this.UserInfo.LocalIP = package.ip; this.UserInfo.HeadIconUrl = package.imageUrl; this.UserInfo.Sex = package.sex; this.UserInfo.BoundAgency = package.boundAgency; }
/// <summary> /// 更新用户数据 /// </summary> /// <param name="bytes"></param> private void GetUserInfoResponse(byte[] bytes) { GetUserInfoS2C package = NetMgr.Instance.DeSerializes <GetUserInfoS2C>(bytes); this.userName = package.userName; foreach (UserItem item in package.userItems) { if (!this.userItems.ContainsKey(item.type)) { this.userItems.Add(item.type, item); } else { var hallProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy; if (item.amount > this.userItems[item.type].amount && hallProxy.orderTimeId > 0) { DialogMsgVO dialogMsgVO = new DialogMsgVO(); dialogMsgVO.title = "充值提示"; dialogMsgVO.content = "充值成功"; dialogMsgVO.dialogType = DialogType.ALERT; DialogView dialogView = UIManager.Instance.ShowUI(UIViewID.DIALOG_VIEW) as DialogView; dialogView.data = dialogMsgVO; Timer.Instance.CancelTimer(hallProxy.orderTimeId); hallProxy.orderTimeId = 0; } this.userItems[item.type] = item; } } this.showID = package.showId; //string ip = package.ip; //ip = ip.Substring(0, ip.Length - 5); //ip = ip.Replace("/", ""); this.localIP = package.ip; this.headIconUrl = package.imageUrl; this.sex = package.sex; this.boundAgency = package.boundAgency; SendNotification(NotificationConstant.MEDI_HALL_REFRESHUSERINFO); }