I guess that CloudKit is focus on storage in the cloud not only for gaming. Apple says developers do not need to write server-side code for save data on the cloud.
I can't find any documentation as to how to use cloud saves with the Gaming plugin (including setting it up on iTunes and Google Play). Can someone point me in the right direction?
function processLoad(e)if e.key==0thenif e.data and e.data~=""thenlocal savedata=json.decode(e.data)if savedata thenlocal loopMax=#savedata
if loopMax>levelMax then
loopMax=levelMax
end
lev=1for loop=1,loopMax do-- starsif scores[loop][1]<savedata[loop][1]then
scores[loop][1]=savedata[loop][1]end--highscoreif scores[loop][3]<savedata[loop][2]then
scores[loop][3]=savedata[loop][2]endif scores[loop][1]>0then
lev=loop+1endendif lev>currentLevel then
fullMapDraw=trueif lev>levelMax then
lev=levelMax
endif lev>=(cloudLevel-1)then
lev=cloudLevel-1end
currentLevel=lev
print("*** Current level: "..currentLevel)endendendendend
print("saving 0 to google")
googleplayG:updateState(0,saveString)
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
(the savestring being the opposite json of savedata)
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Thanks! This looks what I implemented when testing, but on iOS. In my case nothing is returned when loadState is called.
I have enabled cloud kit in my app, and it shows up in the iTunes console. But I get no responses at all when calling the cloud services. Not even a nice little random crash.
How do I set this up properly? Is there a guide? How does it work on Google Play?
I set it up the same on iOS (from what I remember, it's been over 12 months)
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Im finishing my game, but Im having the same problem as @totebo comented
"I have enabled cloud kit in my app, and it shows up in the iTunes console. But I get no responses at all when calling the cloud services. Not even a nice little random crash. "
On googleplay services all works nice, but with ios nothing happened.
my code is like this.
- loggin to game center - if error i created a game in local - if loggin completed then loadstate(0) (here i check if there are a key created or not) but STATE_LOADED or STATE_ERROR doesnt work, so my game wait until infinite.
Im testing in the last xcode version, with last gideros version (2018.2.1) in simulator.
i have configure my apple id with icloud services like apple help says.
ok, i think i found the solution ... at least state_loaded and state_error works now.
in gaming ios plugin, inside frameworks folder/ GameGamekit.m:
I commented lines where self.ubiq is check. I think ubiq container is old thing of ios, now depends of icloud container, so plugin never gets self.ubiq url, so loadstate function now works like this:
-(void)loadState:(int)key{ // if(self.ubiq) { --- I commented this to uncheck the never declarate self.ubiq [GameClass stateLoaded:[self class] with:key with:[[NSUbiquitousKeyValueStore defaultStore] objectForKey:[NSString stringWithFormat:@%d, key]] with:1]; // } }
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Hey, not actively! I haven't got a project that needs it at the moment, but may have a bash if I start one. Although I may go with Xtralife instead, which seems more flexible.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Comments
Like this one:
https://github.com/gideros/giderosplugins/blob/master/Gaming/source/IOS/Plugins/Gaming/frameworks/GameGamekit.m
I guess that CloudKit is focus on storage in the cloud not only for gaming. Apple says developers do not need to write server-side code for save data on the cloud.
Gaming:loadState(key)
Gaming:updateState(key, data[, immediate])
Gaming:deleteState(key)
Gaming:resolveState(key, version, data)
https://deluxepixel.com
https://deluxepixel.com
I have enabled cloud kit in my app, and it shows up in the iTunes console. But I get no responses at all when calling the cloud services. Not even a nice little random crash.
How do I set this up properly? Is there a guide? How does it work on Google Play?
https://deluxepixel.com
Likes: totebo
https://deluxepixel.com
Im finishing my game, but Im having the same problem as @totebo comented
"I have enabled cloud kit in my app, and it shows up in the iTunes console. But I get no responses at all when calling the cloud services. Not even a nice little random crash. "
On googleplay services all works nice, but with ios nothing happened.
my code is like this.
- loggin to game center
- if error i created a game in local
- if loggin completed then loadstate(0) (here i check if there are a key created or not)
but STATE_LOADED or STATE_ERROR doesnt work, so my game wait until infinite.
Im testing in the last xcode version, with last gideros version (2018.2.1) in simulator.
i have configure my apple id with icloud services like apple help says.
any idea? or someone with same problem?
thanks
in gaming ios plugin, inside frameworks folder/ GameGamekit.m:
I commented lines where self.ubiq is check. I think ubiq container is old thing of ios, now depends of icloud container, so plugin never gets self.ubiq url, so loadstate function now works like this:
-(void)loadState:(int)key{
// if(self.ubiq) { --- I commented this to uncheck the never declarate self.ubiq
[GameClass stateLoaded:[self class] with:key with:[[NSUbiquitousKeyValueStore defaultStore] objectForKey:[NSString stringWithFormat:@%d, key]] with:1];
// }
}
the same for all methods where self.ubiq is check
I think plugin should be update in next realease @SinisterSoft @ar2rsawseen @hgy29
thanks for this great engine guys
Likes: totebo, SinisterSoft
https://deluxepixel.com
Likes: SinisterSoft
https://deluxepixel.com