Пример #1
0
/*
 * //KC3 리플레이 데이터 예시
 * {
 *      "diff": 0,
 *      "world": 1,
 *      "mapnum": 1,
 *      "fleetnum": 1,
 *      "combined": 0,
 *      "fleet1": [
 *              {
 *                      "mst_id": 399,
 *                      "level": 138,
 *                      "kyouka": [ 9, 48, 0, 14, 6 ],
 *                      "morale": 67,
 *                      "equip": [ 15, 15, 0, 0, 0 ]
 *              }
 *      ],
 *      "support1": 0,
 *      "support2": 0,
 *      "time": 1460983675,
 *      "hq": "8040045",
 *      "id": 3,
 *      "battles": [
 *              {
 *                      "node": 1,
 *                      "data": { },
 *                      "yasen": { },
 *                      "rating": "SS",
 *                      "drop": 44,
 *                      "baseEXP": 30,
 *                      "hqEXP": 10
 *              }
 *      ]
 * }
 */
        private void MapStartNext(start_next startnext, string api_deck_id = null)
        {
            if (api_deck_id != null)
            {
                CurrentDeckId = int.Parse(api_deck_id);
            }

            IsBossCell = startnext.api_event_id == 5;

            #region KC3 리플레이 JSON 작성
            var organization = KanColleClient.Current.Homeport.Organization;
            BattleData = new JObject(
                new JProperty("diff", 0),
                new JProperty("world", startnext.api_maparea_id),
                new JProperty("mapnum", startnext.api_mapinfo_no),
                new JProperty("fleetnum", CurrentDeckId),
                new JProperty("combined", Convert.ToInt32(organization.Combined && CurrentDeckId == 1)),
                new JProperty("support1", GetSupportingFleet(false)),
                new JProperty("support2", GetSupportingFleet(true)),
                new JProperty("time", (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds),
                new JProperty("hq", KanColleClient.Current.Homeport.Admiral.Experience.ToString()));

            JProperty[] fleetdata = new JProperty[organization.Fleets.Count];

            int count = 0;
            foreach (var fleet in organization.Fleets)
            {
                fleetdata[count] = new JProperty($"fleet{count + 1}",
                                                 new JArray(fleet.Value.Ships.Select(ship =>
                                                                                     new JObject(
                                                                                         new JProperty("mst_id", ship.Info.Id),
                                                                                         new JProperty("level", ship.Level),
                                                                                         new JProperty("kyouka",
                                                                                                       new JArray(ship.Firepower.Upgraded, ship.Torpedo.Upgraded, ship.AA.Upgraded, ship.Armer.Upgraded, ship.Luck.Upgraded)),
                                                                                         new JProperty("morale", ship.Condition),
                                                                                         new JProperty("equip",
                                                                                                       new JArray(ship.Slots.Select(y => y.Item.Info.Id).ToArray()))))));

                count++;
            }

            foreach (var fleet in fleetdata)
            {
                BattleData.Add(fleet);
            }

            JProperty battles = new JProperty("battles",
                                              new JArray(
                                                  new JObject(
                                                      new JProperty("node", startnext.api_no),
                                                      new JProperty("data", new JObject()),
                                                      new JProperty("yasen", new JObject()))));

            BattleData.Add(battles);
            #endregion
        }
Пример #2
0
/*
 * //KC3 리플레이 데이터 예시
 * {
 *      "diff": 0,
 *      "world": 1,
 *      "mapnum": 1,
 *      "fleetnum": 1,
 *      "combined": 0,
 *      "fleet1": [
 *              {
 *                      "mst_id": 399,
 *                      "level": 138,
 *                      "kyouka": [ 9, 48, 0, 14, 6 ],
 *                      "morale": 67,
 *                      "equip": [ 15, 15, 0, 0, 0 ]
 *              }
 *      ],
 *      "support1": 0,
 *      "support2": 0,
 *      "time": 1460983675,
 *      "hq": "8040045",
 *      "id": 3,
 *      "battles": [
 *              {
 *                      "node": 1,
 *                      "data": { },
 *                      "yasen": { },
 *                      "rating": "SS",
 *                      "drop": 44,
 *                      "baseEXP": 30,
 *                      "hqEXP": 10
 *              }
 *      ]
 * }
 */
        private void MapStartNext(start_next startnext, string api_deck_id = null)
        {
            if (api_deck_id != null)
            {
                CurrentDeckId = int.Parse(api_deck_id);
            }

            IsBossCell = startnext.api_event_id == 5;

            #region 노드 데이터 작성
            var organization = KanColleClient.Current.Homeport.Organization;
            NodeData = new JObject(
                new JProperty("world", startnext.api_maparea_id),
                new JProperty("mapnum", startnext.api_mapinfo_no),
                new JProperty("node", startnext.api_no));
            #endregion
        }