Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request LiteLDev#109 from LiteLDev/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
dreamguxiang authored Dec 12, 2021
2 parents c20d630 + 99ab616 commit 63b0a9c
Show file tree
Hide file tree
Showing 228 changed files with 27,639 additions and 3,258 deletions.
35 changes: 34 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,37 @@ BreakConstructorInitializersBeforeComma: true
SpaceAfterCStyleCast: false
IndentCaseLabels: true
TabWidth: 4
UseTab: Never
UseTab: Never

BreakBeforeBraces: Custom
BraceWrapping:
# case 语句后面
AfterCaseLabel: true
# class定义后面
AfterClass: true
# 控制语句后面
AfterControlStatement: true
# enum定义后面
AfterEnum: true
# 函数定义后面
AfterFunction: true
# 命名空间定义后面
AfterNamespace: true
# struct定义后面
AfterStruct: true
# union定义后面
AfterUnion: true
# extern 导出块后面
AfterExternBlock: false
# catch之前
BeforeCatch: true
# else之前
BeforeElse: true
# 缩进大括号(整个大括号框起来的部分都缩进)
IndentBraces: false
# 空函数的大括号是否可以在一行
SplitEmptyFunction: true
# 空记录体(struct/class/union)的大括号是否可以在一行
SplitEmptyRecord: true
# 空名字空间的大括号是否可以在一行
SplitEmptyNamespace: true
13 changes: 4 additions & 9 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
== LiteLoaderBDS 2.0 PreRelease 1 ==
Adapt to 1.18.1, with everything new:
- Stronger API and Event system
- Friendly interfaces
- Countless low-level APIs ready to use immediately WITHOUT complex symcall
- Utils to help you develop more easily
- Auto upgrade system
- High performance and light weight
More interesting things in the future! Just wait in hope
== LiteLoaderBDS 2.0 PreRelease 2 ==
- Rewrite Logger
- Fix some problem
More interesting things in the future! Just wait in hope
6 changes: 1 addition & 5 deletions Chakra/Chakra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ using std::string;
using std::wstring;
using namespace std::filesystem;


#define MAX_PATH_LENGTH 8192

void fixUpLibDir() {
Expand Down Expand Up @@ -107,7 +106,4 @@ void loadDlls() {
Sleep(3000);
exit(GetLastError());
}
}

