public override JsonData GetJsonData() { JsonData ret = new JsonData() { [ServerTimeDataKey.LOCAL_TIME_SPAN] = localTimeSpan, [ServerTimeDataKey.REFRESH_TIME_ONE_DAY] = PTUtil.DateTime2Timestamp(refreshTime_OneDay), [ServerTimeDataKey.REFRESH_TIME_TWO_DAY] = PTUtil.DateTime2Timestamp(refreshTime_TwoDay), [ServerTimeDataKey.REFRESH_TIME_ONE_WEEK] = PTUtil.DateTime2Timestamp(refreshTime_OneWeek), }; return(ret); }
public override JsonData GetJsonData() { JsonData ret = new JsonData() { [CampsiteDataKey.ID] = id, [CampsiteDataKey.TOTAL_REWARD_VAL] = totalRewardVal, [CampsiteDataKey.LAST_RECORD_TIME] = PTUtil.DateTime2Timestamp(lastRecordTime), [CampsiteDataKey.HAS_OFFLINE_REWARD] = hasOfflineReward, }; JsonData pointsJsonArr = new JsonData(); pointsJsonArr.SetJsonType(JsonType.Array); for (int i = 0; i < points.Length; i++) { pointsJsonArr.Add(points[i].GetJsonData()); } ret[CampsiteDataKey.POINTS] = pointsJsonArr; return(ret); }
public override JsonData GetJsonData() { JsonData ret = new JsonData() { [PlayerDataKey.GUID] = guid.ToString(), [PlayerDataKey.CREATE_TIME] = PTUtil.DateTime2Timestamp(createTime), [PlayerDataKey.REFRESH_TIME] = PTUtil.DateTime2Timestamp(refreshTime), [PlayerDataKey.CUR_GUIDE_ID] = curGuideID, [PlayerDataKey.CUR_STAGE_ID] = curStageID, [PlayerDataKey.MAX_UNLOCK_STAGE_ID] = maxUnlockStageID, [PlayerDataKey.CUR_GUIDE_STAGE_INDEX] = curGuideStageIndex, [PlayerDataKey.CUR_BOX_ID] = curBoxID, [PlayerDataKey.USE_WEAPON_ID] = useWeaponID, [PlayerDataKey.CURRENCY_DIAMOND] = currencys[CurrencyType.DIAMOND], [PlayerDataKey.CURRENCY_GOLD] = bigCurrencys[CurrencyType.GOLD].ToString(), [PlayerDataKey.CURRENCY_KEY] = currencys[CurrencyType.KEY], [PlayerDataKey.BOXDRAWCOUNT] = boxDrawCount, [PlayerDataKey.LEVEL] = level, [PlayerDataKey.CAMPTASKDATA] = campTaskData.GetJsonData(), [PlayerDataKey.IDLE_REWARD_DATA] = idleRewardData.GetJsonData(), [PlayerDataKey.SHOP_DATA] = shopData.GetJsonData(), [PlayerDataKey.CHAPTERDATA] = chapterData.GetJsonData(), }; if (serverTimeData != null) { ret[PlayerDataKey.SERVER_TIME_DATA] = serverTimeData.GetJsonData(); } //JsonData currencysJson = new JsonData(); //currencysJson.SetJsonType(JsonType.Array); //foreach (var key in currencys.Keys) //{ // currencysJson[key.ToString()] = currencys[key]; //} //ret[PlayerDataKey.CURRENCYS] = currencysJson; //JsonData currencyRegtimesJson = new JsonData(); //currencyRegtimesJson.SetJsonType(JsonType.Array); //foreach (var key in currencyRegtimes.Keys) //{ // currencyRegtimesJson[key.ToString()] = currencyRegtimes[key].ToString(); //} //ret[PlayerDataKey.CURRENCY_REGTIMES] = currencyRegtimesJson; JsonData stageDatasJson = new JsonData(); stageDatasJson.SetJsonType(JsonType.Array); foreach (var key in stageDatas.Keys) { stageDatasJson.Add(stageDatas[key].GetJsonData()); } ret[PlayerDataKey.STAGE_DATAS] = stageDatasJson; JsonData cardDatasJson = new JsonData(); cardDatasJson.SetJsonType(JsonType.Array); foreach (var key in cardDatas.Keys) { cardDatasJson.Add(cardDatas[key].GetJsonData()); } ret[PlayerDataKey.CARD_DATAS] = cardDatasJson; JsonData fusedCardListJson = new JsonData(); fusedCardListJson.SetJsonType(JsonType.Array); foreach (var value in fusedCardList) { fusedCardListJson.Add(value); } ret[PlayerDataKey.FUSED_CARD_LIST] = fusedCardListJson; if (campsiteData != null) { ret[PlayerDataKey.CAMPSITEDATA] = campsiteData.GetJsonData(); } if (boxDrawDic.Count > 0) { JsonData boxDrawDicJson = new JsonData(); //stageDatasJson.SetJsonType(JsonType.Array); foreach (var item in boxDrawDic) { boxDrawDicJson[item.Key.ToString()] = item.Value; } ret[PlayerDataKey.BOXDRAWDIC] = boxDrawDicJson; } if (openModules.Count > 0) { JsonData openModulesJson = new JsonData(); openModulesJson.SetJsonType(JsonType.Array); for (int i = 0; i < openModules.Count; i++) { openModulesJson.Add(openModules[i]); } ret[PlayerDataKey.OPEN_MODULES] = openModulesJson; } if (finishDialogueList.Count > 0) { JsonData finishDialogueListJson = new JsonData(); finishDialogueListJson.SetJsonType(JsonType.Array); for (int i = 0; i < finishDialogueList.Count; i++) { finishDialogueListJson.Add(finishDialogueList[i]); } ret[PlayerDataKey.FINISH_DIALOGUE_LIST] = finishDialogueListJson; } return(ret); }