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