mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
fix 13.00, performance
This commit is contained in:
@@ -69,9 +69,8 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
|
||||
auto lastBackslash = OldMsg.find_last_of("\\");
|
||||
|
||||
static auto World_NetDriverOffset = GetWorld()->GetOffset("NetDriver");
|
||||
auto WorldNetDriver = GetWorld()->Get(World_NetDriverOffset);
|
||||
static auto ClientConnectionsOffset = WorldNetDriver->GetOffset("ClientConnections");
|
||||
auto& ClientConnections = WorldNetDriver->Get<TArray<UObject*>>(ClientConnectionsOffset);
|
||||
auto WorldNetDriver = GetWorld()->Get<UNetDriver*>(World_NetDriverOffset);
|
||||
auto& ClientConnections = WorldNetDriver->GetClientConnections();
|
||||
|
||||
if (firstBackslash != std::string::npos && lastBackslash != std::string::npos)
|
||||
{
|
||||
|
||||
@@ -377,7 +377,14 @@ static inline uint64 FindPauseBeaconRequests()
|
||||
// todo try 40 53 48 83 EC 30 48 8B ? 84 D2 74 ? 80 3D for S1-S15
|
||||
|
||||
if (Engine_Version == 426)
|
||||
return Memcury::Scanner::FindPattern("40 57 48 83 EC 30 48 8B F9 84 D2 74 62 80 3D").Get();
|
||||
{
|
||||
auto addr = Memcury::Scanner::FindPattern("40 57 48 83 EC 30 48 8B F9 84 D2 74 62 80 3D", false).Get();
|
||||
|
||||
if (!addr)
|
||||
addr = Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 5E 80 3D").Get();
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
if (Engine_Version == 420)
|
||||
return Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 68 80 3D ? ? ? ? ? 72 2C 48 8B 05 ? ? ? ? 4C 8D 44").Get();
|
||||
|
||||
@@ -49,10 +49,11 @@
|
||||
#define ZONE_TAB 6
|
||||
#define DUMP_TAB 7
|
||||
#define UNBAN_TAB 8
|
||||
#define DEVELOPER_TAB 9
|
||||
#define DEBUGLOG_TAB 10
|
||||
#define SETTINGS_TAB 11
|
||||
#define CREDITS_TAB 12
|
||||
#define FUN_TAB 9
|
||||
#define DEVELOPER_TAB 10
|
||||
#define DEBUGLOG_TAB 11
|
||||
#define SETTINGS_TAB 12
|
||||
#define CREDITS_TAB 13
|
||||
|
||||
#define MAIN_PLAYERTAB 1
|
||||
#define INVENTORY_PLAYERTAB 2
|
||||
@@ -146,12 +147,15 @@ static inline std::string wstring_to_utf8(const std::wstring& str)
|
||||
return str_to;
|
||||
}
|
||||
|
||||
static inline void InitStyle()
|
||||
static inline void InitFont()
|
||||
{
|
||||
ImFontConfig FontConfig;
|
||||
FontConfig.FontDataOwnedByAtlas = false;
|
||||
ImGui::GetIO().Fonts->AddFontFromMemoryTTF((void*)ruda_bold_data, sizeof(ruda_bold_data), 17.f, &FontConfig);
|
||||
// ImGui::GetIO().Fonts->AddFontFromFileTTF("Reboot Resources/fonts/ruda-bold.ttf", 17);
|
||||
}
|
||||
|
||||
static inline void InitStyle()
|
||||
{
|
||||
auto& mStyle = ImGui::GetStyle();
|
||||
mStyle.FramePadding = ImVec2(4, 2);
|
||||
mStyle.ItemSpacing = ImVec2(6, 2);
|
||||
@@ -362,6 +366,14 @@ static inline void MainTabs()
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui::BeginTabItem("Fun"))
|
||||
{
|
||||
Tab = FUN_TAB;
|
||||
PlayerTab = -1;
|
||||
bInformationTab = false;
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (bannedStream.is_open() && ImGui::BeginTabItem("Unban")) // skunked
|
||||
{
|
||||
@@ -977,6 +989,51 @@ static inline void MainUI()
|
||||
else if (Tab == UNBAN_TAB)
|
||||
{
|
||||
|
||||
}
|
||||
else if (Tab == FUN_TAB)
|
||||
{
|
||||
static std::string ItemToGrantEveryone;
|
||||
static int AmountToGrantEveryone = 1;
|
||||
|
||||
ImGui::InputText("Item to Give", &ItemToGrantEveryone);
|
||||
ImGui::InputInt("Amount to Give", &AmountToGrantEveryone);
|
||||
|
||||
if (ImGui::Button("Give Item to Everyone"))
|
||||
{
|
||||
auto ItemDefinition = FindObject<UFortItemDefinition>(ItemToGrantEveryone, nullptr, ANY_PACKAGE);
|
||||
|
||||
if (ItemDefinition)
|
||||
{
|
||||
static auto World_NetDriverOffset = GetWorld()->GetOffset("NetDriver");
|
||||
auto WorldNetDriver = GetWorld()->Get<UNetDriver*>(World_NetDriverOffset);
|
||||
auto& ClientConnections = WorldNetDriver->GetClientConnections();
|
||||
|
||||
for (int i = 0; i < ClientConnections.Num(); i++)
|
||||
{
|
||||
auto PlayerController = Cast<AFortPlayerController>(ClientConnections.at(i)->GetPlayerController());
|
||||
|
||||
if (!PlayerController->IsValidLowLevel())
|
||||
continue;
|
||||
|
||||
auto WorldInventory = PlayerController->GetWorldInventory();
|
||||
|
||||
if (!WorldInventory->IsValidLowLevel())
|
||||
continue;
|
||||
|
||||
bool bShouldUpdate = false;
|
||||
WorldInventory->AddItem(ItemDefinition, &bShouldUpdate, AmountToGrantEveryone);
|
||||
|
||||
if (bShouldUpdate)
|
||||
WorldInventory->Update();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemToGrantEveryone = "";
|
||||
LOG_WARN(LogUI, "Invalid Item Definition!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (Tab == DEVELOPER_TAB)
|
||||
{
|
||||
@@ -1201,6 +1258,7 @@ static inline DWORD WINAPI GuiThread(LPVOID)
|
||||
// io.Fonts->AddFontFromFileTTF("../vendor/fonts/Aller_Bd.ttf", 17);
|
||||
|
||||
// Setup Dear ImGui style
|
||||
InitFont();
|
||||
InitStyle();
|
||||
|
||||
// Setup Platform/Renderer backends
|
||||
|
||||
@@ -81,6 +81,7 @@ inline void InitLogger()
|
||||
MakeLogger("LogReplication");
|
||||
MakeLogger("LogMutator");
|
||||
MakeLogger("LogVehicles");
|
||||
MakeLogger("LogUI");
|
||||
MakeLogger("LogBots");
|
||||
MakeLogger("LogCosmetics");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user