diff --git a/CAPI/cpp/API/src/logic.cpp b/CAPI/cpp/API/src/logic.cpp index b3e42ab..e56ffb9 100644 --- a/CAPI/cpp/API/src/logic.cpp +++ b/CAPI/cpp/API/src/logic.cpp @@ -369,7 +369,6 @@ void Logic::ProcessMessage() break; } } - AILoop = false; { std::lock_guard lock(mtxBuffer); bufferUpdated = true; @@ -377,6 +376,7 @@ void Logic::ProcessMessage() } cvBuffer.notify_one(); logger->info("Game End!"); + AILoop = false; }; std::thread(messageThread).detach(); } diff --git a/CAPI/python/PyAPI/logic.py b/CAPI/python/PyAPI/logic.py index e1dcf7f..dd8c4b3 100644 --- a/CAPI/python/PyAPI/logic.py +++ b/CAPI/python/PyAPI/logic.py @@ -314,13 +314,13 @@ class Logic(ILogic): else: self.__logger.error("Unknown GameState!") continue - self.__AILoop = False with self.__cvBuffer: self.__bufferUpdated = True self.__counterBuffer = -1 self.__cvBuffer.notify() self.__logger.info("Game End!") self.__logger.info("Message thread end!") + self.__AILoop = False threading.Thread(target=messageThread).start() diff --git a/CAPI/python/run.sh b/CAPI/python/run.sh index d787ec8..91ab15c 100755 --- a/CAPI/python/run.sh +++ b/CAPI/python/run.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 0& +python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 0 -d -o& # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 1 -o& # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 2& # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 3& -python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 4 -d& \ No newline at end of file +python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 4& \ No newline at end of file