Skip to content

Commit

Permalink
Final fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
g0aty committed Oct 27, 2024
2 parents b1c4e51 + cc43ae9 commit 88a3828
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
16 changes: 12 additions & 4 deletions gui/tabs/game_tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,21 @@ namespace GameTab {
if (IsInLobby() && ToggleButton("Crash Server", &State.CrashSpamReport)) {
State.Save();
}
if (IsInLobby()) ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 1.0f), ("Server crashes after starting a game-match!\nMay be hard ping in lobby"));

{
if (IsInLobby()) ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 1.0f), ("Server crashes after starting a game-match!\nMay be hard ping in lobby"));
ImGui::Dummy(ImVec2(5, 5)* State.dpiScale);
}
if (IsInGame() && ToggleButton("Attempt to Crash", &State.UltimateSpamReport)) {
State.Save();
}
if (IsInGame()) ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 1.0f), ("Alternate Crash Server!\nMay cause game crashing!\nMay work with delay!"));

{
if (IsInGame()) ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 1.0f), ("Alternate Crash Server!\nMay cause game crashing!\nMay work with delay!"));
ImGui::Dummy(ImVec2(5, 5) * State.dpiScale);
}
if (IsInMultiplayerGame() || IsInLobby()) (ToggleButton("Crash Chat Spam", &State.CrashChatSpam));
{
if (IsInMultiplayerGame() || IsInLobby()) ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 1.0f), ("Upgraded [Spam Blank Chat as {Everyone}] Exploit")); State.Save();
}
/*ImGui::Dummy(ImVec2(10, 10)* State.dpiScale);
if (IsInLobby() || IsInGame) ToggleButton("Destroy Game Logic", &State.SpoofCrashLevel) && (!State.SpoofLevel); {
if (State.SpoofCrashLevel) ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), ("Zero Level = Crash Server"));
Expand Down
5 changes: 5 additions & 0 deletions hooks/Chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ void dChatController_Update(ChatController* __this, MethodInfo* method)
//remove rpc queue stuff cuz of delay and anticheat kick
State.MessageSent = true;
}
if (!State.PanicMode && State.SafeMode && State.CrashChatSpam && (State.ChatSpamMode == 0 || State.ChatSpamMode == 2) && (IsInGame() || IsInLobby()) && __this->fields.timeSinceLastMessage >= 3.5f) {
PlayerControl_RpcSendChat(*Game::pLocalPlayer, convert_to_string(State.chatMessage), NULL);
//remove rpc queue stuff cuz of delay and anticheat kick
State.MessageSent = true;
}


ChatController_Update(__this, method);
Expand Down
21 changes: 20 additions & 1 deletion hooks/PlayerControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ void dPlayerControl_FixedUpdate(PlayerControl* __this, MethodInfo* method) {
}
}
if (State.ChatSpam && (IsInGame() || IsInLobby())) {
static float spamDelay = 0;
static float spamDelay = 15;
auto player = !State.SafeMode && State.playerToChatAs.has_value() ? State.playerToChatAs.validate().get_PlayerControl() : *Game::pLocalPlayer;
for (auto p : GetAllPlayerControl()) {
if (p == player || State.ChatSpamEveryone) {
Expand All @@ -465,6 +465,25 @@ void dPlayerControl_FixedUpdate(PlayerControl* __this, MethodInfo* method) {
}
}

if (State.CrashChatSpam && (IsInGame() || IsInLobby())) {
static float spamDelay = 0;
auto player = !State.SafeMode && State.playerToChatAs.has_value() ? State.playerToChatAs.validate().get_PlayerControl() : *Game::pLocalPlayer;
for (auto p : GetAllPlayerControl()) {
if (p == player || State.CrashChatSpam) {
if (!State.SafeMode && (State.CrashChatSpamMode == 1 || State.CrashChatSpamMode == 1)) {
auto writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), player->fields._.NetId,
uint8_t(RpcCalls__Enum::SendChat), SendOption__Enum::None, -1, NULL);
MessageWriter_WriteString(writer, convert_to_string(State.chatMessage), NULL);
InnerNetClient_FinishRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), writer, NULL);
ChatController_AddChat(Game::HudManager.GetInstance()->fields.Chat, player, convert_to_string(State.chatMessage), false, NULL);
}
else if (State.CrashChatSpamMode == 1 || State.CrashChatSpamMode == 1) {
PlayerControl_RpcSendChatNote(player, p->fields.PlayerId, (ChatNoteTypes__Enum)2, NULL);
}
}
}
}

if ((IsHost() || !State.SafeMode) && State.ForceColorForEveryone)
{
static float forceColorDelay = 0;
Expand Down
2 changes: 2 additions & 0 deletions user/state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ class Settings {
int GameMode = 0;
bool NoGameEnd = false;
bool ChatSpam = false;
bool CrashChatSpam = false;
bool ChatSpamEveryone = false;
int ChatSpamMode = 0;
int CrashChatSpamMode = 1;
bool AutoJoinLobby = false;
std::string AutoJoinLobbyCode = "";

Expand Down

0 comments on commit 88a3828

Please sign in to comment.