|
10 | 10 | using System.Text;
|
11 | 11 | using System.Threading.Tasks;
|
12 | 12 | using System.Windows.Forms;
|
13 |
| -using WebSocketSharp; |
14 |
| -using WebSocketSharp.Server; |
| 13 | +//using WebSocketSharp; |
| 14 | +//using WebSocketSharp.Server; |
15 | 15 |
|
16 | 16 | namespace StarSharksTool
|
17 | 17 | {
|
18 | 18 |
|
19 |
| - public class Laputa : WebSocketBehavior |
20 |
| - { |
21 |
| - protected override void OnMessage(MessageEventArgs e) |
22 |
| - { |
23 |
| - var s = int.TryParse(e.Data, out int val); |
24 |
| - if (s == true) |
25 |
| - { |
26 |
| - Services.Service.RentedSharkIds.Add(val); |
27 |
| - } |
28 |
| - } |
29 |
| - } |
30 |
| - public class GasUsage : WebSocketBehavior |
31 |
| - { |
32 |
| - protected override void OnMessage(MessageEventArgs e) |
33 |
| - { |
34 |
| - var res = JsonConvert.DeserializeObject<Dictionary<int, decimal>>(e.Data); |
35 |
| - Global.DynamicGASPrice = res; |
36 |
| - } |
37 |
| - } |
| 19 | + //public class Laputa : WebSocketBehavior |
| 20 | + //{ |
| 21 | + // protected override void OnMessage(MessageEventArgs e) |
| 22 | + // { |
| 23 | + // var s = int.TryParse(e.Data, out int val); |
| 24 | + // if (s == true) |
| 25 | + // { |
| 26 | + // Services.Service.RentedSharkIds.Add(val); |
| 27 | + // } |
| 28 | + // } |
| 29 | + //} |
| 30 | + //public class GasUsage : WebSocketBehavior |
| 31 | + //{ |
| 32 | + // protected override void OnMessage(MessageEventArgs e) |
| 33 | + // { |
| 34 | + // var res = JsonConvert.DeserializeObject<Dictionary<int, decimal>>(e.Data); |
| 35 | + // Global.DynamicGASPrice = res; |
| 36 | + // } |
| 37 | + //} |
38 | 38 | public partial class BlackListListenerForm : Form
|
39 | 39 | {
|
40 |
| - static IPAddress ipAd = IPAddress.Parse("127.0.0.1"); |
41 |
| - static int PortNumber = 8888; |
42 |
| - WebSocketServer wssv; |
43 |
| - public BlackListListenerForm() |
44 |
| - { |
45 |
| - InitializeComponent(); |
46 |
| - } |
| 40 | + //static IPAddress ipAd = IPAddress.Parse("127.0.0.1"); |
| 41 | + //static int PortNumber = 8888; |
| 42 | + //WebSocketServer wssv; |
| 43 | + //public BlackListListenerForm() |
| 44 | + //{ |
| 45 | + // InitializeComponent(); |
| 46 | + //} |
47 | 47 |
|
48 |
| - private void BlackListListenerForm_Load(object sender, EventArgs e) |
49 |
| - { |
50 |
| - Thread ThreadingServer = new Thread(StartServer); |
51 |
| - ThreadingServer.Start(); |
52 |
| - } |
| 48 | + //private void BlackListListenerForm_Load(object sender, EventArgs e) |
| 49 | + //{ |
| 50 | + // Thread ThreadingServer = new Thread(StartServer); |
| 51 | + // ThreadingServer.Start(); |
| 52 | + //} |
53 | 53 |
|
54 |
| - private void THREAD_MOD(string teste) |
55 |
| - { |
56 |
| - txtStatus.Text += Environment.NewLine + teste; |
57 |
| - } |
| 54 | + //private void THREAD_MOD(string teste) |
| 55 | + //{ |
| 56 | + // txtStatus.Text += Environment.NewLine + teste; |
| 57 | + //} |
58 | 58 |
|
59 |
| - private void StartServer() |
60 |
| - { |
61 |
| - wssv = new WebSocketServer(ipAd, PortNumber); |
| 59 | + //private void StartServer() |
| 60 | + //{ |
| 61 | + // wssv = new WebSocketServer(ipAd, PortNumber); |
62 | 62 |
|
63 |
| - wssv.AddWebSocketService<Laputa>("/BlackIdReport"); |
64 |
| - wssv.AddWebSocketService<GasUsage>("/GasUsage"); |
65 |
| - wssv.Start(); |
66 |
| - } |
| 63 | + // wssv.AddWebSocketService<Laputa>("/BlackIdReport"); |
| 64 | + // wssv.AddWebSocketService<GasUsage>("/GasUsage"); |
| 65 | + // wssv.Start(); |
| 66 | + //} |
67 | 67 |
|
68 |
| - private void BlackListListenerForm_FormClosing(object sender, FormClosingEventArgs e) |
69 |
| - { |
70 |
| - wssv.Stop(); |
71 |
| - } |
| 68 | + //private void BlackListListenerForm_FormClosing(object sender, FormClosingEventArgs e) |
| 69 | + //{ |
| 70 | + // wssv.Stop(); |
| 71 | + //} |
72 | 72 | }
|
73 | 73 | }
|
0 commit comments