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