From c3151093e28c3e6f0e307a61b1f2d1188a5a5d90 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Mon, 29 Nov 2021 01:42:23 +0100 Subject: [PATCH] CMake: remove __linux completely --- CMakeLists.txt | 1 - include/TConsole.h | 1 + src/TConsole.cpp | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b51ee20..a8f37ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,6 @@ if(APPLE) include_directories(/usr/local/opt/openssl@1.1/include) link_directories(/usr/local/Cellar/lua@5.3/5.3.6/lib) link_directories(/usr/local/opt/openssl@1.1/lib) - add_compile_definitions(__linux) endif() if (WIN32) diff --git a/include/TConsole.h b/include/TConsole.h index 110cfc9..25ff258 100644 --- a/include/TConsole.h +++ b/include/TConsole.h @@ -26,6 +26,7 @@ private: void Command_Help(const std::string& cmd); void Command_Kick(const std::string& cmd); void Command_Say(const std::string& cmd); + void Command_List(const std::string& cmd); Commandline mCommandline; std::vector mCachedLuaHistory; diff --git a/src/TConsole.cpp b/src/TConsole.cpp index 6ed9f58..f7aa3fa 100644 --- a/src/TConsole.cpp +++ b/src/TConsole.cpp @@ -185,6 +185,21 @@ void TConsole::Command_Kick(const std::string& cmd) { } void TConsole::Command_Say(const std::string& cmd) { + if (cmd.size() > 3) { + auto Message = cmd.substr(4); + LuaAPI::MP::SendChatMessage(-1, Message); + } +} + +void TConsole::Command_List(const std::string& cmd) { + std::stringstream ss; + mLuaEngine->Server().ForEachClient([&](std::weak_ptr Client) -> bool { + if (!Client.expired()) { + auto locked = Client.lock(); + ss << + } + return true; + }); } void TConsole::RunAsCommand(const std::string& cmd, bool IgnoreNotACommand) {