Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirdEyeSqueegee committed Oct 27, 2023
1 parent e3a22e6 commit 41f0f1f
Show file tree
Hide file tree
Showing 19 changed files with 137 additions and 139 deletions.
7 changes: 6 additions & 1 deletion CommonLibSF/include/RE/B/BSLog.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once

#include "RE/B/BSFixedString.h"
#include "RE/B/BSLock.h"
#include "RE/B/BSSystemFile.h"
Expand All @@ -8,9 +9,12 @@ namespace RE
class BSLog
{
~BSLog();

BSLog() = delete;

BSLog(const BSLog&) = delete;
BSLog(BSLog&&) = delete;

BSLog(
const char* a_logName,
const char* a_logFolderPath,
Expand All @@ -36,6 +40,7 @@ namespace RE
std::uint32_t a_logNumber,
std::uint32_t a_bufferSize,
std::uint32_t a_blocks_allocated);

void dtor();

public:
Expand All @@ -62,4 +67,4 @@ namespace RE
std::byte unk248[0x38]; // 248
};
static_assert(sizeof(BSLog) == 0x280);
}
}
7 changes: 6 additions & 1 deletion CommonLibSF/include/RE/B/BSSystemFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ namespace RE
kAccessDenied = 5,
kOtherFileError = 6
};

enum class AccessMode : std::uint32_t
{
kRead = 0,
kReadWrite = 1,
kWriteOnly = 2
};

enum class OpenMode : std::uint32_t
{
kOpenExisting = 0,
Expand All @@ -29,6 +31,7 @@ namespace RE
kTruncateExisting = 3,
kCreateIfNotExist = 4
};

enum class ShareMode : std::uint32_t
{
kExclusive = 0,
Expand All @@ -43,9 +46,11 @@ namespace RE
kCurrent = 1,
kEnd = 2
};

BSSystemFile();

~BSSystemFile();
BSSystemFile();

BSSystemFile(
const char* a_path,
AccessMode a_accessMode,
Expand Down
72 changes: 34 additions & 38 deletions CommonLibSF/include/RE/E/ErrorLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,46 @@
#include "RE/B/BSTEvent.h"
#include "RE/I/ICachedErrorMessage.h"

namespace RE
namespace RE::BSScript
{
namespace BSScript
class ICachedErrorMessage;

struct LogEvent;

class __declspec(novtable) ErrorLogger :
public BSTEventSource<LogEvent> // 08
{
class ICachedErrorMessage;
public:
SF_RTTI_VTABLE(BSScript__ErrorLogger);

struct LogEvent;
enum class Severity
{
kInfo,
kWarning,
kError,
kFatal
};

class __declspec(novtable) ErrorLogger :
public BSTEventSource<LogEvent> // 08
struct PerThreadErrorCounts
{
public:
static constexpr auto RTTI{ RTTI::BSScript__ErrorLogger };
static constexpr auto VTABLE{ VTABLE::BSScript__ErrorLogger };

enum class Severity
{
kInfo,
kWarning,
kError,
kFatal
};

struct PerThreadErrorCounts
{
public:
// members
std::uint32_t fatalCount; // 0
std::uint32_t errorCount; // 4
std::uint32_t warningCount; // 8
};
static_assert(sizeof(PerThreadErrorCounts) == 0xC);

virtual ~ErrorLogger(); // 00

// add
virtual void PostErrorImpl(const ICachedErrorMessage* a_errMsg, Severity a_severity) = 0; // 01
virtual void ResetImpl() { return; } // 02

// members
const BSFixedString logName; // 28
BSSpinLock dataLock; // 30
/*BSTHashMap<std::uint32_t, ErrorLogger::PerThreadErrorCounts>*/ std::byte threadErrors[0x38]; // 38
std::uint32_t fatalCount; // 0
std::uint32_t errorCount; // 4
std::uint32_t warningCount; // 8
};
static_assert(sizeof(ErrorLogger) == 0x70);
}
static_assert(sizeof(PerThreadErrorCounts) == 0xC);

virtual ~ErrorLogger(); // 00

// add
virtual void PostErrorImpl(const ICachedErrorMessage* a_errMsg, Severity a_severity) = 0; // 01
virtual void ResetImpl() { return; } // 02

// members
const BSFixedString logName; // 28
BSSpinLock dataLock; // 30
/*BSTHashMap<std::uint32_t, ErrorLogger::PerThreadErrorCounts>*/ std::byte threadErrors[0x38]; // 38
};
static_assert(sizeof(ErrorLogger) == 0x70);
}
22 changes: 9 additions & 13 deletions CommonLibSF/include/RE/I/ICachedErrorMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@

