コミットメタ情報

リビジョン9d2db977a3dbcc08c6976dc14f739a12286913b5 (tree)
日時2018-01-27 20:47:41
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

kancolle-db.netへの送信機能を削除する

変更サマリ

差分

--- a/KancolleSniffer/Config.cs
+++ b/KancolleSniffer/Config.cs
@@ -70,12 +70,6 @@ namespace KancolleSniffer
7070 }
7171 }
7272
73- public class KancolleDbConfig
74- {
75- public bool On { get; set; }
76- public string Token { get; set; } = "";
77- }
78-
7973 public class PushbulletConfig
8074 {
8175 public bool On { get; set; }
@@ -223,7 +217,6 @@ namespace KancolleSniffer
223217 public ProxyConfig Proxy { get; set; } = new ProxyConfig();
224218 public ShipListConfig ShipList { get; set; } = new ShipListConfig();
225219 public LogConfig Log { get; set; } = new LogConfig();
226- public KancolleDbConfig KancolleDb { get; set; } = new KancolleDbConfig();
227220 public PushbulletConfig Pushbullet { get; set; } = new PushbulletConfig();
228221 public PushoverConfig Pushover { get; set; } = new PushoverConfig();
229222
--- a/KancolleSniffer/ConfigDialog.Designer.cs
+++ b/KancolleSniffer/ConfigDialog.Designer.cs
@@ -109,9 +109,7 @@ namespace KancolleSniffer
109109 this.textBoxOutput = new System.Windows.Forms.TextBox();
110110 this.label11 = new System.Windows.Forms.Label();
111111 this.buttonOutputDir = new System.Windows.Forms.Button();
112- this.tabPageCollabo = new System.Windows.Forms.TabPage();
113- this.tabControlCollabo = new System.Windows.Forms.TabControl();
114- this.tabPagePushNotification = new System.Windows.Forms.TabPage();
112+ this.tabPagePush = new System.Windows.Forms.TabPage();
115113 this.groupBoxPushover = new System.Windows.Forms.GroupBox();
116114 this.buttonPushoverTest = new System.Windows.Forms.Button();
117115 this.label16 = new System.Windows.Forms.Label();
@@ -124,11 +122,6 @@ namespace KancolleSniffer
124122 this.textBoxPushbulletToken = new System.Windows.Forms.TextBox();
125123 this.label7 = new System.Windows.Forms.Label();
126124 this.checkBoxPushbulletOn = new System.Windows.Forms.CheckBox();
127- this.tabPageExternalService = new System.Windows.Forms.TabPage();
128- this.groupBoxKancolleDb = new System.Windows.Forms.GroupBox();
129- this.textBoxKancolleDbToken = new System.Windows.Forms.TextBox();
130- this.label8 = new System.Windows.Forms.Label();
131- this.checkBoxKancolleDbOn = new System.Windows.Forms.CheckBox();
132125 this.tabPageDebug = new System.Windows.Forms.TabPage();
133126 this.buttonPlayDebugLog = new System.Windows.Forms.Button();
134127 this.buttonDebugLogOpenFile = new System.Windows.Forms.Button();
@@ -157,13 +150,9 @@ namespace KancolleSniffer
157150 this.groupBoxAutoConfig.SuspendLayout();
158151 this.tabPageLog.SuspendLayout();
159152 ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaterialLogInterval)).BeginInit();
160- this.tabPageCollabo.SuspendLayout();
161- this.tabControlCollabo.SuspendLayout();
162- this.tabPagePushNotification.SuspendLayout();
153+ this.tabPagePush.SuspendLayout();
163154 this.groupBoxPushover.SuspendLayout();
164155 this.groupBoxPushbullet.SuspendLayout();
165- this.tabPageExternalService.SuspendLayout();
166- this.groupBoxKancolleDb.SuspendLayout();
167156 this.tabPageDebug.SuspendLayout();
168157 this.SuspendLayout();
169158 //
@@ -178,7 +167,7 @@ namespace KancolleSniffer
178167 this.tabControl.Controls.Add(this.tabPageVersion);
179168 this.tabControl.Controls.Add(this.tabPageProxy);
180169 this.tabControl.Controls.Add(this.tabPageLog);
181- this.tabControl.Controls.Add(this.tabPageCollabo);
170+ this.tabControl.Controls.Add(this.tabPagePush);
182171 this.tabControl.Controls.Add(this.tabPageDebug);
183172 this.tabControl.Location = new System.Drawing.Point(7, 6);
184173 this.tabControl.Multiline = true;
@@ -878,38 +867,16 @@ namespace KancolleSniffer
878867 this.buttonOutputDir.UseVisualStyleBackColor = true;
879868 this.buttonOutputDir.Click += new System.EventHandler(this.buttonOutputDir_Click);
880869 //
881- // tabPageCollabo
882- //
883- this.tabPageCollabo.Controls.Add(this.tabControlCollabo);
884- this.tabPageCollabo.Location = new System.Drawing.Point(4, 40);
885- this.tabPageCollabo.Name = "tabPageCollabo";
886- this.tabPageCollabo.Size = new System.Drawing.Size(256, 158);
887- this.tabPageCollabo.TabIndex = 8;
888- this.tabPageCollabo.Text = "連携";
889- this.tabPageCollabo.UseVisualStyleBackColor = true;
890- //
891- // tabControlCollabo
892- //
893- this.tabControlCollabo.Controls.Add(this.tabPagePushNotification);
894- this.tabControlCollabo.Controls.Add(this.tabPageExternalService);
895- this.tabControlCollabo.Dock = System.Windows.Forms.DockStyle.Fill;
896- this.tabControlCollabo.Location = new System.Drawing.Point(0, 0);
897- this.tabControlCollabo.Name = "tabControlCollabo";
898- this.tabControlCollabo.SelectedIndex = 0;
899- this.tabControlCollabo.Size = new System.Drawing.Size(256, 158);
900- this.tabControlCollabo.TabIndex = 3;
901- //
902- // tabPagePushNotification
903- //
904- this.tabPagePushNotification.Controls.Add(this.groupBoxPushover);
905- this.tabPagePushNotification.Controls.Add(this.groupBoxPushbullet);
906- this.tabPagePushNotification.Location = new System.Drawing.Point(4, 22);
907- this.tabPagePushNotification.Name = "tabPagePushNotification";
908- this.tabPagePushNotification.Padding = new System.Windows.Forms.Padding(3);
909- this.tabPagePushNotification.Size = new System.Drawing.Size(248, 132);
910- this.tabPagePushNotification.TabIndex = 0;
911- this.tabPagePushNotification.Text = "プッシュ通知";
912- this.tabPagePushNotification.UseVisualStyleBackColor = true;
870+ // tabPagePush
871+ //
872+ this.tabPagePush.Controls.Add(this.groupBoxPushover);
873+ this.tabPagePush.Controls.Add(this.groupBoxPushbullet);
874+ this.tabPagePush.Location = new System.Drawing.Point(4, 40);
875+ this.tabPagePush.Name = "tabPagePush";
876+ this.tabPagePush.Size = new System.Drawing.Size(256, 158);
877+ this.tabPagePush.TabIndex = 8;
878+ this.tabPagePush.Text = "プッシュ通知";
879+ this.tabPagePush.UseVisualStyleBackColor = true;
913880 //
914881 // groupBoxPushover
915882 //
@@ -919,7 +886,7 @@ namespace KancolleSniffer
919886 this.groupBoxPushover.Controls.Add(this.textBoxPushoverUserKey);
920887 this.groupBoxPushover.Controls.Add(this.checkBoxPushoverOn);
921888 this.groupBoxPushover.Controls.Add(this.textBoxPushoverApiKey);
922- this.groupBoxPushover.Location = new System.Drawing.Point(6, 55);
889+ this.groupBoxPushover.Location = new System.Drawing.Point(11, 60);
923890 this.groupBoxPushover.Name = "groupBoxPushover";
924891 this.groupBoxPushover.Size = new System.Drawing.Size(236, 66);
925892 this.groupBoxPushover.TabIndex = 2;
@@ -985,7 +952,7 @@ namespace KancolleSniffer
985952 this.groupBoxPushbullet.Controls.Add(this.textBoxPushbulletToken);
986953 this.groupBoxPushbullet.Controls.Add(this.label7);
987954 this.groupBoxPushbullet.Controls.Add(this.checkBoxPushbulletOn);
988- this.groupBoxPushbullet.Location = new System.Drawing.Point(6, 6);
955+ this.groupBoxPushbullet.Location = new System.Drawing.Point(11, 11);
989956 this.groupBoxPushbullet.Name = "groupBoxPushbullet";
990957 this.groupBoxPushbullet.Size = new System.Drawing.Size(236, 43);
991958 this.groupBoxPushbullet.TabIndex = 1;
@@ -1029,55 +996,6 @@ namespace KancolleSniffer
1029996 this.checkBoxPushbulletOn.Text = "有効";
1030997 this.checkBoxPushbulletOn.UseVisualStyleBackColor = true;
1031998 //
1032- // tabPageExternalService
1033- //
1034- this.tabPageExternalService.Controls.Add(this.groupBoxKancolleDb);
1035- this.tabPageExternalService.Location = new System.Drawing.Point(4, 22);
1036- this.tabPageExternalService.Name = "tabPageExternalService";
1037- this.tabPageExternalService.Padding = new System.Windows.Forms.Padding(3);
1038- this.tabPageExternalService.Size = new System.Drawing.Size(248, 132);
1039- this.tabPageExternalService.TabIndex = 1;
1040- this.tabPageExternalService.Text = "外部サービス";
1041- this.tabPageExternalService.UseVisualStyleBackColor = true;
1042- //
1043- // groupBoxKancolleDb
1044- //
1045- this.groupBoxKancolleDb.Controls.Add(this.textBoxKancolleDbToken);
1046- this.groupBoxKancolleDb.Controls.Add(this.label8);
1047- this.groupBoxKancolleDb.Controls.Add(this.checkBoxKancolleDbOn);
1048- this.groupBoxKancolleDb.Location = new System.Drawing.Point(6, 6);
1049- this.groupBoxKancolleDb.Name = "groupBoxKancolleDb";
1050- this.groupBoxKancolleDb.Size = new System.Drawing.Size(234, 47);
1051- this.groupBoxKancolleDb.TabIndex = 0;
1052- this.groupBoxKancolleDb.TabStop = false;
1053- this.groupBoxKancolleDb.Text = "艦これ統計データベース";
1054- //
1055- // textBoxKancolleDbToken
1056- //
1057- this.textBoxKancolleDbToken.Location = new System.Drawing.Point(121, 20);
1058- this.textBoxKancolleDbToken.Name = "textBoxKancolleDbToken";
1059- this.textBoxKancolleDbToken.Size = new System.Drawing.Size(107, 19);
1060- this.textBoxKancolleDbToken.TabIndex = 2;
1061- //
1062- // label8
1063- //
1064- this.label8.AutoSize = true;
1065- this.label8.Location = new System.Drawing.Point(57, 23);
1066- this.label8.Name = "label8";
1067- this.label8.Size = new System.Drawing.Size(63, 12);
1068- this.label8.TabIndex = 1;
1069- this.label8.Text = "アクセスキー:";
1070- //
1071- // checkBoxKancolleDbOn
1072- //
1073- this.checkBoxKancolleDbOn.AutoSize = true;
1074- this.checkBoxKancolleDbOn.Location = new System.Drawing.Point(6, 22);
1075- this.checkBoxKancolleDbOn.Name = "checkBoxKancolleDbOn";
1076- this.checkBoxKancolleDbOn.Size = new System.Drawing.Size(48, 16);
1077- this.checkBoxKancolleDbOn.TabIndex = 0;
1078- this.checkBoxKancolleDbOn.Text = "有効";
1079- this.checkBoxKancolleDbOn.UseVisualStyleBackColor = true;
1080- //
1081999 // tabPageDebug
10821000 //
10831001 this.tabPageDebug.Controls.Add(this.buttonPlayDebugLog);
@@ -1227,16 +1145,11 @@ namespace KancolleSniffer
12271145 this.tabPageLog.ResumeLayout(false);
12281146 this.tabPageLog.PerformLayout();
12291147 ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaterialLogInterval)).EndInit();
1230- this.tabPageCollabo.ResumeLayout(false);
1231- this.tabControlCollabo.ResumeLayout(false);
1232- this.tabPagePushNotification.ResumeLayout(false);
1148+ this.tabPagePush.ResumeLayout(false);
12331149 this.groupBoxPushover.ResumeLayout(false);
12341150 this.groupBoxPushover.PerformLayout();
12351151 this.groupBoxPushbullet.ResumeLayout(false);
12361152 this.groupBoxPushbullet.PerformLayout();
1237- this.tabPageExternalService.ResumeLayout(false);
1238- this.groupBoxKancolleDb.ResumeLayout(false);
1239- this.groupBoxKancolleDb.PerformLayout();
12401153 this.tabPageDebug.ResumeLayout(false);
12411154 this.tabPageDebug.PerformLayout();
12421155 this.ResumeLayout(false);
@@ -1313,11 +1226,7 @@ namespace KancolleSniffer
13131226 private System.Windows.Forms.GroupBox groupBox3;
13141227 private System.Windows.Forms.GroupBox groupBox2;
13151228 private System.Windows.Forms.CheckBox checkBoxPresetAkashi;
1316- private System.Windows.Forms.TabPage tabPageCollabo;
1317- private System.Windows.Forms.GroupBox groupBoxKancolleDb;
1318- private System.Windows.Forms.TextBox textBoxKancolleDbToken;
1319- private System.Windows.Forms.Label label8;
1320- private System.Windows.Forms.CheckBox checkBoxKancolleDbOn;
1229+ private System.Windows.Forms.TabPage tabPagePush;
13211230 private System.Windows.Forms.ComboBox comboBoxZoom;
13221231 private System.Windows.Forms.Label label14;
13231232 private System.Windows.Forms.Label label15;
@@ -1331,14 +1240,11 @@ namespace KancolleSniffer
13311240 private System.Windows.Forms.CheckBox checkBoxLocationPerMachine;
13321241 private System.Windows.Forms.TextBox textBoxPushoverApiKey;
13331242 private System.Windows.Forms.CheckBox checkBoxPushoverOn;
1334- private System.Windows.Forms.TabControl tabControlCollabo;
1335- private System.Windows.Forms.TabPage tabPagePushNotification;
13361243 private System.Windows.Forms.GroupBox groupBoxPushover;
13371244 private System.Windows.Forms.Button buttonPushoverTest;
13381245 private System.Windows.Forms.Label label16;
13391246 private System.Windows.Forms.Label label12;
13401247 private System.Windows.Forms.TextBox textBoxPushoverUserKey;
1341- private System.Windows.Forms.TabPage tabPageExternalService;
13421248 private System.Windows.Forms.CheckBox checkBoxRepeat;
13431249 private System.Windows.Forms.CheckBox checkBoxBattleResult;
13441250 private System.Windows.Forms.CheckBox checkBoxAirBattleResult;
--- a/KancolleSniffer/ConfigDialog.cs
+++ b/KancolleSniffer/ConfigDialog.cs
@@ -100,8 +100,6 @@ namespace KancolleSniffer
100100 LoadLogSettings();
101101 LoadDebugSettings();
102102
103- checkBoxKancolleDbOn.Checked = _config.KancolleDb.On;
104- textBoxKancolleDbToken.Text = _config.KancolleDb.Token;
105103 checkBoxPushbulletOn.Checked = _config.Pushbullet.On;
106104 textBoxPushbulletToken.Text = _config.Pushbullet.Token;
107105 checkBoxPushoverOn.Checked = _config.Pushover.On;
@@ -145,8 +143,6 @@ namespace KancolleSniffer
145143 ApplyLogSettings();
146144 ApplyDebugSettings();
147145
148- _config.KancolleDb.On = checkBoxKancolleDbOn.Checked;
149- _config.KancolleDb.Token = textBoxKancolleDbToken.Text;
150146 _config.Pushbullet.On = checkBoxPushbulletOn.Checked;
151147 _config.Pushbullet.Token = textBoxPushbulletToken.Text;
152148 _config.Pushover.On = checkBoxPushoverOn.Checked;
--- a/KancolleSniffer/KancolleDb.cs
+++ /dev/null
@@ -1,115 +0,0 @@
1-// Copyright (C) 2015 Kazuhiro Fujieda <fujieda@users.osdn.me>
2-//
3-// Licensed under the Apache License, Version 2.0 (the "License");
4-// you may not use this file except in compliance with the License.
5-// You may obtain a copy of the License at
6-//
7-// http://www.apache.org/licenses/LICENSE-2.0
8-//
9-// Unless required by applicable law or agreed to in writing, software
10-// distributed under the License is distributed on an "AS IS" BASIS,
11-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-// See the License for the specific language governing permissions and
13-// limitations under the License.
14-
15-using System;
16-using System.Collections.Concurrent;
17-using System.Collections.Generic;
18-using System.Collections.Specialized;
19-using System.Net;
20-using System.Text.RegularExpressions;
21-using System.Threading.Tasks;
22-
23-namespace KancolleSniffer
24-{
25- public class KancolleDb
26- {
27- private readonly BlockingCollection<Tuple<string, string, string>> _queue =
28- new BlockingCollection<Tuple<string, string, string>>(10);
29-
30- private bool _started;
31- private string _token;
32-
33- public void Start(string token)
34- {
35- _token = token;
36- if (_started)
37- return;
38- _started = true;
39- Task.Run(() =>
40- {
41- try
42- {
43- while (true)
44- {
45- var e = _queue.Take();
46- try
47- {
48- using (var wc = new WebClient())
49- {
50- var values = new NameValueCollection
51- {
52- {"token", _token},
53- {"agent", "KdpR5STmwYTaFpNCbD4N"},
54- {"url", e.Item1},
55- {"requestbody", e.Item2},
56- {"responsebody", e.Item3}
57- };
58- wc.UploadValues("http://api.kancolle-db.net/2/", values);
59- }
60- }
61- catch (WebException)
62- {
63- }
64- }
65- }
66- catch (InvalidOperationException)
67- {
68- }
69- });
70- }
71-
72- private readonly HashSet<string> _urlSet = new HashSet<string>()
73- {
74- "/kcsapi/api_port/port",
75- "/kcsapi/api_get_member/ship2",
76- "/kcsapi/api_get_member/ship3",
77- "/kcsapi/api_get_member/slot_item",
78- "/kcsapi/api_get_member/kdock",
79- "/kcsapi/api_get_member/mapinfo",
80- "/kcsapi/api_req_hensei/change",
81- "/kcsapi/api_req_kousyou/createship",
82- "/kcsapi/api_req_kousyou/getship",
83- "/kcsapi/api_req_kousyou/createitem",
84- "/kcsapi/api_req_map/start",
85- "/kcsapi/api_req_map/next",
86- "/kcsapi/api_req_map/select_eventmap_rank",
87- "/kcsapi/api_req_sortie/battle",
88- "/kcsapi/api_req_battle_midnight/battle",
89- "/kcsapi/api_req_battle_midnight/sp_midnight",
90- "/kcsapi/api_req_sortie/night_to_day",
91- "/kcsapi/api_req_sortie/battleresult",
92- "/kcsapi/api_req_combined_battle/battle",
93- "/kcsapi/api_req_combined_battle/airbattle",
94- "/kcsapi/api_req_combined_battle/midnight_battle",
95- "/kcsapi/api_req_combined_battle/battleresult",
96- "/kcsapi/api_req_sortie/airbattle",
97- "/kcsapi/api_req_combined_battle/battle_water",
98- "/kcsapi/api_req_combined_battle/sp_midnight"
99- };
100-
101- public void Send(string url, string request, string response)
102- {
103- if (!_urlSet.Contains(url))
104- return;
105- request = Regex.Replace(request, @"&api%5Ftoken=[^&]+|api%5Ftoken=[^&]+&?", "");
106- response = response.Replace("svdata=", "");
107- _queue.TryAdd(new Tuple<string, string, string>(url, request, response));
108- }
109-
110- public void Stop()
111- {
112- _queue.CompleteAdding();
113- }
114- }
115-}
\ No newline at end of file
--- a/KancolleSniffer/KancolleSniffer.csproj
+++ b/KancolleSniffer/KancolleSniffer.csproj
@@ -98,7 +98,6 @@
9898 <Compile Include="ItemTreeView.cs">
9999 <SubType>Component</SubType>
100100 </Compile>
101- <Compile Include="KancolleDb.cs" />
102101 <Compile Include="JsonParser.cs" />
103102 <Compile Include="Logger.cs" />
104103 <Compile Include="LogServer.cs" />
--- a/KancolleSniffer/MainForm.cs
+++ b/KancolleSniffer/MainForm.cs
@@ -50,7 +50,6 @@ namespace KancolleSniffer
5050 private DateTime _prev, _now;
5151
5252 private readonly ErrorDialog _errorDialog = new ErrorDialog();
53- private readonly KancolleDb _kancolleDb = new KancolleDb();
5453 private readonly ErrorLog _errorLog;
5554
5655 public MainForm()
@@ -143,8 +142,6 @@ namespace KancolleSniffer
143142 WriteDebugLog(url, request, response);
144143 return;
145144 }
146- if (_config.KancolleDb.On)
147- _kancolleDb.Send(url, request, response);
148145 response = UnescapeString(response.Remove(0, "svdata=".Length));
149146 WriteDebugLog(url, request, response);
150147 ProcessRequestMain(url, request, response);
@@ -250,8 +247,6 @@ namespace KancolleSniffer
250247 ApplyDebugLogSetting();
251248 ApplyLogSetting();
252249 ApplyProxySetting();
253- if (_config.KancolleDb.On)
254- _kancolleDb.Start(_config.KancolleDb.Token);
255250 CheckVersionUp((current, latest) =>
256251 {
257252 if (double.Parse(latest) <= double.Parse(current))
@@ -305,7 +300,6 @@ namespace KancolleSniffer
305300 _config.ShipList.Visible = _listForm.Visible && _listForm.WindowState == FormWindowState.Normal;
306301 _config.Save();
307302 _proxyManager.Shutdown();
308- _kancolleDb.Stop();
309303 }
310304
311305 private void MainForm_Resize(object sender, EventArgs e)
@@ -384,8 +378,6 @@ namespace KancolleSniffer
384378 _sniffer.Achievement.ResetHours = _config.ResetHours;
385379 labelAkashiRepair.Visible = labelAkashiRepairTimer.Visible =
386380 labelPresetAkashiTimer.Visible = _config.UsePresetAkashi;
387- if (_config.KancolleDb.On)
388- _kancolleDb.Start(_config.KancolleDb.Token);
389381 }
390382
391383 public void ApplyDebugLogSetting()
旧リポジトリブラウザで表示