public static void reportGotShip(GetBattleResultResponse battleResult, int battle_fleetid, string level, string nodeflag) { System.Threading.ThreadPool.QueueUserWorkItem(delegate { do_reportGotShip(battleResult, battle_fleetid, level, nodeflag); }, null); }
private static void do_reportGotShip(GetBattleResultResponse battleResult, int battle_fleetid, string level, string nodeflag) { if (battleResult == null || battleResult.newShipVO == null || battleResult.newShipVO.Length == 0) { return; } var dic = new Dictionary <string, string>(); string desc = ""; UserShip flagship = GameData.instance.GetShipById(GameData.instance.UserFleets[battle_fleetid - 1].ships[0]); foreach (UserShip us in battleResult.newShipVO) { desc += level + "|" + nodeflag + "|" + us.ship.cid + "|" + us.ship.title + "|" + us.ship.star + "|" + ServerTimer.GetNowServerTime() + "|" + z.instance.getServerName() + "|" + flagship.level + "|" + flagship.ship.cid + "|" + flagship.ship.luck + "|" + flagship.ship.star + "|" + flagship.ship.title + "|" + (WarResultLevel)battleResult.warResult.resultLevel + "|" + battleResult.bossHpLeft + "|" + GameData.instance.UserInfo.detailInfo.collection + "|" + GameData.instance.UserInfo.level + "\r\n"; } dic["msg"] = desc; var c = new System.Net.Http.FormUrlEncodedContent(dic); try { var p = new System.Net.Http.HttpClient(); var r = p.PostAsync(tools.helper.count_server_addr + "/sssgbsssgb/reportdrop", c).Result; } catch (Exception) { } }
private void onReqGetBattleResultSuccess(BaseWWWRequest obj) { try { this.battleResult = new JsonFx.Json.JsonReader().Read <GetBattleResultResponse>(this.UTF8String); base.responseData = this.battleResult; if (this.battleResult.eid != 0) { this.onReqGetBattleResultFail(obj); } else { if (this.battleResult.shipVO != null) { foreach (UserShip ship in this.battleResult.shipVO) { GameData.instance.UpdateUserShip(ship); } } if ((this.battleResult.newShipVO != null) && (this.battleResult.newShipVO.Length > 0)) { CurrentWarParameters.newShipsGotFromWar = this.battleResult.newShipVO; foreach (UserShip ship2 in this.battleResult.newShipVO) { GameData.instance.AddUserShip(ship2); } } if (this.battleResult.detailInfo != null) { GameData.instance.UserInfo.UpdateDetailInfo(this.battleResult.detailInfo); } if (this.battleResult.campaignVo != null) { if (this.battleResult.campaignVo.canCampaignChallengeLevel != null) { GameData.instance.SetOpenedPVECampaignLevels(this.battleResult.campaignVo.canCampaignChallengeLevel); } if (this.battleResult.campaignVo.campaignChallenge != null) { GameData.instance.SetCampaignChapterTimesInfo(this.battleResult.campaignVo.campaignChallenge); } if (this.battleResult.campaignVo.passInfo != null) { GameData.instance.TotalCampainInfo = this.battleResult.campaignVo.passInfo; } } if (this.battleResult.warResult != null) { this.CheckUserNewExpInfo(this.battleResult.warResult.userLevelVo); } this.HandleNewPveData(this.battleResult.newPveData); this.OnGetBattleResultSuccess(EventArgs.Empty); } } catch (Exception exception) { z.log(exception.Message); this.onReqGetBattleResultFail(obj); } }
internal static string getDetailNightWarresultstring(GetBattleResultResponse battleResult, int fleetid) { UserFleet uf = GameData.instance.GetFleetOfId(fleetid); string r = ""; if (battleResult.extraProgress != null && CurrentWarParameters.daybattleresult != null) { var ep = battleResult.extraProgress; var dep = CurrentWarParameters.daybattleresult.warReport; r += "夜战 - " + uf.title + " 对战 敌 - " + ep.enemyName + "\r\n"; if (ep.nightAttacks != null) { r += " 夜战:\r\n"; r += getDetailWarBattleParam(ep.nightAttacks, uf, dep.enemyShips); } if (ep.bossHp > 0) { r += " Boss HP: " + ep.bossHpLeft + "/" + ep.bossHp + "\r\n"; } } return r; }
internal static string getwarresultstring(GetBattleResultResponse battleResult, int fleetid) { UserFleet uf = GameData.instance.GetFleetOfId(fleetid); string r = ""; if(battleResult.warResult == null) { return ("这里的海面静悄悄,什么都没有发生... 大概?"); } r += (WarResultLevel)battleResult.warResult.resultLevel + "胜 ,"; if (battleResult.newShipVO != null) { foreach(var ns in battleResult.newShipVO) { r+=" 发现新少女 -- "+ ns.ship.title + " " + ns.ship.titleClass; } } int enemycount = 0; int i = 0; r += "\r\n"; if (battleResult.warResult.selfShipResults != null && battleResult.warResult.selfShipResults.Length > 0 && battleResult.warResult.enemyShipResults != null && battleResult.warResult.enemyShipResults.Length > 0 && CurrentWarParameters.shipsbeforebattle.Length >0 ) { for (int index = 0; index < battleResult.warResult.selfShipResults.Length ;index++ ) { if(battleResult.warResult.selfShipResults.Length > index) { var v = battleResult.warResult.selfShipResults[index]; UserShip us = GameData.instance.GetShipById(uf.ships[index]); UserShip bus = CurrentWarParameters.shipsbeforebattle[index]; r += (v.isMvp == 1 ? "MVP " : " ") + us.ship.title + "\t\t Lv." + us.level + (v.isLevelUp == 1 ? "↑" : "") + "\t(+" + v.expAdd + ")/" + v.nextLevelExpNeed + "\tHP: " + us.battleProps.hp + "/" + us.battlePropsMax.hp + "\t 油:" + us.battleProps.oil + "(" + (us.battleProps.oil - bus.battleProps.oil) + ")" + "\t 弹:" + us.battleProps.ammo + "(" + (us.battleProps.ammo - bus.battleProps.ammo) + ")" + " \r\n"; } } } return r; }
private void onReqGetBattleResultSuccess(BaseWWWRequest obj) { try { this.battleResult = new JsonFx.Json.JsonReader().Read<GetBattleResultResponse>(this.UTF8String); base.responseData = this.battleResult; if (this.battleResult.eid != 0) { this.onReqGetBattleResultFail(obj); } else { if (this.battleResult.shipVO != null) { foreach (UserShip ship in this.battleResult.shipVO) { GameData.instance.UpdateUserShip(ship); } } if ((this.battleResult.newShipVO != null) && (this.battleResult.newShipVO.Length > 0)) { CurrentWarParameters.newShipsGotFromWar = this.battleResult.newShipVO; foreach (UserShip ship2 in this.battleResult.newShipVO) { GameData.instance.AddUserShip(ship2); } } if (this.battleResult.detailInfo != null) { GameData.instance.UserInfo.UpdateDetailInfo(this.battleResult.detailInfo); } if (this.battleResult.campaignVo != null) { if (this.battleResult.campaignVo.canCampaignChallengeLevel != null) { GameData.instance.SetOpenedPVECampaignLevels(this.battleResult.campaignVo.canCampaignChallengeLevel); } if (this.battleResult.campaignVo.campaignChallenge != null) { GameData.instance.SetCampaignChapterTimesInfo(this.battleResult.campaignVo.campaignChallenge); } if (this.battleResult.campaignVo.passInfo != null) { GameData.instance.TotalCampainInfo = this.battleResult.campaignVo.passInfo; } } if (this.battleResult.warResult != null) { this.CheckUserNewExpInfo(this.battleResult.warResult.userLevelVo); } this.HandleNewPveData(this.battleResult.newPveData); this.OnGetBattleResultSuccess(EventArgs.Empty); } } catch (Exception exception) { z.log(exception.Message); this.onReqGetBattleResultFail(obj); } }
private static void do_reportGotShip(GetBattleResultResponse battleResult, int battle_fleetid, string level, string nodeflag) { if(battleResult == null || battleResult.newShipVO == null || battleResult.newShipVO.Length ==0) { return; } var dic = new Dictionary<string, string>(); string desc = ""; UserShip flagship = GameData.instance.GetShipById(GameData.instance.UserFleets[battle_fleetid -1].ships[0]); foreach(UserShip us in battleResult.newShipVO) { desc += level + "|" + nodeflag + "|" + us.ship.cid + "|" + us.ship.title + "|" + us.ship.star + "|" + ServerTimer.GetNowServerTime() + "|" + z.instance.getServerName() + "|" + flagship.level + "|" + flagship.ship.cid + "|" + flagship.ship.luck + "|" + flagship.ship.star + "|" + flagship.ship.title + "|" + (WarResultLevel)battleResult.warResult.resultLevel + "|" + battleResult.bossHpLeft + "|" + GameData.instance.UserInfo.detailInfo.collection + "|" + GameData.instance.UserInfo.level + "\r\n"; } dic["msg"] = desc; var c = new System.Net.Http.FormUrlEncodedContent(dic); try { var p = new System.Net.Http.HttpClient(); var r = p.PostAsync(tools.helper.count_server_addr + "/sssgbsssgb/reportdrop", c).Result; } catch (Exception) { } }