This repository has been archived by the owner on Dec 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added notification system for new updates and if files are missing (upon launch) - Remove "command line" version, it isn't really useful and wasn't updated - Added in depth logging (saved to logs folder) - Added a hint for when logging into the game so you don't get confused on what to use as the code - Removed extra buttons in the main window that were no longer needed and added confusion - Added stats (updated every 500 ms-ish). Has info on CPU, RAM, R/W speed, provide speed (to programs using the served files), download speed, "drive" latency (for programs reading the files), and thread count - Progress window has placeholders (instead of being empty) - Overhauled setup window - Rewrote config code to work better for backwards compatibility - Rewrote http code to use curl instead of httplib - Better memory handling when compressing chunks - Storage, manifest, chunks, auth, etc, classes are now OOP instead of C-style functions - EGL2 is now self signed with a certificate (and no longer compressed with upx) to deter any false positive antivirus detection - Refactored/rewrote MountedBuild.cpp to be cleaner - EGL2 now mounts to /game instead of the A: drive (should fix any admin access shenanigans) - Dang that's a lot of changes
- Loading branch information
1 parent
80a224f
commit b34041e
Showing
82 changed files
with
6,575 additions
and
7,039 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
out/ | ||
.vs/ | ||
.vs/ | ||
|
||
cert.pfx | ||
cert.pwd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "Logger.h" | ||
|
||
#define WIN32_LEAN_AND_MEAN | ||
#include <Windows.h> | ||
|
||
bool Logger::Setup() { | ||
auto stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE); | ||
if (stdoutHandle != INVALID_HANDLE_VALUE) { | ||
DWORD outMode; | ||
if (GetConsoleMode(stdoutHandle, &outMode)) { | ||
return SetConsoleMode(stdoutHandle, outMode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); | ||
} | ||
} | ||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#pragma once | ||
|
||
#define LOG_DEBUG(str, ...) Logger::Log(Logger::LogLevel::DEBUG, LOG_SECTION, str, __VA_ARGS__) | ||
#define LOG_INFO(str, ...) Logger::Log(Logger::LogLevel::INFO, LOG_SECTION, str, __VA_ARGS__) | ||
#define LOG_WARN(str, ...) Logger::Log(Logger::LogLevel::WARN, LOG_SECTION, str, __VA_ARGS__) | ||
#define LOG_ERROR(str, ...) Logger::Log(Logger::LogLevel::ERROR_, LOG_SECTION, str, __VA_ARGS__) | ||
#define LOG_FATAL(str, ...) Logger::Log(Logger::LogLevel::FATAL, LOG_SECTION, str, __VA_ARGS__) | ||
|
||
#include <functional> | ||
#include <memory> | ||
|
||
class Logger { | ||
public: | ||
enum class LogLevel : uint8_t { | ||
UNKNOWN, | ||
DEBUG, | ||
INFO, | ||
WARN, | ||
ERROR_, | ||
FATAL | ||
}; | ||
|
||
static bool Setup(); | ||
|
||
template<typename... Args> | ||
static void Log(LogLevel level, const char* section, const char* str, Args... args) { | ||
auto size = snprintf(nullptr, 0, str, args...) + 1; | ||
auto buf = std::make_unique<char[]>(size); | ||
snprintf(buf.get(), size, str, args...); | ||
Callback(level, section, buf.get()); | ||
} | ||
|
||
static constexpr const char* LevelAsString(LogLevel level) { | ||
switch (level) | ||
{ | ||
case LogLevel::DEBUG: | ||
return "Debug"; | ||
case LogLevel::INFO: | ||
return "Info "; | ||
case LogLevel::WARN: | ||
return "Warn "; | ||
case LogLevel::ERROR_: | ||
return "Error"; | ||
case LogLevel::FATAL: | ||
return "Fatal"; | ||
default: | ||
return "Unkwn"; | ||
} | ||
} | ||
|
||
static constexpr const char* LevelAsColor(LogLevel level) { | ||
switch (level) | ||
{ | ||
case LogLevel::DEBUG: | ||
return "\33[0;37m"; | ||
case LogLevel::INFO: | ||
return "\33[0;92m"; | ||
case LogLevel::WARN: | ||
return "\33[0;93m"; | ||
case LogLevel::ERROR_: | ||
return "\33[0;91m"; | ||
case LogLevel::FATAL: | ||
return "\33[0;31m"; | ||
default: | ||
return "\33[0;95m"; | ||
} | ||
} | ||
|
||
static constexpr const char* ResetColor = "\33[0m"; | ||
|
||
using callback = std::function<void(LogLevel, const char*, const char*)>; | ||
static inline callback Callback = nullptr; | ||
}; |
Oops, something went wrong.