Jump to content

User save files format? What is stored when saving `player.player_classified.entity`?


Recommended Posts

I checked the user save file in Master\save\session\session_id\user_id\XXXX. I wonder what is the strange encoded strings at the end of the files. Are they just the player.player_classified.MapExplorer? I delete them and find the revealed map has been cleared. I wonder if deleting them have any other side effects?

I viewed the SerializeUserSession in networking.lua (I also paste the function below).

function SerializeUserSession(player, isnewspawn)
    if player ~= nil and player.userid ~= nil and player.userid:len() > 0 and (player == ThePlayer or TheNet:GetIsServer()) then
        --we don't care about references for player saves
        local playerinfo--[[, refs]] = player:GetSaveRecord()
        local data = DataDumper(playerinfo, nil, BRANCH ~= "dev")

        local metadataStr = ""

        if TheNet:GetIsServer() then
            local metadata = {
                character = player.prefab,
            }
            metadataStr = DataDumper(metadata, nil, BRANCH ~= "dev")
        end

        TheNet:SerializeUserSession(player.userid, data, isnewspawn == true, player.player_classified ~= nil and player.player_classified.entity or nil, metadataStr)
    end
end

It seems player.player_classified.entity have nothing special except the AddMapExplorer. See the codes below that I copy from  the player_classified.lua. So I get those strange strings in the user save file is just about MapExplorer.

local inst = CreateEntity()

inst.entity:AddTransform() --So we can follow parent's sleep state
inst.entity:AddMapExplorer()
inst.entity:AddNetwork()
inst.entity:Hide()
inst:AddTag("CLASSIFIED")

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...