From 15fdac3f6c49e10a1d7c7bea6503749eea151daf Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 10 Feb 2022 16:15:49 +0200 Subject: [PATCH] Revert "Merge branch '0.7.1-window-input' into 0.7.1" This reverts commit 94f5b169e622fb0a67f1d3e52f836798b78087b1, reversing changes made to 43e7df6df888b96dc2bb30688055355dc11a64b2. # Conflicts: # apps/openmw-mp/handleInput.cpp --- apps/openmw-mp/Networking.cpp | 27 +++++------------------ apps/openmw-mp/Script/ScriptFunctions.hpp | 3 +-- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index f9430dd57..d2b0c986c 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -25,8 +25,6 @@ #include "processors/ObjectProcessor.hpp" #include "processors/WorldstateProcessor.hpp" -#include "handleInput.cpp" - using namespace mwmp; Networking *Networking::sThis = 0; @@ -497,20 +495,6 @@ void signalHandler(int signum) } } -#ifdef _WIN32 -BOOL WINAPI sigIntHandler(_In_ DWORD dwCtrlType) { - switch (dwCtrlType) - { - case CTRL_C_EVENT: - signalHandler(15); - return TRUE; - default: - // Pass signal on to the next handler - return FALSE; - } -} -#endif - int Networking::mainLoop() { RakNet::Packet *packet; @@ -521,15 +505,16 @@ int Networking::mainLoop() sigIntHandler.sa_handler = signalHandler; sigemptyset(&sigIntHandler.sa_mask); sigIntHandler.sa_flags = 0; - sigaction(SIGTERM, &sigIntHandler, NULL); - sigaction(SIGINT, &sigIntHandler, NULL); -#else - SetConsoleCtrlHandler(sigIntHandler, TRUE); #endif while (running and !killLoop) { - mwmp_input::handler(); +#ifndef _WIN32 + sigaction(SIGTERM, &sigIntHandler, NULL); + sigaction(SIGINT, &sigIntHandler, NULL); +#endif + if (kbhit() && getch() == '\n') + break; for (packet=peer->Receive(); packet; peer->DeallocatePacket(packet), packet=peer->Receive()) { if (getMasterClient()->Process(packet)) diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index a746990d4..715434d0f 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -220,8 +220,7 @@ public: {"OnClientScriptLocal", Callback()}, {"OnClientScriptGlobal", Callback()}, {"OnMpNumIncrement", Callback()}, - {"OnRequestDataFileList", Callback<>()}, - {"OnServerWindowInput", Callback()} + {"OnRequestDataFileList", Callback<>()} }; };