//#pragma comment(linker, "/export:HookFunction=LiteLoader.HookFunction")
//#pragma comment(linker, "/export:GetServerSymbol=LiteLoader.dlsym_real")
}
6 changes: 3 additions & 3 deletions Chakra/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
template <typename... Args>
void inline Info(const std::string& formatStr, const Args&... args)
{
std::string str = fmt::format("[{:%H:%M:%S} INFO][Chakra] ", fmt::localtime(_time64(0)));
std::string str = fmt::format("[{:%H:%M:%S} Info][Chakra] ", fmt::localtime(_time64(0)));
str += fmt::format(formatStr, args...);
str.append(1, '\n');
fmt::print(str);
Expand All @@ -21,7 +21,7 @@ void inline Info(const std::string& formatStr, const Args&... args)
template <typename... Args>
void inline Warn(const std::string& formatStr, const Args&... args)
{
std::string str = fmt::format("[{:%H:%M:%S} WARN][Chakra] ", fmt::localtime(_time64(0)));
std::string str = fmt::format("[{:%H:%M:%S} Warn][Chakra] ", fmt::localtime(_time64(0)));
str += fmt::format(formatStr, args...);
str.append(1, '\n');
fmt::print(fmt::fg(fmt::color::yellow2) | fmt::emphasis::bold, str);
Expand All @@ -30,7 +30,7 @@ void inline Warn(const std::string& formatStr, const Args&... args)
template <typename... Args>
void inline Error(const std::string& formatStr, const Args&... args)
{
std::string str = fmt::format("[{:%H:%M:%S} ERROR][Chakra] ", fmt::localtime(_time64(0)));
std::string str = fmt::format("[{:%H:%M:%S} Error][Chakra] ", fmt::localtime(_time64(0)));
str += fmt::format(formatStr, args...);
str.append(1, '\n');
fmt::print(fmt::fg(fmt::color::red2) | fmt::emphasis::bold, str);
Expand Down
10 changes: 5 additions & 5 deletions Chakra/SymDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ unordered_map<string, int, aphash> *FuncMap;

CRITICAL_SECTION dlsymLock;
void InitFastDlsym() {
fmt::print(fmt::format("[{:%H:%M:%S} INFO][SymDB] Loading Symbols\n", fmt::localtime(_time64(0))));
fmt::print(fmt::format("[{:%H:%M:%S} Info][SymDB] Loading Symbols\n", fmt::localtime(_time64(0))));
InitializeCriticalSection(&dlsymLock);
unordered_map<string, int, aphash> *realFuncMap = new unordered_map<string, int, aphash>;
SymDB->dumpall(realFuncMap);
Expand All @@ -232,13 +232,13 @@ void InitFastDlsym() {
symdbFn = (void *)(BaseAdr + iter->second);
}
if (exportTableFn == symdbFn && exportTableFn != nullptr) {
fmt::print(fmt::format("[{:%H:%M:%S} INFO][SymDB] HealthCheckPassed <{}>\n", fmt::localtime(_time64(0)), exportTableFn));
fmt::print(fmt::format("[{:%H:%M:%S} Info][SymDB] HealthCheckPassed <{}>\n", fmt::localtime(_time64(0)), exportTableFn));
} else {
//fmt::print(fmt::format(fmt::fg(fmt::color::red) | fmt::emphasis::bold, "[{:%Y-%m-%d %H:%M:%S} ERROR] HealthCheck Failed <{}!={}>\n", fmt::localtime(_time64(0)), exportTableFn, symdbFn));
//fmt::print(fmt::format("[{:%Y-%m-%d %H:%M:%S} Info] Are you running bedrock_serve_mod.exe?\n", fmt::localtime(_time64(0))));
}
LeaveCriticalSection(&dlsymLock);
fmt::print(fmt::format("[{:%H:%M:%S} INFO][SymDB] FastDlsymInited <{}>\n", fmt::localtime(_time64(0)), realFuncMap->size()));
fmt::print(fmt::format("[{:%H:%M:%S} Info][SymDB] FastDlsymInited <{}>\n", fmt::localtime(_time64(0)), realFuncMap->size()));
fflush(stdout);
}

Expand Down Expand Up @@ -279,13 +279,13 @@ extern "C" _declspec(dllexport) void* dlsym_real(const char* x) {
LeaveCriticalSection(&dlsymLock);
return (void *)(BaseAdr + iter->second);
} else {
fmt::print(fmt::format("[{:%H:%M:%S} INFO] Failed to look up Function in Memory {}\n", fmt::localtime(_time64(0)), x));
fmt::print(fmt::format("[{:%H:%M:%S} Info] Failed to look up Function in Memory {}\n", fmt::localtime(_time64(0)), x));
}
LeaveCriticalSection(&dlsymLock);
}
auto rv = SymDB->getsym(x);
if (rv == -1) {
fmt::print(fmt::format("[{:%H:%M:%S} INFO] Failed to look up Function in SymDB2 {}\n", fmt::localtime(_time64(0)), x));
fmt::print(fmt::format("[{:%H:%M:%S} Info] Failed to look up Function in SymDB2 {}\n", fmt::localtime(_time64(0)), x));
return nullptr;
}
return (void *)(BaseAdr + rv);
Expand Down
3 changes: 2 additions & 1 deletion Chakra/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

void fixUpLibDir();
void loadDlls();
#pragma comment(linker, "/export:GetServerSymbol=Chakra.dlsym_real")

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
system("chcp 65001");
system("chcp 65001>nul");
fixUpLibDir();
loadDlls();
break;
Expand Down
2 changes: 1 addition & 1 deletion LINK.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://minecraft.azureedge.net/bin-win/bedrock-server-1.18.1.02.zip
https://minecraft.azureedge.net/bin-win/bedrock-server-1.18.2.03.zip
5 changes: 4 additions & 1 deletion LiteLoader/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
*.user
*.user
/cmake-build-release/
/cmake-build-debug/
/.idea/
Loading

0 comments on commit 63b0a9c

Please # to comment.