Changelog: v0.2.8

This commit is contained in:
notify 2023-07-02 22:43:56 +08:00
parent 4731ddc802
commit cdc176a777
6 changed files with 18 additions and 6 deletions

View File

@ -2,6 +2,12 @@
___ ___
## v0.2.8
修复测试0.2.7途中获得的bug。
___
## v0.2.7 ## v0.2.7
1. 胜率直接写在脸上 1. 胜率直接写在脸上

View File

@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.16) 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}\") add_definitions(-DFK_VERSION=\"${CMAKE_PROJECT_VERSION}\")
find_package(Qt6 REQUIRED COMPONENTS find_package(Qt6 REQUIRED COMPONENTS

View File

@ -113,6 +113,7 @@ callbacks["EnterLobby"] = (jsonData) => {
mainStack.pop(); mainStack.pop();
} }
mainWindow.busy = false; mainWindow.busy = false;
ClientInstance.notifyServer("RefreshRoomList", "");
config.saveConf(); config.saveConf();
} }

View File

@ -128,6 +128,7 @@ Item {
"surrender", true "surrender", true
]); ]);
} }
surrenderDialog.close();
break; break;
} }
case MessageDialog.Cancel: { case MessageDialog.Cancel: {
@ -141,9 +142,13 @@ Item {
id: quitButton id: quitButton
text: Backend.translate("Quit") text: Backend.translate("Quit")
onClicked: { onClicked: {
if (config.observing) {
ClientInstance.notifyServer("QuitRoom", "[]");
} else {
quitDialog.open(); quitDialog.open();
} }
} }
}
MessageDialog { MessageDialog {
id: quitDialog id: quitDialog

View File

@ -3,8 +3,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.notify.FreeKill" package="org.notify.FreeKill"
android:installLocation="preferExternal" android:installLocation="preferExternal"
android:versionCode="207" android:versionCode="208"
android:versionName="0.2.7"> android:versionName="0.2.8">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

View File

@ -109,6 +109,7 @@ ServerPlayer *Room::getOwner() const { return owner; }
void Room::setOwner(ServerPlayer *owner) { void Room::setOwner(ServerPlayer *owner) {
this->owner = owner; this->owner = owner;
if (!owner) return;
QJsonArray jsonData; QJsonArray jsonData;
jsonData << owner->getId(); jsonData << owner->getId();
doBroadcastNotify(players, "RoomOwner", JsonArray2Bytes(jsonData)); doBroadcastNotify(players, "RoomOwner", JsonArray2Bytes(jsonData));
@ -177,13 +178,11 @@ void Room::addPlayer(ServerPlayer *player) {
player->doNotify("UpdateGameData", JsonArray2Bytes(jsonData)); player->doNotify("UpdateGameData", JsonArray2Bytes(jsonData));
} }
/*
if (this->owner != nullptr) { if (this->owner != nullptr) {
jsonData = QJsonArray(); jsonData = QJsonArray();
jsonData << this->owner->getId(); jsonData << this->owner->getId();
player->doNotify("RoomOwner", JsonArray2Bytes(jsonData)); player->doNotify("RoomOwner", JsonArray2Bytes(jsonData));
} }
*/
if (player->getLastGameMode() != mode) { if (player->getLastGameMode() != mode) {
player->setLastGameMode(mode); player->setLastGameMode(mode);
@ -283,6 +282,7 @@ void Room::removePlayer(ServerPlayer *player) {
if (isAbandoned()) { if (isAbandoned()) {
bool tmp = m_abandoned; bool tmp = m_abandoned;
m_abandoned = true; m_abandoned = true;
setOwner(nullptr);
// 只释放一次信号就行了他销毁机器人的时候会多次调用removePlayer // 只释放一次信号就行了他销毁机器人的时候会多次调用removePlayer
if (!tmp) { if (!tmp) {
emit abandoned(); emit abandoned();