From cdc176a77767585532e03f99d0bd4abc9b3d9834 Mon Sep 17 00:00:00 2001 From: notify Date: Sun, 2 Jul 2023 22:43:56 +0800 Subject: [PATCH] Changelog: v0.2.8 --- CHANGELOG.md | 6 ++++++ CMakeLists.txt | 2 +- Fk/Logic.js | 1 + Fk/Pages/Room.qml | 7 ++++++- android/AndroidManifest.xml | 4 ++-- src/server/room.cpp | 4 ++-- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12a62313..5034f719 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ___ +## v0.2.8 + +修复测试0.2.7途中获得的bug。 + +___ + ## v0.2.7 1. 胜率直接写在脸上 diff --git a/CMakeLists.txt b/CMakeLists.txt index 42331db6..f4b02229 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16) -project(FreeKill VERSION 0.2.7) +project(FreeKill VERSION 0.2.8) add_definitions(-DFK_VERSION=\"${CMAKE_PROJECT_VERSION}\") find_package(Qt6 REQUIRED COMPONENTS diff --git a/Fk/Logic.js b/Fk/Logic.js index e3ba7b98..3d15eb4b 100644 --- a/Fk/Logic.js +++ b/Fk/Logic.js @@ -113,6 +113,7 @@ callbacks["EnterLobby"] = (jsonData) => { mainStack.pop(); } mainWindow.busy = false; + ClientInstance.notifyServer("RefreshRoomList", ""); config.saveConf(); } diff --git a/Fk/Pages/Room.qml b/Fk/Pages/Room.qml index 59436e7f..ecb85205 100644 --- a/Fk/Pages/Room.qml +++ b/Fk/Pages/Room.qml @@ -128,6 +128,7 @@ Item { "surrender", true ]); } + surrenderDialog.close(); break; } case MessageDialog.Cancel: { @@ -141,7 +142,11 @@ Item { id: quitButton text: Backend.translate("Quit") onClicked: { - quitDialog.open(); + if (config.observing) { + ClientInstance.notifyServer("QuitRoom", "[]"); + } else { + quitDialog.open(); + } } } diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 53c0c288..2f77721f 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -3,8 +3,8 @@ + android:versionCode="208" + android:versionName="0.2.8"> diff --git a/src/server/room.cpp b/src/server/room.cpp index 1ed0bcd8..684aea12 100644 --- a/src/server/room.cpp +++ b/src/server/room.cpp @@ -109,6 +109,7 @@ ServerPlayer *Room::getOwner() const { return owner; } void Room::setOwner(ServerPlayer *owner) { this->owner = owner; + if (!owner) return; QJsonArray jsonData; jsonData << owner->getId(); doBroadcastNotify(players, "RoomOwner", JsonArray2Bytes(jsonData)); @@ -177,13 +178,11 @@ void Room::addPlayer(ServerPlayer *player) { player->doNotify("UpdateGameData", JsonArray2Bytes(jsonData)); } - /* if (this->owner != nullptr) { jsonData = QJsonArray(); jsonData << this->owner->getId(); player->doNotify("RoomOwner", JsonArray2Bytes(jsonData)); } - */ if (player->getLastGameMode() != mode) { player->setLastGameMode(mode); @@ -283,6 +282,7 @@ void Room::removePlayer(ServerPlayer *player) { if (isAbandoned()) { bool tmp = m_abandoned; m_abandoned = true; + setOwner(nullptr); // 只释放一次信号就行了,他销毁机器人的时候会多次调用removePlayer if (!tmp) { emit abandoned();