Break game and protections (#3203)

This commit is contained in:
maybegreat48 2024-05-30 17:45:43 +00:00 committed by GitHub
parent fe0bcdd7ae
commit a218f84eed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,29 @@
#include "backend/player_command.hpp"
#include "natives.hpp"
#include "packet.hpp"
#include "pointers.hpp"
namespace big
{
class break_game : player_command
{
using player_command::player_command;
virtual CommandAccessLevel get_access_level() override
{
return CommandAccessLevel::AGGRESSIVE;
}
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
{
packet pack;
pack.write_message(rage::eNetMessage::MsgRoamingJoinBubbleAck);
pack.write(0, 2);
pack.write(10, 4);
pack.write(0, 6);
pack.send(player->get_net_game_player()->m_msg_id);
}
};
break_game g_break_game("breakgame", "BREAK_GAME", "BREAK_GAME_DESC", 0);
}

View File

@ -101,6 +101,10 @@ namespace big
if (!get_msg_type(msgType, buffer))
return g_hooking->get_original<hooks::receive_net_message>()(netConnectionManager, a2, frame);
if (msgType == rage::eNetMessage::MsgRoamingJoinBubbleAck)
return true;
if (player)
{
switch (msgType)
@ -233,6 +237,11 @@ namespace big
break;
}
case rage::eNetMessage::MsgRoamingInitialBubble:
{
LOG(WARNING) << "Shouldn't get this again";
return true;
}
}
}
else
@ -255,6 +264,25 @@ namespace big
}
break;
}
case rage::eNetMessage::MsgNonPhysicalData:
{
buffer.Read<int>(7); // size
int bubble = buffer.Read<int>(4);
int player = buffer.Read<int>(6);
if (g_player_service->get_self() && g_player_service->get_self()->id() == player)
{
LOG(WARNING) << "We're being replaced";
return true;
}
if (bubble != 0)
{
LOG(WARNING) << "Wrong bubble: " << bubble;
}
break;
}
}
}

View File

@ -25,6 +25,8 @@ namespace big
ImGui::SameLine();
components::player_command_button<"mission">(g_player_service->get_selected(), {});
components::player_command_button<"breakgame">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"error">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"ceoraid">(g_player_service->get_selected(), {});