Closed starfi5h closed 7 months ago
Are these playerdata commands only available for the host/authenticated clients? If not, should they be limited?
Currently it only has effects in host, as client will see 0 player data in SaveManager. I'm not sure if it should be open to clients.
Also not a blocking issue but:
After transferring the save files, get the stored player data instead of the data from the previous host.
So once this is done, the player data from the previous host is permanently lost? If the save is transferred back then the original host would be stuck with the other host's player data, and the other host's player data doesn't get updated to match what was done on the main data?
No. It's not lost. As in SaveManager.SaveServerData(), it will store all the hash-IPlayerData pair in playerSaves
and the host hash-IPlayerData in the .server
file.
When a /playerdata load
command is used, it just copys the inventory and appearance, the source pair is still in the SaveManager. So as long as the original host's player.key
file remains the same. it can login to get back the data.
I think the best solution would be to just have the host's data also stored in the .server file with a hash (so the host would also generate a key file), and then swapping back and forth would be possible.
It's already implemented in https://github.com/NebulaModTeam/nebula/blob/master/NebulaNetwork/SaveManager.cs#L45-L47
Construction drones range limit
Make construction drones only launch if the local player is closer than other remote players, or within 15m. So that the drones won't try to fly to far prebuild that will be built by other players first.
SaveManager
Clear playerSaves from the previous session when server starts.
Add new chat command
/playerdata
./playerdata list
: list all stored player data in format [hash] playerName/playerdata remove <hash>
: remove the target player data from SaveManager./playerdata load <hash>
: load the target player data to overwrite inventory and appearance of local player, then teleport to the stored location.With this command, it can achieve the following goal for the host: