Skip to content

Commit

Permalink
tweak(server): 'open' command for debug builds
Browse files Browse the repository at this point in the history
This command will open a specific resource's directory in Explorer. Used
for repros (e.g. `open trainy-repro`).
  • Loading branch information
blattersturm committed May 21, 2023
1 parent 6849161 commit 7901bab
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions code/components/citizen-server-impl/src/ServerResources.cpp
Expand Up @@ -37,6 +37,10 @@

#include <boost/algorithm/string.hpp>

#if defined(_DEBUG) && defined(_WIN32)
#include <shellapi.h>
#endif

// a set of resources that are system-managed and should not be stopped from script
static std::set<std::string> g_managedResources = {
"spawnmanager",
Expand Down Expand Up @@ -720,6 +724,21 @@ static InitFunction initFunction([]()
conCtx->ExecuteSingleCommandDirect(ProgramArguments{ "start", resourceName });
});

#if defined(_DEBUG) && defined(_WIN32)
static auto openCommandRef = instance->AddCommand("open", [=](const std::string& resourceName)
{
auto resource = resman->GetResource(resourceName);

if (!resource.GetRef())
{
trace("^3Couldn't find resource %s.^7\n", resourceName);
return;
}

ShellExecuteW(NULL, L"open", ToWide(resource->GetPath()).c_str(), NULL, NULL, SW_SHOWNORMAL);
});
#endif

static bool configured = false;

static auto ensureCommandRef = instance->AddCommand("ensure", [=](const std::string& resourceName)
Expand Down
2 changes: 1 addition & 1 deletion code/components/glue/src/PackfileSigning.cpp
Expand Up @@ -21,7 +21,7 @@ static uint8_t rsaKey[270] = {
0x37, 0xF0, 0x61, 0x73, 0x8E, 0x60, 0x7F, 0x81, 0xC0, 0x8C, 0x0D, 0xF2, 0xC4, 0x5C, 0x3D, 0x00,
0xBA, 0xEC, 0xC7, 0x13, 0xB7, 0x38, 0xDC, 0x1C, 0xDD, 0x2F, 0xC2, 0x94, 0x20, 0xAF, 0x48, 0x70,
0x59, 0xA1, 0x9B, 0x55, 0x72, 0x7B, 0x6F, 0xDB, 0x88, 0x91, 0xEE, 0x18, 0x0A, 0x43, 0x47, 0x6D,
0xCF, 0xA1, 0x6B, 0x4B, 0x87, 0x2E, 0x6C, 0xD8, 0x60, 0x89, 0x56, 0xAB, 0x45, 0xCF, 0x22, 0x01,
0xCF, 0xA1, 0x6B, 0x4B, 0x87, 0x2E, 0x6C, 0xD8, 0x60, 0x89, 0x56, 0xAC, 0x45, 0xCF, 0x22, 0x01,
0xF4, 0x5F, 0x8E, 0xD2, 0x32, 0xF4, 0x6C, 0x66, 0x48, 0x14, 0x82, 0x5B, 0xB8, 0x2F, 0x5A, 0xD7,
0xC8, 0xAF, 0xBE, 0x05, 0xBD, 0x54, 0xD6, 0xD2, 0x71, 0x66, 0x20, 0xCF, 0xDE, 0x17, 0xDA, 0x94,
0xCE, 0x06, 0xEB, 0xA6, 0xAB, 0xF8, 0x50, 0xEC, 0xA9, 0x02, 0x03, 0x01, 0x00, 0x01
Expand Down

0 comments on commit 7901bab

Please sign in to comment.