Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andanteyk committed Feb 11, 2015
2 parents 2985e48 + c0856de commit 23268cf
Show file tree
Hide file tree
Showing 29 changed files with 863 additions and 285 deletions.
9 changes: 9 additions & 0 deletions ElectronicObserver/Data/Battle/BattleCombinedAirBattle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,18 @@ public override string APIName {
get { return "api_req_combined_battle/airbattle"; }
}


public override BattleData.BattleTypeFlag BattleType {
get { return BattleTypeFlag.Day | BattleTypeFlag.Combined; }
}

public override int FleetIDFriend {
get { return int.Parse( RawData.api_deck_id ); }
}

public override int FleetIDFriendCombined {
get { return 2; }
}
}

}
9 changes: 9 additions & 0 deletions ElectronicObserver/Data/Battle/BattleCombinedNightOnly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,18 @@ public override string APIName {
get { return "api_req_combined_battle/sp_midnight"; }
}


public override BattleData.BattleTypeFlag BattleType {
get { return BattleTypeFlag.Night | BattleTypeFlag.Combined; }
}

public override int FleetIDFriend {
get { return int.Parse( RawData.api_deck_id ); }
}

public override int FleetIDFriendCombined {
get { return 2; }
}
}

}
9 changes: 9 additions & 0 deletions ElectronicObserver/Data/Battle/BattleCombinedNormalDay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,18 @@ public override string APIName {
get { return "api_req_combined_battle/battle"; }
}


public override BattleData.BattleTypeFlag BattleType {
get { return BattleTypeFlag.Day | BattleTypeFlag.Combined; }
}

public override int FleetIDFriend {
get { return int.Parse( RawData.api_deck_id ); }
}

public override int FleetIDFriendCombined {
get { return 2; }
}
}

}
7 changes: 7 additions & 0 deletions ElectronicObserver/Data/Battle/BattleCombinedNormalNight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ public override string APIName {
get { return "api_req_combined_battle/midnight_battle"; }
}

public override BattleData.BattleTypeFlag BattleType {
get { return BattleTypeFlag.Night | BattleTypeFlag.Combined; }
}

public override int FleetIDFriendCombined {
get { return 2; }
}

public override int FleetIDFriend {
get { return int.Parse( RawData.api_deck_id ); }
Expand Down
9 changes: 9 additions & 0 deletions ElectronicObserver/Data/Battle/BattleCombinedWater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@ public override int FleetIDFriend {
get { return int.Parse( RawData.api_deck_id ); }
}

public override int FleetIDFriendCombined {
get { return 2; }
}


public override BattleData.BattleTypeFlag BattleType {
get { return BattleTypeFlag.Day | BattleTypeFlag.Combined; }
}

public override string APIName {
get { return "api_req_combined_battle/battle_water"; }
}
Expand Down
15 changes: 15 additions & 0 deletions ElectronicObserver/Data/Battle/BattleData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ public ReadOnlyCollection<int> EnemyLevels {
/// </summary>
public abstract string APIName { get; }


[Flags]
public enum BattleTypeFlag {
Undefined = 0,
Day,
Night,
Practice = 0x1000,
Combined = 0x2000,
}

/// <summary>
/// 戦闘モード
/// </summary>
public abstract BattleTypeFlag BattleType { get; }

}

}
2 changes: 2 additions & 0 deletions ElectronicObserver/Data/Battle/BattleDataCombined.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace ElectronicObserver.Data.Battle {

public abstract class BattleDataCombined : BattleData {

public abstract int FleetIDFriendCombined { get; }

/// <summary>
/// 随伴護衛艦隊の初期HP [1-6]
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions ElectronicObserver/Data/Battle/BattleNightOnly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ public override string APIName {
public override int FleetIDFriend {
get { return (int)RawData.api_deck_id; }
}

public override BattleTypeFlag BattleType {
get { return BattleTypeFlag.Night; }
}
}

}
3 changes: 3 additions & 0 deletions ElectronicObserver/Data/Battle/BattleNormalDay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ public override string APIName {
}


public override BattleData.BattleTypeFlag BattleType {
get { return BattleTypeFlag.Day; }
}

public override int FleetIDFriend {
get { return (int)RawData.api_dock_id; }
Expand Down
5 changes: 5 additions & 0 deletions ElectronicObserver/Data/Battle/BattleNormalNight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,10 @@ public override string APIName {
public override int FleetIDFriend {
get { return int.Parse( RawData.api_deck_id ); }
}


public override BattleTypeFlag BattleType {
get { return BattleTypeFlag.Night; }
}
}
}
5 changes: 5 additions & 0 deletions ElectronicObserver/Data/Battle/BattlePracticeDay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ public override string APIName {
public override int FleetIDFriend {
get { return (int)RawData.api_dock_id; }
}


public override BattleTypeFlag BattleType {
get { return BattleTypeFlag.Day | BattleTypeFlag.Practice; }
}
}

}
5 changes: 5 additions & 0 deletions ElectronicObserver/Data/Battle/BattlePracticeNight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,10 @@ public override string APIName {
public override int FleetIDFriend {
get { return (int)RawData.api_deck_id; }
}


public override BattleTypeFlag BattleType {
get { return BattleTypeFlag.Night | BattleTypeFlag.Practice; }
}
}
}
23 changes: 18 additions & 5 deletions ElectronicObserver/Data/FleetData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,19 @@ public override void LoadFromRequest( string apiname, Dictionary<string, string>

} break;

case "api_req_kaisou/powerup":
{
foreach ( int id in data["api_id_items"].Split( ",".ToCharArray() ).Select( s => int.Parse( s ) ) ) {
for ( int i = 0; i < _members.Length; i++ ) {
if ( _members[i] == id ) {
RemoveShip( i );
ShortenConditionTimer();
break;
}
}
}
} break;

case "api_req_kaisou/remodeling":
if ( int.Parse( data["api_id"] ) == FleetID )
SetConditionTimer();
Expand Down Expand Up @@ -467,8 +480,8 @@ public static FleetStates UpdateFleetState( FleetData fleet, ImageLabel label, T
if ( fleet.IsInSortie ) {

//大破出撃中
if ( fleet.Members.Count( id =>
( id != -1 && !fleet.EscapedShipList.Contains( id ) && (double)db.Ships[id].HPCurrent / db.Ships[id].HPMax <= 0.25 )
if ( fleet.MembersInstance.Count( s =>
( s != null && !fleet.EscapedShipList.Contains( s.MasterID ) && (double)s.HPCurrent / s.HPMax <= 0.25 )
) > 0 ) {

label.Text = "!!大破進撃中!!";
Expand Down Expand Up @@ -500,8 +513,8 @@ public static FleetStates UpdateFleetState( FleetData fleet, ImageLabel label, T
}

//大破艦あり
if ( fleet.Members.Count( id =>
( id != -1 && !fleet.EscapedShipList.Contains( id ) && (double)db.Ships[id].HPCurrent / db.Ships[id].HPMax <= 0.25 )
if ( fleet.MembersInstance.Count( s =>
( s != null && !fleet.EscapedShipList.Contains( s.MasterID ) && (double)s.HPCurrent / s.HPMax <= 0.25 )
) > 0 ) {

label.Text = "大破艦あり!";
Expand Down Expand Up @@ -567,7 +580,7 @@ public static FleetStates UpdateFleetState( FleetData fleet, ImageLabel label, T

//疲労
{
int cond = fleet.Members.Min( id => id == -1 ? 100 : db.Ships[id].Condition );
int cond = fleet.MembersInstance.Min( s => s == null ? 100 : s.Condition );

if ( cond < Configuration.Config.Control.ConditionBorder && fleet.ConditionTime != null ) {

Expand Down
1 change: 1 addition & 0 deletions ElectronicObserver/ElectronicObserver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
<Compile Include="Observer\kcsapi\api_req_mission\result.cs" />
<Compile Include="Observer\kcsapi\api_req_ranking\getlist.cs" />
<Compile Include="Resource\Record\ResourceRecord.cs" />
<Compile Include="Utility\PathHelper.cs" />
<Compile Include="Utility\Storage\DataStorage.cs" />
<Compile Include="Observer\APIBase.cs" />
<Compile Include="Observer\APIDictionary.cs" />
Expand Down
15 changes: 11 additions & 4 deletions ElectronicObserver/Observer/APIObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ private APIObserver() {

public int Start( int portID ) {

//checkme: フラグを消してみた、要確認
Fiddler.FiddlerApplication.Startup( portID, Fiddler.FiddlerCoreStartupFlags.ChainToUpstreamGateway/* | Fiddler.FiddlerCoreStartupFlags.RegisterAsSystemProxy */);
Fiddler.FiddlerApplication.Startup( portID, Fiddler.FiddlerCoreStartupFlags.ChainToUpstreamGateway |
( Utility.Configuration.Config.Connection.RegisterAsSystemProxy ? Fiddler.FiddlerCoreStartupFlags.RegisterAsSystemProxy : 0 ) );

Fiddler.URLMonInterop.SetProxyInProcess( string.Format( "127.0.0.1:{0}",
Fiddler.FiddlerApplication.oProxy.ListenPort ), "<local>" );
Expand Down Expand Up @@ -224,12 +224,19 @@ private void FiddlerApplication_AfterSessionComplete( Fiddler.Session oSession )

private void FiddlerApplication_BeforeRequest( Fiddler.Session oSession ) {

Utility.Configuration.ConfigurationData.ConfigConnection c = Utility.Configuration.Config.Connection;


// 上流プロキシ設定
if ( c.UseUpstreamProxy ) {
oSession["X-OverrideGateway"] = string.Format( "localhost:{0}", c.UpstreamProxyPort );
}


if ( oSession.fullUrl.Contains( "/kcsapi/" ) ) {

//保存
{
Utility.Configuration.ConfigurationData.ConfigConnection c = Utility.Configuration.Config.Connection;

if ( c.SaveReceivedData && c.SaveRequest ) {

SaveRequest( oSession.fullUrl, oSession.GetRequestBodyAsString() );
Expand Down
4 changes: 4 additions & 0 deletions ElectronicObserver/Observer/kcsapi/api_req_kaisou/powerup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public override void OnRequestReceived( Dictionary<string, string> data ) {

KCDatabase db = KCDatabase.Instance;


db.Fleet.LoadFromRequest( APIName, data );


foreach( string id in data["api_id_items"].Split( ",".ToCharArray() ) ) {

int shipID = int.Parse( id );
Expand Down
7 changes: 7 additions & 0 deletions ElectronicObserver/Other/Information/apilist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ api_start2 :艦娘・装備固有データその他
18=装甲空母
19=工作艦
20=潜水母艦
21=練習巡洋艦
api_scnt :入渠時間係数(本体ソース内では[slotCount]とある)
api_kcnt :建造時のシルエット
api_equip_type :装備可能カテゴリのフラグ
Expand All @@ -113,6 +114,7 @@ api_start2 :艦娘・装備固有データその他
12=司令部施設
13=航空要員
14=高射装置
15=対地装備

[1]:図鑑表示
1=Primary Armament
Expand All @@ -137,6 +139,7 @@ api_start2 :艦娘・装備固有データその他
23=Maintenance Team
24=AA Director
25=AP Shell
26=Rocket Artillery

1=主砲
2=副砲
Expand All @@ -160,6 +163,7 @@ api_start2 :艦娘・装備固有データその他
23=航空要員
24=高射装置
25=対艦強化弾
26=対地装備

[2]:カテゴリ
(api_mst_slotitem_equiptype を参照)
Expand Down Expand Up @@ -199,6 +203,7 @@ api_start2 :艦娘・装備固有データその他
34=司令部施設
35=航空要員
36=高射装置
37=対地装備

[3]:アイコンID
1=小口径主砲
Expand Down Expand Up @@ -231,6 +236,8 @@ api_start2 :艦娘・装備固有データその他
28=司令部施設
29=航空要員
30=高射装置
31=対地装備

api_taik :耐久(0)
api_souk :装甲
api_houg :火力
Expand Down
Loading

0 comments on commit 23268cf

Please sign in to comment.