mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-18 00:21:33 -07:00
improve Watcher
ctor macro exclusions
This commit is contained in:
parent
d0f1b9de22
commit
49fd8eb2d2
@ -28,21 +28,21 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
string? watcherDataArg = App.LaunchSettings.WatcherFlag.Data;
|
string? watcherDataArg = App.LaunchSettings.WatcherFlag.Data;
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
if (String.IsNullOrEmpty(watcherDataArg))
|
if (String.IsNullOrEmpty(watcherDataArg))
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
string path = new RobloxPlayerData().ExecutablePath;
|
string path = new RobloxPlayerData().ExecutablePath;
|
||||||
using var gameClientProcess = Process.Start(path);
|
using var gameClientProcess = Process.Start(path);
|
||||||
|
|
||||||
_watcherData = new() { ProcessId = gameClientProcess.Id };
|
_watcherData = new() { ProcessId = gameClientProcess.Id };
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
if (String.IsNullOrEmpty(watcherDataArg))
|
|
||||||
throw new Exception("Watcher data not specified");
|
throw new Exception("Watcher data not specified");
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
if (!String.IsNullOrEmpty(watcherDataArg))
|
else
|
||||||
|
{
|
||||||
_watcherData = JsonSerializer.Deserialize<WatcherData>(Encoding.UTF8.GetString(Convert.FromBase64String(watcherDataArg)));
|
_watcherData = JsonSerializer.Deserialize<WatcherData>(Encoding.UTF8.GetString(Convert.FromBase64String(watcherDataArg)));
|
||||||
|
}
|
||||||
|
|
||||||
if (_watcherData is null)
|
if (_watcherData is null)
|
||||||
throw new Exception("Watcher data is invalid");
|
throw new Exception("Watcher data is invalid");
|
||||||
|
Loading…
Reference in New Issue
Block a user