-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Description
It would be great if there is any method to find out, if there is running Stealth. Now it seems like the only way is something like:
var isRunning = false;
var checkThread = new Thread(() =>
{
// ScriptSDK is obviously missing reliable way to detect if Stealth is running or not
// This is ugly way, but I don't see any other option
try
{
// Now call any random method to make ScriptSDK send request to Stealth
// and possibly throw an exception if it fails
GameClient.GetClient().GetInfo();
isRunning = true;
}
catch (Exception) { }
});
watchThread = new Thread(() =>
{
try
{
setEnabled(stealthButton, false);
checkThread.Start();
if (!checkThread.Join(TimeSpan.FromSeconds(2)) || !isRunning)
checkThread.Abort();
else
setEnabled(stealthButton);
}
catch (ThreadAbortException)
{
checkThread.Abort();
}
});
Since I don't want to block WinForms window while checking Stealth, I have to use two different threads.
Please, can you make something like
StealthAPI.Stealth.IsRunning
to find out, if the connection is OK?
Maybe even test if there is two-way connection possible since I found out that if you run elevated(with admin role) ScriptSDK app, but Stealth is not elevated, you can send request and ScriptSDK will block thread forever, probably waiting for answer(which will not come).