gamecircle.Whispersync.DeveloperString

Type Table
Library gamecircle.*
Revision Release 2024.3703
Keywords whispersync, developerstring, string, merging

Overview

The table returned from the GetDeveloperString function. The table includes the local data as well as cloud data, and can tell you if the data is in conflict. A useful feature for when new data is downloaded by Whispersync from Amazon's cloud servers.

Properties

Example

local gamecircle = require("plugin.gamecircle")  
gamecircle.Init(false, false, true)   
local devString = gamecircle.Whispersync.GetDeveloperString("myFirstDevString")  
local newStringValue = devString.value .. "a"  
gamecircle.Whispersync.SetDeveloperString("myFirstDevString", newStringValue)  

print("These are all the Developer Strings I've generated under the current GameData set of Whispersync.")  
local keys = gamecircle.Whispersync.GetDeveloperStringKeys()  
for i,key in ipairs(keys) do  
    print("-" .. key)  
end  

function WhispersyncCallback(event)  
    if event == "NEW_DATA" then  
        local checkDevString = gamecircle.Whispersync.GetDeveloperString("myFirstDevString")  
        if checkDevString.inConflit then  
            print("The Developer String is in conflict! Using cloud data and marking as resolved")  
            gamecircle.Whispersync.SetDeveloperString("myFirstDevString", checkDevString.cloudValue)  
            gameCircle.Whispersync.MarkAsResolved("myFirstDevString")  
        end  
    end  
end  
gamecircle.Whispersync.SetWhispersyncEventListener(WhispersyncCallback)