diff --git a/MANIFEST.in b/MANIFEST.in index 1ea9e98..d563700 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,4 @@ graft palworld_server_toolkit/PalEdit/resources -graft palworld_server_toolkit/resources \ No newline at end of file +prune palworld_server_toolkit/resources/items +prune palworld_server_toolkit/resources/pal_category +prune palworld_server_toolkit/resources/pal_inventory \ No newline at end of file diff --git a/README.en.md b/README.en.md index 8f5509c..53e2a0b 100644 --- a/README.en.md +++ b/README.en.md @@ -123,6 +123,7 @@ This tools is for cleanup the unreference item, rename the player name, migrate - `CopyPlayer(old_uid,new_uid, backup_wsd)` - Copy the player from old PlayerUId to new PlayerUId `backup_wsd` is the OpenBackup file, `wsd` is current file - `BatchDeleteUnreferencedItemContainers()` - Delete Unreference Item Containers - `FixBrokenDamageRefItemContainer()` - Delete Damage Instance + - `FindInactivePlayer(day)` - Find player that not active - `Save()` - Save the file and exit @@ -202,6 +203,16 @@ This tools is for cleanup the unreference item, rename the player name, migrate Save() ``` +- Clean the player that 7 days not online + + 1. Use interactive mode `python -i -m palworld_server_toolkit.editor Level.sav` + 1. Execute following command + ``` + for player_uid in FindInactivePlayer(7): DeletePlayer(player_uid) + Save() + ``` + + --- diff --git a/README.md b/README.md index 1d81aa7..d192935 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ QQ群 139107098 - `CopyPlayer(old_uid,new_uid, backup_wsd)` - 复制玩家数据 `backup_wsd` 为OpenBackup备份文件 `wsd`为当前主文件 - `BatchDeleteUnreferencedItemContainers()` - 删除未引用的物品库 - `FixBrokenDamageRefItemContainer()` - 删除损坏对象 + - `FindInactivePlayer(day)` - 找出天未上线的玩家 - `Save()` - 保存修改并退出 ### 操作示例 @@ -193,6 +194,15 @@ QQ群 139107098 Save() ``` +- 清理7天未上线玩家 + + 1. 使用编辑模式运行 `python -i -m palworld_server_toolkit.editor Level.sav` + 2. 使用以下命令 + ``` + for player_uid in FindInactivePlayer(7): DeletePlayer(player_uid) + Save() + ``` + --- ## palworld-player-list diff --git a/palworld_server_toolkit/editor.py b/palworld_server_toolkit/editor.py index 2a3c686..78c2eb2 100644 --- a/palworld_server_toolkit/editor.py +++ b/palworld_server_toolkit/editor.py @@ -2238,7 +2238,7 @@ def GetPlayerGvas(player_uid): "-", "") + ".sav" if not os.path.exists(player_sav_file): - return player_sav_file, None, None, None + return player_sav_file, None, player_sav_file, None with open(player_sav_file, "rb") as f: raw_gvas, _ = decompress_sav_to_gvas(f.read())