WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Feature request: Check if Stealth is running #5

@Bosek

Description

@Bosek

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions