From 80a87136a5f4d52adcfc70c38bcc72570449ed4c Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Mon, 31 Jul 2017 16:36:51 +0300 Subject: [PATCH] cat_autoexec_textmode --- src/hack.cpp | 3 +++ src/hacks/Walkbot.cpp | 1 - src/ipc.cpp | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/hack.cpp b/src/hack.cpp index 55d337a5..bd87f163 100644 --- a/src/hack.cpp +++ b/src/hack.cpp @@ -289,6 +289,9 @@ void hack::Initialize() { // FIXME [MP] hacks::shared::killsay::Init(); hack::command_stack().push("exec cat_autoexec"); +#ifdef TEXTMODE + hack::command_stack().push("exec cat_autoexec_textmode"); +#endif hack::command_stack().push("cat_killsay_reload"); hack::command_stack().push("cat_spam_reload"); logging::Info("Hooked!"); diff --git a/src/hacks/Walkbot.cpp b/src/hacks/Walkbot.cpp index bd12d78e..8230ed21 100644 --- a/src/hacks/Walkbot.cpp +++ b/src/hacks/Walkbot.cpp @@ -924,7 +924,6 @@ void OnLevelInit() { } } - static CatVar wb_abandon_too_many_bots(CV_INT, "wb_population_control", "0", "Abandon if bots >"); void CheckLivingSpace() { #if IPC_ENABLED diff --git a/src/ipc.cpp b/src/ipc.cpp index bfd64825..1edefb60 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -121,6 +121,32 @@ CatVar server_name(CV_STRING, "ipc_server", "cathook_followbot_server", "IPC ser peer_t* peer { nullptr }; +CatCommand debug_get_ingame_ipc("ipc_debug_dump_server", "Show other bots on server", []() { + std::vector players {}; + for (int j = 1; j < 32; j++) { + player_info_s info; + if (g_IEngine->GetPlayerInfo(j, &info)) { + if (info.friendsID) + players.push_back(info.friendsID); + } + } + int count = 0; + unsigned highest = 0; + std::vector botlist {}; + for (unsigned i = 1; i < cat_ipc::max_peers; i++) { + if (!ipc::peer->memory->peer_data[i].free) { + for (auto& k : players) { + if (ipc::peer->memory->peer_user_data[i].friendid && k == ipc::peer->memory->peer_user_data[i].friendid) { + botlist.push_back(i); + logging::Info("-> %u (%u)", i, ipc::peer->memory->peer_user_data[i].friendid); + count++; + highest = i; + } + } + } + } + logging::Info("%d other IPC players on server", count); +}); void UpdateServerAddress(bool shutdown) { if (not peer)