- Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathMainWindow.xaml.cs
48 lines (38 loc) · 1.46 KB
/
MainWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
usingSystem.ComponentModel;
usingButtplug.Components.Controls;
namespaceButtplug.Apps.ServerGUI
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
publicpartialclassMainWindow
{
privatereadonlyServerControl_wsTab;
publicMainWindow()
{
varconfig=newButtplugConfig("Buttplug");
uintping=0;
// As long as the server is websocket only, we can depend on websocket ping as an
// application keepalive. Once we support both IPC and WebSocket, we should implement
// required ping for IPC.
// uint.TryParse(config.GetValue("buttplug.server.maxPing", "1000"), out ping);
InitializeComponent();
longlogLimit=1000;
if(long.TryParse(config.GetValue("buttplug.log.max","1000"),outlongres))
{
logLimit=res;
}
ButtplugTab.GetLogControl().MaxLogs=logLimit;
ButtplugTab.SetServerDetails("Websocket Server",ping);
_wsTab=newServerControl(ButtplugTab);
ButtplugTab.SetApplicationTab("Websocket Server",_wsTab);
ButtplugTab.GetAboutControl().CheckUpdate(config,"buttplug-csharp");
Closing+=ClosingHandler;
_wsTab.StartServer();
}
privatevoidClosingHandler(objectaObj,CancelEventArgse)
{
_wsTab?.StopServer();
}
}
}