private void UpdateUserDataAfterGetTimeAward(recvGetTimeAward pkg) { this.root.userData.userTimeAward.timerId = pkg.userData.userTimeAward.timerId; this.root.userData.userTimeAward.nowItemId = pkg.userData.userTimeAward.nowItemId; this.root.userData.userTimeAward.nextItemId = pkg.userData.userTimeAward.nextItemId; this.root.userData.userTimeAward.lastModify = pkg.userData.userTimeAward.lastModify; this.root.userData.userTimeAward.dayReceiveTimes = pkg.userData.userTimeAward.dayReceiveTimes; foreach (entityUserItem item in pkg.userData.userItem) { upCall.DebugLog("在线礼包 - 获得物品:" + QueryManager.gGameDB.ItemDesc(item.typeId, item.number)); } // 更新基础信息 RefreshBase((recvPkgBase)pkg); }
public void ParseUserGetTimeAward(byte[] bs_result) { upCall.Print("ParseUserGetTimeAward", bs_result); Dictionary<string, object> dic_root = upCall.GetRootDic(bs_result); if (CheckForException(dic_root)) { return; } recvGetTimeAward pkg = new recvGetTimeAward(); upCall.SetSingleObject(dic_root, null, pkg); if (!dic_root.ContainsKey("userData")) { upCall.DebugLog("dic_root不存在userData键值"); return; } Dictionary<string, object> dic_userData = (Dictionary<string, object>) dic_root["userData"]; upCall.SetSingleObject(dic_userData, "userTimeAward", pkg.userData.userTimeAward); upCall.SetArrayObjects(dic_userData, "userItem", pkg.userData.userItem); upCall.SetArrayObjects(dic_userData, "userSoul", pkg.userData.userSoul); upCall.SetArrayObjects(dic_userData, "userEquip", pkg.userData.userEquip); // 同步在线礼包数据和物品数据 UpdateUserDataAfterGetTimeAward(pkg); // 更新UI显示 upCall.UIUpdateRefreshGeneral(); }