From feb09d6a576c485ae641dd1830f05ee60e2e95c5 Mon Sep 17 00:00:00 2001 From: Itsi Adam <57854334+ItsiAdam@users.noreply.github.com> Date: Sat, 23 May 2020 13:57:49 +0100 Subject: [PATCH 1/3] Match simple-ipc --- src/PlayerTools.cpp | 4 ++-- src/hacks/FollowBot.cpp | 4 ++-- src/ipc.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/PlayerTools.cpp b/src/PlayerTools.cpp index ba641a73..a8f15b70 100644 --- a/src/PlayerTools.cpp +++ b/src/PlayerTools.cpp @@ -113,9 +113,9 @@ void onKilledBy(unsigned id) { std::string command = "cat_ipc_exec_all cat_pl_mark_betrayal " + std::to_string(id); if (command.length() >= 63) - ipc::peer->SendMessage(0, 0, ipc::commands::execute_client_cmd_long, command.c_str(), command.length() + 1); + ipc::peer->SendMessage(0, -1, ipc::commands::execute_client_cmd_long, command.c_str(), command.length() + 1); else - ipc::peer->SendMessage(command.c_str(), 0, ipc::commands::execute_client_cmd, 0, 0); + ipc::peer->SendMessage(command.c_str(), -1, ipc::commands::execute_client_cmd, 0, 0); } } } diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index b56bb0b7..833b17f4 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -758,11 +758,11 @@ static CatCommand follow_me("fb_follow_me", "IPC connected bots will follow you" std::string tmp = CON_PREFIX + follow_steam.name + " " + std::to_string(steam_id); if (tmp.length() >= 63) { - ipc::peer->SendMessage(0, 0, ipc::commands::execute_client_cmd_long, tmp.c_str(), tmp.length() + 1); + ipc::peer->SendMessage(0, -1, ipc::commands::execute_client_cmd_long, tmp.c_str(), tmp.length() + 1); } else { - ipc::peer->SendMessage(tmp.c_str(), 0, ipc::commands::execute_client_cmd, 0, 0); + ipc::peer->SendMessage(tmp.c_str(), -1, ipc::commands::execute_client_cmd, 0, 0); } }); #endif diff --git a/src/ipc.cpp b/src/ipc.cpp index 93e55cfd..d973c4aa 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -97,11 +97,11 @@ CatCommand exec("ipc_exec", "Execute command (first argument = bot ID)", [](cons ReplaceString(command, " && ", " ; "); if (command.length() >= 63) { - peer->SendMessage(0, (1 << target_id), ipc::commands::execute_client_cmd_long, command.c_str(), command.length() + 1); + peer->SendMessage(0, target_id, ipc::commands::execute_client_cmd_long, command.c_str(), command.length() + 1); } else { - peer->SendMessage(command.c_str(), (1 << target_id), ipc::commands::execute_client_cmd, 0, 0); + peer->SendMessage(command.c_str(), target_id, ipc::commands::execute_client_cmd, 0, 0); } }); CatCommand exec_all("ipc_exec_all", "Execute command (on every peer)", [](const CCommand &args) { @@ -109,11 +109,11 @@ CatCommand exec_all("ipc_exec_all", "Execute command (on every peer)", [](const ReplaceString(command, " && ", " ; "); if (command.length() >= 63) { - peer->SendMessage(0, 0, ipc::commands::execute_client_cmd_long, command.c_str(), command.length() + 1); + peer->SendMessage(0, -1, ipc::commands::execute_client_cmd_long, command.c_str(), command.length() + 1); } else { - peer->SendMessage(command.c_str(), 0, ipc::commands::execute_client_cmd, 0, 0); + peer->SendMessage(command.c_str(), -1, ipc::commands::execute_client_cmd, 0, 0); } }); From 275b0283d0622c2c13b58294b1544e61b1473527 Mon Sep 17 00:00:00 2001 From: Itsi Adam <57854334+ItsiAdam@users.noreply.github.com> Date: Sat, 23 May 2020 15:44:04 +0100 Subject: [PATCH 2/3] Update cat_ipc_exec too --- src/ipc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipc.cpp b/src/ipc.cpp index d973c4aa..819c2721 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -80,7 +80,7 @@ CatCommand exec("ipc_exec", "Execute command (first argument = bot ID)", [](cons logging::Info("Target id is NaN!"); return; } - if (target_id == 0 || target_id > 31) + if (target_id < 0 || target_id > 255) { logging::Info("Invalid target id: %u", target_id); return; @@ -133,7 +133,7 @@ CatCommand debug_get_ingame_ipc("ipc_debug_dump_server", "Show other bots on ser int count = 0; unsigned highest = 0; std::vector botlist{}; - for (unsigned i = 1; i < cat_ipc::max_peers; i++) + for (unsigned i = 0; i < cat_ipc::max_peers; i++) { if (!ipc::peer->memory->peer_data[i].free) { From 00c054572231349fe878fd40fa856c8c20ca356b Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Fri, 5 Jun 2020 20:43:29 +0200 Subject: [PATCH 3/3] Update simple-ipc --- external/simple-ipc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/simple-ipc b/external/simple-ipc index c9c7f74a..3db1b697 160000 --- a/external/simple-ipc +++ b/external/simple-ipc @@ -1 +1 @@ -Subproject commit c9c7f74a3697ea095ce304f8129b95e272e4f6fd +Subproject commit 3db1b6976b75e469bad11749b98ba5aca911c794