Skip to content

Commit

Permalink
Fix CI compile probably
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed May 31, 2023
1 parent 6cbdd7e commit df60b7a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
1 change: 1 addition & 0 deletions shared/sdk/CVar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct TConsoleVariableData {
// The functions will actually dynamically scan the vtable for the right index
struct IConsoleObject {
virtual ~IConsoleObject() {}
virtual wchar_t* GetHelp() const = 0;
};

struct IConsoleVariable : IConsoleObject {
Expand Down
6 changes: 3 additions & 3 deletions shared/sdk/ConsoleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include "ConsoleManager.hpp"

namespace sdk {
IConsoleManager* get_console_manager() {
static auto result = []() -> IConsoleManager** {
FConsoleManager* FConsoleManager::get() {
static auto result = []() -> FConsoleManager** {
SPDLOG_INFO("Finding IConsoleManager...");

const auto core_module = sdk::get_ue_module(L"Core");
Expand Down Expand Up @@ -81,7 +81,7 @@ IConsoleManager* get_console_manager() {
SPDLOG_INFO("Found IConsoleManager**: {:x}", (uintptr_t)std::get<0>(*highest_global_variable_reference));
SPDLOG_INFO("Points to IConsoleManager*: {:x}", *(uintptr_t*)std::get<0>(*highest_global_variable_reference));

return (IConsoleManager**)std::get<0>(*highest_global_variable_reference);
return (FConsoleManager**)std::get<0>(*highest_global_variable_reference);
}();

if (result == nullptr) {
Expand Down
41 changes: 39 additions & 2 deletions shared/sdk/ConsoleManager.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
#pragma once

namespace sdk {
class IConsoleManager;
struct IConsoleObject;

IConsoleManager* get_console_manager();
struct ConsoleObjectElement {
wchar_t* key;
int32_t unk[2];
IConsoleObject* value;
int32_t unk2[2];
};

struct ConsoleObjectArray {
ConsoleObjectElement* elements;
uint32_t count;
uint32_t capacity;

// begin end
ConsoleObjectElement* begin() {
return elements;
}

ConsoleObjectElement* end() {
return elements + count;
}
};

class IConsoleManager {
public:
virtual ~IConsoleManager() {}
};

class FConsoleManager : public IConsoleManager {
public:
static FConsoleManager* get();

ConsoleObjectArray& get_console_objects() {
return m_console_objects;
}

private:
ConsoleObjectArray m_console_objects;
};
}

0 comments on commit df60b7a

Please sign in to comment.