#include "RE/B/BSFixedString.h"

namespace RE
namespace RE::BSScript
{
namespace BSScript
class __declspec(novtable) ICachedErrorMessage
{
class __declspec(novtable) ICachedErrorMessage
{
public:
static constexpr auto RTTI{ RTTI::BSScript__ICachedErrorMessage };
static constexpr auto VTABLE{ VTABLE::BSScript__ICachedErrorMessage };
public:
SF_RTTI_VTABLE(BSScript__ICachedErrorMessage);

virtual ~ICachedErrorMessage() = default; // 00
virtual ~ICachedErrorMessage() = default; // 00

// add
virtual void GetErrorMsg(BSFixedString& a_message) const = 0; // 01
};
static_assert(sizeof(ICachedErrorMessage) == 0x8);
}
// add
virtual void GetErrorMsg(BSFixedString& a_message) const = 0; // 01
};
static_assert(sizeof(ICachedErrorMessage) == 0x8);
}
28 changes: 12 additions & 16 deletions CommonLibSF/include/RE/I/ISavePatcherInterface.h
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
#pragma once

namespace RE
namespace RE::BSScript
{
namespace BSScript
{
class IVirtualMachine;
class StackFrame;
class IVirtualMachine;
class StackFrame;

class ISavePatcherInterface
{
public:
static constexpr auto RTTI{ RTTI::BSScript__ISavePatcherInterface };
static constexpr auto VTABLE{ VTABLE::BSScript__ISavePatcherInterface };
class ISavePatcherInterface
{
public:
SF_RTTI_VTABLE(BSScript__ISavePatcherInterface);

virtual ~ISavePatcherInterface() = default; // 00
virtual ~ISavePatcherInterface() = default; // 00

// add
virtual void PatchStackFrame(StackFrame&, IVirtualMachine&) = 0; // 01
};
static_assert(sizeof(ISavePatcherInterface) == 0x8);
}
// add
virtual void PatchStackFrame(StackFrame&, IVirtualMachine&) = 0; // 01
};
static_assert(sizeof(ISavePatcherInterface) == 0x8);
}
28 changes: 12 additions & 16 deletions CommonLibSF/include/RE/I/IVMDebugInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,20 @@

#include "RE/B/BSFixedString.h"

