// Copyright (C) 2013, 2014, 2015 Kazuhiro Fujieda <fujieda@users.osdn.me>\r
// \r
-// This program is part of KancolleSniffer.\r
+// Licensed under the Apache License, Version 2.0 (the "License");\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
//\r
-// KancolleSniffer is free software: you can redistribute it and/or modify\r
-// it under the terms of the GNU General Public License as published by\r
-// the Free Software Foundation, either version 3 of the License, or\r
-// (at your option) any later version.\r
+// http://www.apache.org/licenses/LICENSE-2.0\r
//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-// GNU General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, see <http://www.gnu.org/licenses/>.\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
\r
using System;\r
using System.Collections.Generic;\r
{\r
if (!json.api_result())\r
return Update.Error;\r
- var r = (int)json.api_result;\r
- if (r != 1)\r
- return r == 201 ? Update.None : Update.Error;\r
+ if ((int)json.api_result != 1)\r
+ return Update.None;\r
var data = json.api_data() ? json.api_data : new object();\r
\r
if (url.EndsWith("api_start2"))\r
{\r
var data = json.api_data() ? json.api_data : new object();\r
\r
+ if (url.EndsWith("api_get_member/require_info"))\r
+ {\r
+ _itemInfo.InspectSlotItem(data.api_slot_item, true);\r
+ _dockInfo.InspectKDock(data.api_kdock);\r
+ return Update.Timer;\r
+ }\r
if (url.EndsWith("api_get_member/basic"))\r
{\r
_itemInfo.InspectBasic(data);\r
if (url.EndsWith("api_get_member/slot_item"))\r
{\r
_itemInfo.InspectSlotItem(data, true);\r
- return Update.None;\r
+ return Update.Item;\r
}\r
if (url.EndsWith("api_get_member/kdock"))\r
{\r
}\r
if (url.EndsWith("api_get_member/questlist"))\r
{\r
- _questInfo.Inspect(data);\r
+ _questInfo.InspectQuestList(data);\r
return Update.QuestList;\r
}\r
if (url.EndsWith("api_get_member/deck"))\r
{\r
if (IsNormalBattleAPI(url))\r
{\r
- _battleInfo.InspectBattle(data);\r
+ _battleInfo.InspectBattle(data, url);\r
_logger.InspectBattle(data);\r
return Update.Ship | Update.Battle;\r
}\r
_conditionTimer.InvalidateCond();\r
_miscTextInfo.ClearFlag = true;\r
}\r
- _battleInfo.InspectBattle(data);\r
+ _battleInfo.InspectBattle(data, url);\r
return Update.Ship | Update.Battle | Update.Timer;\r
}\r
if (url.EndsWith("api_req_sortie/battleresult"))\r
}\r
if (IsCombinedBattleAPI(url))\r
{\r
- _battleInfo.InspectCombinedBattle(data, url.EndsWith("battle_water"));\r
+ _battleInfo.InspectCombinedBattle(data, url);\r
_logger.InspectBattle(data);\r
return Update.Ship | Update.Battle;\r
}\r
{\r
return url.EndsWith("api_req_sortie/battle") ||\r
url.EndsWith("api_req_sortie/airbattle") ||\r
+ url.EndsWith("api_req_sortie/ld_airbattle") ||\r
url.EndsWith("api_req_battle_midnight/battle") ||\r
url.EndsWith("api_req_battle_midnight/sp_midnight");\r
}\r
{\r
return url.EndsWith("api_req_combined_battle/battle") ||\r
url.EndsWith("api_req_combined_battle/airbattle") ||\r
+ url.EndsWith("api_req_combined_battle/ld_airbattle") ||\r
url.EndsWith("api_req_combined_battle/battle_water") ||\r
url.EndsWith("api_req_combined_battle/midnight_battle") ||\r
url.EndsWith("api_req_combined_battle/sp_midnight");\r
_shipInfo.InspectSlotExchange(request, data);\r
return Update.Ship;\r
}\r
+ if (url.EndsWith("api_req_kaisou/slot_deprive"))\r
+ {\r
+ _shipInfo.InspectSlotDeprive(data);\r
+ return Update.Ship;\r
+ }\r
if (url.EndsWith("api_req_nyukyo/start"))\r
{\r
_dockInfo.InspectNyukyo(request);\r
}\r
if (url.EndsWith("api_req_map/next"))\r
{\r
+ _battleInfo.InspectMapNext(request);\r
_exMapInfo.InspectMapNext(data);\r
_logger.InspectMapNext(data);\r
return Update.None;\r
_logger.InspectMissionResult(data);\r
return Update.Item;\r
}\r
+ if (url.EndsWith("api_req_quest/stop"))\r
+ {\r
+ _questInfo.InspectStop(request);\r
+ return Update.QuestList;\r
+ }\r
+ if (url.EndsWith("api_req_quest/clearitemget"))\r
+ {\r
+ _questInfo.InspectClearItemGet(request);\r
+ return Update.QuestList;\r
+ }\r
+ if (url.EndsWith("api_req_air_corps/supply"))\r
+ {\r
+ _materialInfo.InspectAirCorpsSupply(data);\r
+ return Update.Item;\r
+ }\r
+ if (url.EndsWith("api_req_air_corps/set_plane"))\r
+ {\r
+ _materialInfo.InspectAirCorpsSetPlane(data);\r
+ return Update.Item;\r
+ }\r
return Update.None;\r
}\r
\r
\r
public int[] GetFighterPower(int fleet) => _shipInfo.GetFighterPower(fleet);\r
\r
+ public double GetContactTriggerRate(int fleet) => _shipInfo.GetContactTriggerRate(fleet);\r
+\r
public double GetFleetLineOfSights(int fleet) => _shipInfo.GetLineOfSights(fleet);\r
\r
public ShipStatus[] DamagedShipList => _shipInfo.GetDamagedShipList(_dockInfo);\r
if (prev > _spare && _spare >= Rest)\r
NeedRing = true;\r
}\r
+\r
+ public string ToString(bool finish = false)\r
+ => EndTime == DateTime.MinValue\r
+ ? ""\r
+ : finish ? EndTime.ToString(@"dd\ HH\:mm") : $@"{(int)Rest.TotalHours:d2}:{Rest:mm\:ss}";\r
}\r
}
\ No newline at end of file