diff options
| author | Stefan Boberg <[email protected]> | 2023-05-02 10:01:47 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-02 10:01:47 +0200 |
| commit | 075d17f8ada47e990fe94606c3d21df409223465 (patch) | |
| tree | e50549b766a2f3c354798a54ff73404217b4c9af /src/zen/cmds/status.cpp | |
| parent | fix: bundle shouldn't append content zip to zen (diff) | |
| download | archived-zen-075d17f8ada47e990fe94606c3d21df409223465.tar.xz archived-zen-075d17f8ada47e990fe94606c3d21df409223465.zip | |
moved source directories into `/src` (#264)
* moved source directories into `/src`
* updated bundle.lua for new `src` path
* moved some docs, icon
* removed old test trees
Diffstat (limited to 'src/zen/cmds/status.cpp')
| -rw-r--r-- | src/zen/cmds/status.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/zen/cmds/status.cpp b/src/zen/cmds/status.cpp new file mode 100644 index 000000000..23c27f9f9 --- /dev/null +++ b/src/zen/cmds/status.cpp @@ -0,0 +1,41 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "status.h" + +#include <zencore/logging.h> +#include <zencore/string.h> +#include <zencore/uid.h> +#include <zenutil/zenserverprocess.h> + +namespace zen { + +StatusCommand::StatusCommand() +{ +} + +StatusCommand::~StatusCommand() = default; + +int +StatusCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) +{ + ZEN_UNUSED(GlobalOptions, argc, argv); + + ZenServerState State; + if (!State.InitializeReadOnly()) + { + ZEN_CONSOLE("no Zen state found"); + + return 0; + } + + ZEN_CONSOLE("{:>5} {:>6} {:>24}", "port", "pid", "session"); + State.Snapshot([&](const ZenServerState::ZenServerEntry& Entry) { + StringBuilder<25> SessionStringBuilder; + Entry.GetSessionId().ToString(SessionStringBuilder); + ZEN_CONSOLE("{:>5} {:>6} {:>24}", Entry.EffectiveListenPort, Entry.Pid, SessionStringBuilder.ToString()); + }); + + return 0; +} + +} // namespace zen |