This commit is contained in:
Rim 2024-05-29 18:02:43 -04:00
commit e3e1c36421
2 changed files with 170 additions and 186 deletions

View File

@ -3,52 +3,52 @@
![code](https://raw.githubusercontent.com/project-bo4/shield-development/master/assets/readme_header.jpg) ![code](https://raw.githubusercontent.com/project-bo4/shield-development/master/assets/readme_header.jpg)
## SHIELD ## SHIELD
A very experimental modification platform for Call of Duty®: Black Ops 4 run by community, aiming at improving both functionality and performance of original game. A very experimental modification platform for Call of Duty®: Black Ops 4 run by the community, aiming at improving both functionality and performance of the original game.
## DEMONWARE ## DEMONWARE
As of May11, 2023 we merged 'demonware' branch into 'master'. it includes a built-in demonware server emulator which allows player to start game without connection to official online servers. As of May 11, 2023, we have merged the 'demonware' branch into 'master'. It includes a built-in demonware server emulator which allows the player to start a game without an active connection to the official online servers.
## INSTRUCTIONS ## INSTRUCTIONS
> You should have publisher files required for playing online under LPC folder of your game directory. > You should already have the publisher files required for playing online (found under the LPC folder of your game directory).
> If its not the case then start original game through battlenet launcher once to get those downloaded. > If this is not the case, then run Black Ops 4 through Battle.NET Launcher once to get those files downloaded.
1- Clone repository with its sub-modules and use generate.bat to make visual studio solution then compile project and copy ``d3d11.dll`` into your bo4 folder. 1- Clone repository with its sub-modules and use ```generate.bat``` to make a Visual Studio solution, then compile project and copy ``d3d11.dll`` into your BO4 folder.
2- Start BlackOps4.exe 2- Start BlackOps4.exe
*In case you wanted to revert back to original battlenet servers just delete ``d3d11.dll``. you can put it back later whenever you want to re-install client.* *In case you wanted to revert back to using the original Battle.NET servers, just delete the generated ``d3d11.dll`` file from your game folder. You can re-generate and copy ```d3d11.dll``` back later whenever you want to re-install the client.*
## SHIELD DOCUMENTATION ## SHIELD DOCUMENTATION
Documentation on shield can be found [here](https://shield-bo4.gitbook.io/). Documentation on shield can be found [here](https://shield-bo4.gitbook.io/).
## SUBMITTING ISSUES ## SUBMITTING ISSUES
Github issues section is only for reporting programmatically errors of client. please dont use it for requesting features or seeking help with personal issues such as faulty game data or similar problems. use battlenet's scan and repair feature to fix those problems. The Github Issues section is only for reporting programmatical errors related to the client. Please don't use it for requesting features or seeking help with personal issues such as experiencing faulty game data or similar problems. Use Battle.NET's 'Scan And Repair' feature to fix those problems.
## NOTES ## NOTES
- Base SDK (well kinda...) used by this project is developed by [Maurice Heumann](https://github.com/momo5502); Thanks to the guy. - Base SDK (well kinda...) used by this project is developed by [Maurice Heumann](https://github.com/momo5502); Thanks to the guy.
- There are some 3rd-party project/tools that have influenced and helped the project in particular ways; If you belive there is something originated from you and want to be credited please contact any of our social media accounts. - There are some 3rd-party project/tools that have influenced and helped the project in particular ways; If you belive there is something originated from you and want to be credited, please contact any of our social media accounts.
- This Project is created purely for educational purposes. its free and open-sourced under gnu license. developers are not responsible or liable for misuse of this product. - This Project is created purely for educational purposes. It's free and open-sourced under the GNU License. Developers are not responsible or liable for misuse of this product.
## Roadmap ## Roadmap
### CLIENT-SIDE: ### CLIENT-SIDE:
- [x] Online Battlenet Connection Requirement Removal - [x] Online Battle.NET Connection Requirement Removal
- [x] Built-in Demonware Server Emulation - [x] Built-in Demonware Server Emulation
- [x] BlackBox Crash Reporting Component - [x] BlackBox Crash Reporting Component
- [x] In-game Interactable Console - [x] In-game Interactable Console
- [x] Gsc & Lua Modding Support - [x] GSC & Lua Modding Support
- [ ] Enable Aim-Assist for Game Controllers - [ ] Enable Aim-Assist for Game Controllers
- [ ] Miscellaneous Features such as 1st person view fov - [ ] Miscellaneous Features such as 1st-Person View FOV
- [ ] Fix *uncommon* runtime black screen issue along other instabilities - [ ] Fix *uncommon* Runtime "Black Screen" issue along other instabilities
### SERVER-SIDE: ### SERVER-SIDE:
- [x] Fully Functional Online Server Emulator - [x] Fully Functional Online Server Emulator
- [ ] Implement Basic Matchmaking with QOS Logics - [ ] Implement Basic Matchmaking with QOS Logic
- [ ] Try to Create Dedicated Server off Public Ship Builds - [ ] Try to Create Dedicated Server off Public Ship Builds

View File

@ -1,5 +1,3 @@
//TODO: Fix console branding
#include <std_include.hpp> #include <std_include.hpp>
#include "loader/component_loader.hpp" #include "loader/component_loader.hpp"
#include <utilities/string.hpp> #include <utilities/string.hpp>
@ -14,9 +12,8 @@ namespace console
{ {
namespace namespace
{ {
const char* branding_str = "Project-Bo4 >"; const char* branding_str = "T8-Mod >";
size_t branding_length = std::strlen(branding_str);
size_t branding_lenght = std::strlen(branding_str);
utilities::hook::detour printf_hook; utilities::hook::detour printf_hook;
std::recursive_mutex print_mutex; std::recursive_mutex print_mutex;
@ -73,11 +70,8 @@ namespace console
show_cursor(false); show_cursor(false);
set_cursor_pos(0); set_cursor_pos(0);
invoke_printf("%s", con.buffer); invoke_printf("%s%s", branding_str, con.buffer);
//invoke_printf("%s %s", branding_str, con.buffer); set_cursor_pos(branding_length + con.cursor);
set_cursor_pos(con.cursor);
//set_cursor_pos(branding_lenght + con.cursor);
show_cursor(true); show_cursor(true);
} }
@ -88,18 +82,17 @@ namespace console
show_cursor(false); show_cursor(false);
set_cursor_pos(0); set_cursor_pos(0);
for (auto i = 0; i < std::strlen(con.buffer); i++) for (auto i = 0; i < branding_length + std::strlen(con.buffer); i++)
{ {
invoke_printf(" "); invoke_printf(" ");
} }
set_cursor_pos(con.cursor); set_cursor_pos(0);
show_cursor(true); show_cursor(true);
} }
int dispatch_message(const int type, const std::string& message) int dispatch_message(const int type, const std::string& message)
{ {
std::lock_guard _0(print_mutex); std::lock_guard _0(print_mutex);
clear_output(); clear_output();
@ -132,7 +125,7 @@ namespace console
CONSOLE_SCREEN_BUFFER_INFO info{}; CONSOLE_SCREEN_BUFFER_INFO info{};
GetConsoleScreenBufferInfo(OUTPUT_HANDLE, &info); GetConsoleScreenBufferInfo(OUTPUT_HANDLE, &info);
const auto columns = static_cast<size_t>(info.srWindow.Right - info.srWindow.Left - 1); const auto columns = static_cast<size_t>(info.srWindow.Right - info.srWindow.Left - 1);
return std::max(size_t(0), std::min(columns, sizeof(con.buffer))); return std::max(size_t(0), std::min(columns, sizeof(con.buffer) - branding_length));
} }
void handle_resize() void handle_resize()
@ -200,9 +193,7 @@ namespace console
if (con.cursor > 0) if (con.cursor > 0)
{ {
con.cursor--; con.cursor--;
set_cursor_pos(con.cursor); set_cursor_pos(branding_length + con.cursor);
//set_cursor_pos(branding_lenght + con.cursor);
} }
break; break;
@ -212,8 +203,7 @@ namespace console
if (con.cursor < std::strlen(con.buffer)) if (con.cursor < std::strlen(con.buffer))
{ {
con.cursor++; con.cursor++;
set_cursor_pos(con.cursor); set_cursor_pos(branding_length + con.cursor);
//set_cursor_pos(branding_lenght + con.cursor);
} }
break; break;
@ -246,9 +236,7 @@ namespace console
con.cursor = 0; con.cursor = 0;
clear_output(); clear_output();
invoke_printf("%s%s\r\n", branding_str, con.buffer);
invoke_printf("]%s\r\n", con.buffer);
strncpy_s(con.buffer, "", sizeof(con.buffer)); strncpy_s(con.buffer, "", sizeof(con.buffer));
break; break;
} }
@ -260,9 +248,7 @@ namespace console
} }
clear_output(); clear_output();
std::memmove(con.buffer + con.cursor - 1, con.buffer + con.cursor, strlen(con.buffer) + 1 - con.cursor); std::memmove(con.buffer + con.cursor - 1, con.buffer + con.cursor, strlen(con.buffer) + 1 - con.cursor);
con.buffer - 1;
con.cursor--; con.cursor--;
update(); update();
@ -288,8 +274,7 @@ namespace console
break; break;
} }
std::memmove(con.buffer + con.cursor + 1, std::memmove(con.buffer + con.cursor + 1, con.buffer + con.cursor, std::strlen(con.buffer) + 1 - con.cursor);
con.buffer + con.cursor, std::strlen(con.buffer) + 1 - con.cursor);
con.buffer[con.cursor] = c; con.buffer[con.cursor] = c;
con.cursor++; con.cursor++;
@ -336,7 +321,7 @@ namespace console
freopen_s(&empty, "CONOUT$", "r", stdin); freopen_s(&empty, "CONOUT$", "r", stdin);
freopen_s(&empty, "CONOUT$", "w", stdout); freopen_s(&empty, "CONOUT$", "w", stdout);
freopen_s(&empty, "CONOUT$", "w", stderr); freopen_s(&empty, "CONOUT$", "w", stderr);
SetConsoleTitle("Project-Bo4:"); SetConsoleTitle("T8-Mod:");
printf_hook.create(printf, printf_stub); printf_hook.create(printf, printf_stub);
@ -385,8 +370,7 @@ namespace console
break; break;
} }
} }
} } });
});
} }
void pre_destroy() override void pre_destroy() override