Skip to content

Commit

Permalink
・高速建造の使用結果をリアルタイム更新できるように修正
Browse files Browse the repository at this point in the history
・間もなく version 2.6 β rev.2 としてリリースします
  • Loading branch information
Grabacr07 committed Apr 28, 2014
1 parent 98d7d40 commit dbd5439
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 15 deletions.
12 changes: 10 additions & 2 deletions Grabacr07.KanColleViewer/Models/ProductInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class ProductInfo
private string _Copyright;
private string _Trademark;
private Version _Version;
private string _VersionString;
private IReadOnlyCollection<Library> _Libraries;

public string Title
Expand Down Expand Up @@ -56,13 +57,20 @@ public Version Version

public string VersionString
{
get { return this._VersionString ?? (this._VersionString = string.Format("{0}{1}{2}", this.Version.ToString(3), this.IsBetaRelease ? " β" : "", this.Version.Revision == 0 ? "" : " rev." + this.Version.Revision)); }
}

public bool IsBetaRelease
{

#if BETA
get { return this.Version.ToString(3) + " β"; }
get { return true; }
#else
get { return this.Version.ToString(3); }
get { return false; }
#endif
}


public IReadOnlyCollection<Library> Libraries
{
get
Expand Down
2 changes: 1 addition & 1 deletion Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.6.0.0")]
[assembly: AssemblyVersion("2.6.0.2")]
16 changes: 16 additions & 0 deletions Grabacr07.KanColleWrapper/Dockyard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ internal Dockyard(KanColleProxy proxy)

proxy.api_get_member_kdock.TryParse<kcsapi_kdock[]>().Subscribe(x => this.Update(x.Data));
proxy.api_req_kousyou_getship.TryParse<kcsapi_kdock_getship>().Subscribe(x => this.GetShip(x.Data));
proxy.api_req_kousyou_createship_speedchange.TryParse().Subscribe(this.ChangeSpeed);
}


Expand All @@ -65,5 +66,20 @@ private void GetShip(kcsapi_kdock_getship source)
{
this.Update(source.api_kdock);
}

private void ChangeSpeed(SvData svd)
{
try
{
var dock = this.Docks[int.Parse(svd.Request["api_kdock_id"])];
var highspeed = svd.Request["api_highspeed"] == "1";

if (highspeed) dock.Finish();
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("高速建造材使用の解析に失敗しました: {0}", ex);
}
}
}
}
8 changes: 8 additions & 0 deletions Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ public IObservable<Session> api_req_kousyou_createship
get { return this.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_req_kousyou/createship"); }
}

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

/// <summary>
/// エンド ポイント "/kcsapi/api_req_kousyou/destroyship" からのセッションを配信します。
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions Grabacr07.KanColleWrapper/KanColleProxy.Endpoints.tt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"/kcsapi/api_req_kousyou/getship",
"/kcsapi/api_req_kousyou/createitem",
"/kcsapi/api_req_kousyou/createship",
"/kcsapi/api_req_kousyou/createship_speedchange",
"/kcsapi/api_req_kousyou/destroyship",
"/kcsapi/api_req_kousyou/destroyitem2",
"/kcsapi/api_req_nyukyo/start",
Expand Down
9 changes: 5 additions & 4 deletions Grabacr07.KanColleWrapper/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ internal Logger(KanColleProxy proxy)
{
this.shipmats = new int[5];

proxy.api_req_kousyou_createitem.TryParse<kcsapi_createitem>().Subscribe(x => this.CreateItem(x.Data, x.Request));
proxy.api_req_kousyou_createship.TryParse<kcsapi_createship>().Subscribe(x => this.CreateShip(x.Request));
proxy.api_get_member_kdock.TryParse<kcsapi_kdock[]>().Subscribe(x => this.KDock(x.Data));
proxy.api_req_sortie_battleresult.TryParse<kcsapi_battleresult>().Subscribe(x => this.BattleResult(x.Data));
// ちょっと考えなおす
//proxy.api_req_kousyou_createitem.TryParse<kcsapi_createitem>().Subscribe(x => this.CreateItem(x.Data, x.Request));
//proxy.api_req_kousyou_createship.TryParse<kcsapi_createship>().Subscribe(x => this.CreateShip(x.Request));
//proxy.api_get_member_kdock.TryParse<kcsapi_kdock[]>().Subscribe(x => this.KDock(x.Data));
//proxy.api_req_sortie_battleresult.TryParse<kcsapi_battleresult>().Subscribe(x => this.BattleResult(x.Data));
}

private void CreateItem(kcsapi_createitem item, NameValueCollection req)
Expand Down
8 changes: 8 additions & 0 deletions Grabacr07.KanColleWrapper/Models/BuildingDock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ internal BuildingDock(kcsapi_kdock rawData)
this.Update(rawData);
}


internal void Update(kcsapi_kdock rawData)
{
this.Id = rawData.api_id;
Expand All @@ -140,6 +141,13 @@ internal void Update(kcsapi_kdock rawData)
: null;
}

internal void Finish()
{
this.State = BuildingDockState.Completed;
this.CompleteTime = null;
}


protected override void Tick()
{
base.Tick();
Expand Down
7 changes: 3 additions & 4 deletions Grabacr07.KanColleWrapper/Organization.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Grabacr07.KanColleWrapper.Internal;
Expand Down Expand Up @@ -188,7 +187,7 @@ private void Change(SvData data)
}
catch (Exception ex)
{
Debug.WriteLine("編成の変更に失敗しました: {0}", ex);
System.Diagnostics.Debug.WriteLine("編成の変更に失敗しました: {0}", ex);
}
}

Expand Down Expand Up @@ -235,7 +234,7 @@ private void Powerup(SvData<kcsapi_powerup> svd)
}
catch (Exception ex)
{
Debug.WriteLine("近代化改修による更新に失敗しました: {0}", ex);
System.Diagnostics.Debug.WriteLine("近代化改修による更新に失敗しました: {0}", ex);
}
}

Expand All @@ -256,7 +255,7 @@ private void DestoryShip(SvData<kcsapi_destroyship> svd)
}
catch (Exception ex)
{
Debug.WriteLine("解体による更新に失敗しました。");
System.Diagnostics.Debug.WriteLine("解体による更新に失敗しました。");
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions Grabacr07.KanColleWrapper/Repairyard.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reactive.Linq;
using System.Text;
using System.Threading.Tasks;
using Grabacr07.KanColleWrapper.Internal;
using Grabacr07.KanColleWrapper.Models;
Expand Down Expand Up @@ -106,7 +104,7 @@ private void Start(SvData data)
}
catch (Exception ex)
{
Debug.WriteLine("入渠開始の解析に失敗しました: {0}", ex);
System.Diagnostics.Debug.WriteLine("入渠開始の解析に失敗しました: {0}", ex);
}
}

Expand All @@ -125,7 +123,7 @@ private void ChangeSpeed(SvData data)
}
catch (Exception ex)
{
Debug.WriteLine("高速修復材の解析に失敗しました: {0}", ex);
System.Diagnostics.Debug.WriteLine("高速修復材の解析に失敗しました: {0}", ex);
}
}
}
Expand Down

0 comments on commit dbd5439

Please sign in to comment.