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 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..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; @@ -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); } }); @@ -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) {