Skip to content

Commit

Permalink
4 月 1 日アップデート対応
Browse files Browse the repository at this point in the history
  • Loading branch information
Grabacr07 committed Apr 1, 2016
1 parent eb098c4 commit 4492aac
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 15 deletions.
2 changes: 1 addition & 1 deletion source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
ResourceDictionaryLocation.None,
ResourceDictionaryLocation.SourceAssembly)]

[assembly: AssemblyVersion("4.2.3.0")]
[assembly: AssemblyVersion("4.2.4.0")]
16 changes: 9 additions & 7 deletions source/Grabacr07.KanColleWrapper/KanColleClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@ private KanColleClient()
public void Initialieze()
{
var proxy = this.Proxy ?? (this.Proxy = new KanColleProxy());
var basic = proxy.api_get_member_basic.TryParse<kcsapi_basic>().FirstAsync().ToTask();
var kdock = proxy.api_get_member_kdock.TryParse<kcsapi_kdock[]>().FirstAsync().ToTask();
var sitem = proxy.api_get_member_slot_item.TryParse<kcsapi_slotitem[]>().FirstAsync().ToTask();
var requireInfo = proxy.api_get_member_require_info.TryParse<kcsapi_require_info>().FirstAsync().ToTask();
//var basic = proxy.api_get_member_basic.TryParse<kcsapi_basic>().FirstAsync().ToTask();
//var kdock = proxy.api_get_member_kdock.TryParse<kcsapi_kdock[]>().FirstAsync().ToTask();
//var sitem = proxy.api_get_member_slot_item.TryParse<kcsapi_slotitem[]>().FirstAsync().ToTask();

proxy.api_start2.FirstAsync().Subscribe(async session =>
{
var timeout = Task.Delay(TimeSpan.FromSeconds(20));
var canInitialize = await Task.WhenAny(new Task[] { basic, kdock, sitem }.WhenAll(), timeout) != timeout;
var canInitialize = await Task.WhenAny(new Task[] { requireInfo }.WhenAll(), timeout) != timeout;

// タイムアウト仕掛けてるのは、今後のアップデートで basic, kdock, slot_item のいずれかが来なくなったときに
// 起動できなくなる (IsStarted を true にできなくなる) のを防ぐため
Expand All @@ -122,9 +123,10 @@ public void Initialieze()

if (canInitialize)
{
this.Homeport.UpdateAdmiral((await basic).Data);
this.Homeport.Itemyard.Update((await sitem).Data);
this.Homeport.Dockyard.Update((await kdock).Data);
var data = await requireInfo;
this.Homeport.UpdateAdmiral(data.Data.api_basic);
this.Homeport.Itemyard.Update(data.Data.api_slot_item);
this.Homeport.Dockyard.Update(data.Data.api_kdock);
}

this.IsStarted = true;
Expand Down
8 changes: 8 additions & 0 deletions source/Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,5 +350,13 @@ public IObservable<Session> api_req_combined_battle_goback_port
get { return this.ApiSessionSource.Where(x => x.Request.PathAndQuery == "/kcsapi/api_req_combined_battle/goback_port"); }
}

/// <summary>
/// エンド ポイント "/kcsapi/api_get_member/require_info" からのセッションを配信します。
/// </summary>
public IObservable<Session> api_get_member_require_info
{
get { return this.ApiSessionSource.Where(x => x.Request.PathAndQuery == "/kcsapi/api_get_member/require_info"); }
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"/kcsapi/api_req_combined_battle/airbattle",
"/kcsapi/api_req_combined_battle/battleresult",
"/kcsapi/api_req_combined_battle/goback_port",
"/kcsapi/api_get_member/require_info",
};
#>
//
Expand Down
1 change: 1 addition & 0 deletions source/Grabacr07.KanColleWrapper/KanColleWrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
<Compile Include="Models\CreatedSlotItem.cs" />
<Compile Include="Models\FleetCondition.cs" />
<Compile Include="Models\Raw\kcsapi_mst_mapcell.cs" />
<Compile Include="Models\Raw\kcsapi_require_info.cs" />
<Compile Include="Models\Raw\kcsapi_ship_deck.cs" />
<Compile Include="Models\Raw\kcsapi_mst_maparea.cs" />
<Compile Include="Models\Raw\kcsapi_mst_mapinfo.cs" />
Expand Down
18 changes: 18 additions & 0 deletions source/Grabacr07.KanColleWrapper/Models/Raw/kcsapi_require_info.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Grabacr07.KanColleWrapper.Models.Raw
{
public class kcsapi_require_info
{
public kcsapi_basic api_basic { get; set; }
public kcsapi_slotitem[] api_slot_item { get; set; }
//public Api_Unsetslot api_unsetslot { get; set; }
public kcsapi_kdock[] api_kdock { get; set; }
public kcsapi_useitem[] api_useitem { get; set; }
//public Api_Furniture[] api_furniture { get; set; }
}
}
4 changes: 2 additions & 2 deletions source/Grabacr07.KanColleWrapper/Models/Raw/kcsapi_start2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class Api_Mst_Shipgraph
public int api_id { get; set; }
public int api_sortno { get; set; }
public string api_filename { get; set; }
public string api_version { get; set; }
//public string api_version { get; set; }
public int[] api_boko_n { get; set; }
public int[] api_boko_d { get; set; }
public int[] api_kaisyu_n { get; set; }
Expand Down Expand Up @@ -228,7 +228,7 @@ public class Api_Mst_Furnituregraph
public int api_type { get; set; }
public int api_no { get; set; }
public string api_filename { get; set; }
public string api_version { get; set; }
//public string api_version { get; set; }
}

public class Api_Mst_Useitem
Expand Down
4 changes: 2 additions & 2 deletions source/Grabacr07.KanColleWrapper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
[assembly: ComVisible(false)]
[assembly: Guid("8A13AB28-4E9F-423D-80AD-23EEF2821959")]

[assembly: AssemblyVersion("1.5.0")]
[assembly: AssemblyInformationalVersion("1.5.0")]
[assembly: AssemblyVersion("1.5.1")]
[assembly: AssemblyInformationalVersion("1.5.1")]
4 changes: 2 additions & 2 deletions source/Tools/Grabacr07.Tools.JsonViewer/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup>
</configuration>
2 changes: 1 addition & 1 deletion source/Tools/Grabacr07.Tools.JsonViewer/JsonViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Grabacr07.Tools.JsonViewer</RootNamespace>
<AssemblyName>Grabacr07.Tools.JsonViewer</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
Expand Down

0 comments on commit 4492aac

Please sign in to comment.