Beispiel #1
0
        // ------------------------------------------------------------------------------------------------
        private void UpdateDataAfterGeneralRefresh(recvRefreshGeneral pkg, int type)
        {
            this.root.userData.userTavern.id_1 = pkg.userData.userTavern.id_1;
            this.root.userData.userTavern.id_2 = pkg.userData.userTavern.id_2;
            this.root.userData.userTavern.id_3 = pkg.userData.userTavern.id_3;
            this.root.userData.userTavern.ct = pkg.userData.userTavern.ct;
            this.root.userData.userTavern.nomalRefreshTimes = pkg.userData.userTavern.nomalRefreshTimes;
            this.root.userData.userTavern.nomalRefreshTime = pkg.userData.userTavern.nomalRefreshTime;

            switch (type)
            {
                case 1:
                    this.root.userData.user.tavernCdEndTime_1 = pkg.userData.userTavern.ct + 10 * 60;
                    break;
                case 2:
                    this.root.userData.user.tavernCdEndTime_2 = pkg.userData.userTavern.ct + 24 * 3600;
                    break;
                case 3:
                    this.root.userData.user.tavernCdEndTime_3 = pkg.userData.userTavern.ct + 3 * 24 * 3600;
                    break;
                case 4:
                    this.root.userData.user.tavernCdEndTime_4 = pkg.userData.userTavern.ct + 7 * 24 * 3600;
                    break;
            }

            // 更新基础信息
            RefreshBase((recvPkgBase)pkg);
        }
Beispiel #2
0
        public void ParseRefreshGeneral(byte[] bs_result, CmdOperation cmdOprt)
        {
            upCall.Print("ParseRefreshGeneral", bs_result);
            Dictionary<string, object> dic_root = upCall.GetRootDic(bs_result);
            if (CheckForException(dic_root))
            {
                return;
            }

            recvRefreshGeneral pkg = new recvRefreshGeneral();
            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_root, "userData", pkg.userData);
            upCall.SetSingleObject(dic_userData, "userTavern", pkg.userData.userTavern);
            upCall.SetArrayObjects(dic_userData, "userSoul", pkg.userData.userSoul);

            // 同步到角色数据中
            UpdateDataAfterGeneralRefresh(pkg, cmdOprt.nGenRefType);

            //			PrintTavern();

            // 更新UI显示
            upCall.UIUpdateRefreshGeneral();
        }