namespace RE
namespace RE::BSScript
{
namespace BSScript
class __declspec(novtable) IVMDebugInterface
{
class __declspec(novtable) IVMDebugInterface
{
public:
static constexpr auto RTTI{ RTTI::BSScript__IVMDebugInterface };
static constexpr auto VTABLE{ VTABLE::BSScript__IVMDebugInterface };
public:
SF_RTTI_VTABLE(BSScript__IVMDebugInterface);

virtual ~IVMDebugInterface(); // 00
virtual ~IVMDebugInterface(); // 00

virtual void DumpRunningStacksToLog() = 0; // 01
virtual void DumpStackFrameToLog(unsigned int a_v, unsigned int b_v, bool a_flag) = 0; // 02
virtual void GetStackFrame(unsigned int a_v, unsigned int b_v, bool a_flag, BSFixedString& a_identifier) = 0; // 03
virtual void DumpPersistenceInformationToLog(char const* logfile, uint64_t a_v) const = 0; // 04
virtual void DumpEventRelayInformationToLog(char const* logfile, uint64_t a_v, BSFixedString const& a_string) const = 0; // 05
};
static_assert(sizeof(IVMDebugInterface) == 0x8);
}
virtual void DumpRunningStacksToLog() = 0; // 01
virtual void DumpStackFrameToLog(unsigned int a_v, unsigned int b_v, bool a_flag) = 0; // 02
virtual void GetStackFrame(unsigned int a_v, unsigned int b_v, bool a_flag, BSFixedString& a_identifier) = 0; // 03
virtual void DumpPersistenceInformationToLog(char const* logfile, uint64_t a_v) const = 0; // 04
virtual void DumpEventRelayInformationToLog(char const* logfile, uint64_t a_v, BSFixedString const& a_string) const = 0; // 05
};
static_assert(sizeof(IVMDebugInterface) == 0x8);
}
2 changes: 1 addition & 1 deletion CommonLibSF/include/RE/I/IVMFunctionMessageDispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace RE::BSScript::Internal
class __declspec(novtable) IVMFunctionMessageDispatch
{
public:
static constexpr auto RTTI{ RTTI::BSScript__Internal__IVMFunctionMessageDispatch };
SF_RTTI(BSScript__Internal__IVMFunctionMessageDispatch);
// VTable got optimized out?

virtual void Unk00(); // 00
Expand Down
23 changes: 10 additions & 13 deletions CommonLibSF/include/RE/I/IVMRemoteDebuggerInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@

#include "RE/B/BSFixedString.h"

namespace RE
namespace RE::BSScript
{
namespace BSScript
class __declspec(novtable) IVMRemoteDebuggerInterface
{
class __declspec(novtable) IVMRemoteDebuggerInterface
{
public:
SF_RTTI_VTABLE(BSScript__IVMRemoteDebuggerInterface);
public:
SF_RTTI_VTABLE(BSScript__IVMRemoteDebuggerInterface);

~IVMRemoteDebuggerInterface() = delete;
~IVMRemoteDebuggerInterface() = delete;

virtual void Unk00(); // 00 -- calls Unk05 in IVirtualMachine
virtual void Unk01(); // 01
virtual void Unk02(); // 02
};
static_assert(sizeof(IVMRemoteDebuggerInterface) == 0x8);
}
virtual void Unk00(); // 00 -- calls Unk05 in IVirtualMachine
virtual void Unk01(); // 01
virtual void Unk02(); // 02
};
static_assert(sizeof(IVMRemoteDebuggerInterface) == 0x8);
}
3 changes: 1 addition & 2 deletions CommonLibSF/include/RE/I/IVMSaveLoadInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ namespace RE
class __declspec(novtable) IVMSaveLoadInterface
{
public:
static constexpr auto RTTI{ RTTI::BSScript__IVMSaveLoadInterface };
static constexpr auto VTABLE{ VTABLE::BSScript__IVMSaveLoadInterface };
SF_RTTI_VTABLE(BSScript__IVMSaveLoadInterface);

virtual ~IVMSaveLoadInterface(); // 00

Expand Down
5 changes: 3 additions & 2 deletions CommonLibSF/include/RE/I/IVirtualMachine.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once

#include "RE/B/BSIntrusiveRefCounted.h"
#include "RE/B/BSTSmartPointer.h"

namespace RE
{
template <class F>
Expand Down Expand Up @@ -39,8 +41,7 @@ namespace RE
public BSIntrusiveRefCounted // 08
{
public:
static constexpr auto RTTI{ RTTI::BSScript__IVirtualMachine };
static constexpr auto VTABLE{ VTABLE::BSScript__IVirtualMachine };
SF_RTTI_VTABLE(BSScript__IVirtualMachine);

virtual ~IVirtualMachine() = default; // 00

Expand Down
8 changes: 7 additions & 1 deletion CommonLibSF/include/RE/I/idLogging.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ namespace RE
struct ILogger
{
SF_RTTI_VTABLE(idLogging__ILogger);

~ILogger() = default; // 00

virtual bool ShouldLog(Severity severity) = 0; // 01
virtual void Log(const char* a_fileName, int a_line_number, Severity severity, const char* msg) = 0; // 02

void Printf(const char* a_fileName, int a_line_number, Severity severity, const char* a_fmt, ...)
{
va_list args;
Expand All @@ -38,9 +41,12 @@ namespace RE
struct NetSocketLogger : public idLogging::ILogger
{
SF_RTTI_VTABLE(__NetSocketLogger);

~NetSocketLogger() = default; // 00

// override idLogging::ILogger
bool ShouldLog([[maybe_unused]] idLogging::Severity severity) override { return false; } // 01

void Log(const char* a_fileName, int a_line_number, idLogging::Severity severity, const char* msg) override // 02
{
const char* severitystr;
Expand Down Expand Up @@ -74,4 +80,4 @@ namespace RE
WinAPI::OutputDebugString(outputString);
}
};
}
}
3 changes: 2 additions & 1 deletion CommonLibSF/include/RE/I/idTCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace RE
SF_RTTI_VTABLE(idTCP);

virtual ~idTCP(); // 00

bool Listen(std::uint16_t port, bool blocking); // 'blocking' is ignored
bool Accept(const idTCP& listener);
std::int32_t Close();
Expand All @@ -40,4 +41,4 @@ namespace RE
};
static_assert(sizeof(idTCP) == 0x20);

}
}
Loading

0 comments on commit 41f0f1f

Please sign in to comment.