feat: completely delete player
This commit is contained in:
@@ -248,12 +248,11 @@ void confirmDeleteForm(Player& pl, mce::UUID const& uuid, std::string const& nam
|
|||||||
);
|
);
|
||||||
fm.sendTo(pl, [uuid, name](Player& pl, ll::form::ModalFormResult result, ll::form::FormCancelReason) {
|
fm.sendTo(pl, [uuid, name](Player& pl, ll::form::ModalFormResult result, ll::form::FormCancelReason) {
|
||||||
if (result == ll::form::ModalFormSelectedButton::Upper) {
|
if (result == ll::form::ModalFormSelectedButton::Upper) {
|
||||||
auto player = GMLIB_Level::getLevel()->getPlayer(uuid);
|
if (auto player = GMLIB_Level::getLevel()->getPlayer(uuid)) {
|
||||||
if (player) {
|
|
||||||
return deleteFailedForm(pl, uuid, name);
|
return deleteFailedForm(pl, uuid, name);
|
||||||
}
|
}
|
||||||
GMLIB_Player::deletePlayerNbt(uuid);
|
GMLIB_Player::deletePlayer(uuid);
|
||||||
return pl.sendMessage(tr("checkPlayer.deleteNbt.success", {name}));
|
return pl.sendMessage(tr("checkPlayer.deletePlayer.success", {name}));
|
||||||
}
|
}
|
||||||
return checkPlayerForm(pl, uuid);
|
return checkPlayerForm(pl, uuid);
|
||||||
});
|
});
|
||||||
|
|||||||
+2
-2
@@ -41,7 +41,7 @@ std::string en_US = R"(
|
|||||||
checkPlayer.writeInventory.failed=Cannot cover player %s's backpack! nPlayer %s doesn't have any data!
|
checkPlayer.writeInventory.failed=Cannot cover player %s's backpack! nPlayer %s doesn't have any data!
|
||||||
form.confirmDelete.title=Confirm Delete Data
|
form.confirmDelete.title=Confirm Delete Data
|
||||||
form.confirmDelete.content=Are you sure you want to delete all of player %s's data? \nThis contains all the player's data in the save! \nIt's not just a backpack! \n\nAttention! nThis operation is irreversible! \nPlease proceed with caution
|
form.confirmDelete.content=Are you sure you want to delete all of player %s's data? \nThis contains all the player's data in the save! \nIt's not just a backpack! \n\nAttention! nThis operation is irreversible! \nPlease proceed with caution
|
||||||
checkPlayer.deleteNbt.success=Successfully deleted all of player %s's data!
|
checkPlayer.deletePlayer.success=Successfully deleted player from storage!
|
||||||
form.deleteFailed.title=Deletion failed
|
form.deleteFailed.title=Deletion failed
|
||||||
form.deleteFailed.content=Players %s online! You can't delete all of your players' data! \n\nIf you want to delete all player data, please kick the player out of the game before you do it!
|
form.deleteFailed.content=Players %s online! You can't delete all of your players' data! \n\nIf you want to delete all player data, please kick the player out of the game before you do it!
|
||||||
form.deleteFailed.returnCheck=Return to the check menu
|
form.deleteFailed.returnCheck=Return to the check menu
|
||||||
@@ -93,7 +93,7 @@ std::string zh_CN = R"(
|
|||||||
checkPlayer.writeInventory.failed=无法覆盖玩家 %s 的背包!\n玩家 %s 没有任何数据!
|
checkPlayer.writeInventory.failed=无法覆盖玩家 %s 的背包!\n玩家 %s 没有任何数据!
|
||||||
form.confirmDelete.title=确认删除数据
|
form.confirmDelete.title=确认删除数据
|
||||||
form.confirmDelete.content=你确定要删除玩家 %s 的全部数据吗?\n这包含玩家在存档的全部数据!\n不仅仅是背包!\n\n注意!\n此操作不可逆!\n请谨慎操作
|
form.confirmDelete.content=你确定要删除玩家 %s 的全部数据吗?\n这包含玩家在存档的全部数据!\n不仅仅是背包!\n\n注意!\n此操作不可逆!\n请谨慎操作
|
||||||
checkPlayer.deleteNbt.success=已成功删除玩家 %s 的全部数据!
|
checkPlayer.deletePlayer.success=已成功将玩家 %s 从存档删除!
|
||||||
form.deleteFailed.title=删除失败
|
form.deleteFailed.title=删除失败
|
||||||
form.deleteFailed.content=玩家 %s 在线!无法删除玩家全部数据!\n\n如需删除全部玩家数据,请先将该玩家踢出游戏再操作!
|
form.deleteFailed.content=玩家 %s 在线!无法删除玩家全部数据!\n\n如需删除全部玩家数据,请先将该玩家踢出游戏再操作!
|
||||||
form.deleteFailed.returnCheck=返回操作界面
|
form.deleteFailed.returnCheck=返回操作界面
|
||||||
|
|||||||
Reference in New Issue
Block a user