LeviLamina
Loading...
Searching...
No Matches
ScriptDebugger.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/debug/log/LogLevel.h"
7#include "mc/scripting/debugger/IScriptDebugger.h"
8#include "mc/scripting/diagnostics/IScriptStatPublisher.h"
9
10// auto generated forward declare list
11// clang-format off
16class ScriptStat;
17class ServerLevel;
19namespace Core { class Path; }
20namespace ScriptDebuggerMessages { struct CommandMessage; }
21namespace Scripting { class ScriptEngine; }
22namespace cereal { struct ReflectionCtx; }
23// clang-format on
24
25class ScriptDebugger : public ::IScriptDebugger, public ::IScriptStatPublisher {
26public:
27 // ScriptDebugger inner types declare
28 // clang-format off
29 struct AutoAttachTelem;
30 // clang-format on
31
32 // ScriptDebugger inner types define
33 enum class DebuggerMode : int {
34 Stopped = 0,
35 Connect = 1,
36 Listen = 2,
37 };
38
39 struct AutoAttachTelem {
40 public:
41 // member variables
42 // NOLINTBEGIN
45 // NOLINTEND
46
47 public:
48 // prevent constructor by default
49 AutoAttachTelem& operator=(AutoAttachTelem const&);
50 AutoAttachTelem(AutoAttachTelem const&);
51 AutoAttachTelem();
52 };
53
54public:
55 // member variables
56 // NOLINTBEGIN
74 // NOLINTEND
75
76public:
77 // prevent constructor by default
78 ScriptDebugger& operator=(ScriptDebugger const&);
79 ScriptDebugger(ScriptDebugger const&);
80 ScriptDebugger();
81
82public:
83 // virtual functions
84 // NOLINTBEGIN
85 virtual ~ScriptDebugger() /*override*/ = default;
86
87 virtual ::ScriptDebuggerSettings const& getSettings() const /*override*/;
88
89 virtual bool connect(::std::string const& host, ushort port) /*override*/;
90
91 virtual bool listen(ushort port) /*override*/;
92
93 virtual void stop() /*override*/;
94
95 virtual void startProfiler() /*override*/;
96
97 virtual ::std::vector<::Core::Path> stopProfiler() /*override*/;
98
99 virtual bool isStatPublisherEnabled() const /*override*/;
100
101 virtual void publishStats(uint64 collectedTick, ::std::vector<::ScriptStat> const& stats) /*override*/;
102 // NOLINTEND
103
104public:
105 // member functions
106 // NOLINTBEGIN
107 MCNAPI ScriptDebugger(
108 ::ScriptDebuggerSettings settings,
109 ::ServerLevel& serverLevel,
110 ::MinecraftCommands& commands,
111 ::cereal::ReflectionCtx& ctx,
112 ::Scripting::ScriptEngine& scriptEngine,
113 ::ScriptPluginManager& pluginManager,
114 ::IScriptDebuggerWatchdog& watchdog,
115 ::IScriptTelemetryLogger& telemetry
116 );
117
118 MCNAPI void _debuggerMessageHandler(::std::string_view message);
119
120 MCNAPI void _handleCommandMessage(::ScriptDebuggerMessages::CommandMessage const& commandMessage);
121
122 MCNAPI ::std::string _sanitizeHostName(::std::string const& host) const;
123
124 MCNAPI void _sendNotification(::LogLevel logLevel, ::std::string_view message);
125
126 MCNAPI bool _tryAttachRuntime(bool expectRuntime);
127
128 MCNAPI bool _trySelectTarget();
129
130 MCNAPI void sendLog(::LogLevel logLevel, ::std::string_view message);
131
132 MCNAPI void update();
133
134 MCNAPI void waitAutoAttach(::std::chrono::seconds waitDuration);
135 // NOLINTEND
136
137public:
138 // constructor thunks
139 // NOLINTBEGIN
140 MCNAPI void* $ctor(
141 ::ScriptDebuggerSettings settings,
142 ::ServerLevel& serverLevel,
143 ::MinecraftCommands& commands,
144 ::cereal::ReflectionCtx& ctx,
145 ::Scripting::ScriptEngine& scriptEngine,
146 ::ScriptPluginManager& pluginManager,
147 ::IScriptDebuggerWatchdog& watchdog,
148 ::IScriptTelemetryLogger& telemetry
149 );
150 // NOLINTEND
151
152public:
153 // virtual function thunks
154 // NOLINTBEGIN
155 MCNAPI ::ScriptDebuggerSettings const& $getSettings() const;
156
157 MCNAPI bool $connect(::std::string const& host, ushort port);
158
159 MCNAPI bool $listen(ushort port);
160
161 MCNAPI void $stop();
162
163 MCNAPI void $startProfiler();
164
165 MCNAPI ::std::vector<::Core::Path> $stopProfiler();
166
167 MCNAPI bool $isStatPublisherEnabled() const;
168
169 MCNAPI void $publishStats(uint64 collectedTick, ::std::vector<::ScriptStat> const& stats);
170
171
172 // NOLINTEND
173
174public:
175 // vftables
176 // NOLINTBEGIN
177 MCNAPI static void** $vftableForIScriptDebugger();
178
179 MCNAPI static void** $vftableForIScriptStatPublisher();
180 // NOLINTEND
181};
Definition CommandMessage.h:16
Definition Path.h:10
Definition IScriptDebuggerWatchdog.h:5
Definition IScriptDebugger.h:11
Definition IScriptStatPublisher.h:10
Definition IScriptTelemetryLogger.h:10
Definition MinecraftCommands.h:34
Definition Path.h:16
MCAPI void _handleCommandMessage(::ScriptDebuggerMessages::CommandMessage const &commandMessage)
MCAPI::ScriptDebuggerSettings const & $getSettings() const
MCAPI void _sendNotification(::LogLevel logLevel, ::std::string_view message)
MCAPI bool $listen(ushort port)
MCAPI bool $connect(::std::string const &host, ushort port)
MCAPI void * $ctor(::ScriptDebuggerSettings settings, ::ServerLevel &serverLevel, ::MinecraftCommands &commands, ::cereal::ReflectionCtx &ctx, ::Scripting::ScriptEngine &scriptEngine, ::ScriptPluginManager &pluginManager, ::IScriptDebuggerWatchdog &watchdog, ::IScriptTelemetryLogger &telemetry)
static MCAPI void ** $vftableForIScriptStatPublisher()
MCAPI::std::string _sanitizeHostName(::std::string const &host) const
MCAPI bool $isStatPublisherEnabled() const
static MCAPI void ** $vftableForIScriptDebugger()
MCAPI void $startProfiler()
MCAPI void update()
MCAPI bool _trySelectTarget()
MCAPI void _debuggerMessageHandler(::std::string_view message)
MCAPI ::std::vector<::Core::Path > $stopProfiler()
MCAPI void $publishStats(uint64 collectedTick, ::std::vector<::ScriptStat > const &stats)
MCAPI void $stop()
MCAPI void sendLog(::LogLevel logLevel, ::std::string_view message)
MCAPI void waitAutoAttach(::std::chrono::seconds waitDuration)
MCAPI bool _tryAttachRuntime(bool expectRuntime)
Definition ScriptPluginManager.h:25
Definition ScriptStat.h:10
Definition ScriptEngine.h:21
Definition ServerLevel.h:50
STL namespace.
Definition CommandMessage.h:7
Definition ScriptDebuggerSettings.h:8
Definition ScriptDebugger.h:39
Definition ReflectionCtx.h:11
Definition ctx.h:5
Definition Alias.h:14