public MainWindow() { var config = new ButtplugConfig("B******g"); uint ping = 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("b******g.server.maxPing", "1000"), out ping); InitializeComponent(); long logLimit = 1000; if (long.TryParse(config.GetValue("b******g.log.max", "1000"), out long res)) { logLimit = res; } ButtplugTab.GetLogControl().MaxLogs = logLimit; ButtplugTab.SetServerDetails("Websocket Server", ping); _wsTab = new ServerControl(ButtplugTab); ButtplugTab.SetApplicationTab("Websocket Server", _wsTab); ButtplugTab.GetAboutControl().CheckUpdate(config, "b******g-csharp"); Closing += ClosingHandler; _wsTab.StartServer(); }
public MainWindow() { InitializeComponent(); if (Application.Current == null) { return; } ButtplugTab.SetServerDetails("Kiiroo Emulator", 0); _bpServer = ButtplugTab.GetServer(); _bpServer.SendMessage(new RequestServerInfo("Kiiroo Emulator")).Wait(); InitializeComponent(); _kiirooEmulator = new KiirooPlatformEmulator(); _kiirooEmulator.OnKiirooPlatformEvent += HandleKiirooPlatformMessage; _kiirooEmulator.OnException += HandleKiirooPlatformMessage; _translator = new KiirooMessageTranslator(); _translator.VibrateEvent += OnVibrateEvent; _ops = new List <DispatcherOperation>(); var emu = new KiirooEmulatorPanel(); ButtplugTab.AddDevicePanel(_bpServer); ButtplugTab.SetApplicationTab("Kiiroo Emulator", emu); Closing += ClosingHandler; StartServer(); emu.ServerStatusChanged += OnServerStatusChanged; ButtplugTab.SelectedDevicesChanged += SelectionChangedHandler; var config = new ButtplugConfig("B******g"); ButtplugTab.GetAboutControl().CheckUpdate(config, "b******g-csharp"); }
public MainWindow() { InitializeComponent(); if (Application.Current == null) { return; } ButtplugTab.GetLogControl().MaxLogs = 10000; ButtplugTab.SetServerDetails("Game Vibration Router Server", 0); _bpServer = ButtplugTab.GetServer(); _log = LogManager.GetCurrentClassLogger(); ButtplugGameVibrationRouterInterface.VibrationCommandReceived += OnVibrationCommand; ButtplugGameVibrationRouterInterface.VibrationPingMessageReceived += OnVibrationPingMessage; ButtplugGameVibrationRouterInterface.VibrationExceptionReceived += OnVibrationException; ButtplugGameVibrationRouterInterface.VibrationExitReceived += OnVibrationExit; Task.FromResult(_bpServer.SendMessage(new RequestServerInfo("B******g Game Vibration Router"))); _processTab = new ProcessTab(); _processTab.ProcessAttachRequested += OnAttachRequested; _processTab.ProcessDetachRequested += OnDetachRequested; ButtplugTab.SetApplicationTab("Processes", _processTab); ButtplugTab.AddDevicePanel(_bpServer); ButtplugTab.SelectedDevicesChanged += OnSelectedDevicesChanged; var config = new ButtplugConfig("B******g"); ButtplugTab.GetAboutControl().CheckUpdate(config, "b******g-csharp"); }
public MainWindow() { var config = new ButtplugConfig("B******g"); uint ping; uint.TryParse(config.GetValue("b******g.server.maxPing", "1000"), out ping); InitializeComponent(); long logLimit = 1000; if (long.TryParse(config.GetValue("b******g.log.max", "1000"), out long res)) { logLimit = res; } ButtplugTab.GetLogControl().MaxLogs = logLimit; ButtplugTab.SetServerDetails("Websocket Server", ping); _wsTab = new WebsocketServerControl(ButtplugTab); ButtplugTab.SetApplicationTab("Websocket Server", _wsTab); ButtplugTab.GetAboutControl().CheckUpdate(config, "b******g-csharp"); Closing += ClosingHandler; _wsTab.StartServer(); }
public MainWindow() { InitializeComponent(); if (Application.Current == null) { return; } ButtplugTab.GetLogControl().MaxLogs = 10000; ButtplugTab.SetServerDetails("Game Vibration Router Server", 0); _bpServer = ButtplugTab.GetServer(); _log = LogManager.GetCurrentClassLogger(); ButtplugGameVibrationRouterInterface.VibrationCommandReceived += OnVibrationCommand; ButtplugGameVibrationRouterInterface.VibrationPingMessageReceived += OnVibrationPingMessage; ButtplugGameVibrationRouterInterface.VibrationExceptionReceived += OnVibrationException; ButtplugGameVibrationRouterInterface.VibrationExitReceived += OnVibrationExit; Task.FromResult(_bpServer.SendMessage(new RequestServerInfo("B******g Game Vibration Router"))); _graphTab = new VibeGraphTab(); ButtplugTab.SetOtherTab("Vibes", _graphTab); _processTab = new ProcessTab(); _processTab.ProcessAttachRequested += OnAttachRequested; _processTab.ProcessDetachRequested += OnDetachRequested; ButtplugTab.SetApplicationTab("Processes", _processTab); ButtplugTab.AddDevicePanel(_bpServer); ButtplugTab.SelectedDevicesChanged += OnSelectedDevicesChanged; _graphTab.MultiplierChanged += MultiplierChanged; _graphTab.BaselineChanged += BaselineChanged; _graphTab.PassthruChanged += PassthruChanged; var config = new ButtplugConfig("B******g"); ButtplugTab.GetAboutControl().CheckUpdate(config, "b******g-csharp"); runTimer = new Timer { Interval = 100, AutoReset = true }; runTimer.Elapsed += AddPoint; commandTimer = new Timer { Interval = 50, AutoReset = true }; commandTimer.Elapsed += OnVibrationTimer; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12; }