OpenFeint Question

Hello there,

A quick question on OpenFeint: I have all of it working, except that if someone either:

  1. Selects the option to “not use these cool features”
  2. Logs in while not connected to the internet
  3. Logs in while connected to the internet and then loses the connection during play

OpenFeint will proceed to save data (high scores, achievements) locally. Which leads to the question…
Does OpenFeint automatically upload what it saves locally the next time there is an internet connect and the player is logged in, or is there something I have to do to facilitate that?

…or do I need to create an algorithm that checks the local save and spams all saved high scores, achievements, etc. each time the player logs in?

Thanks! [import]uid: 36054 topic_id: 7574 reply_id: 307574[/import]

I recall that if you include a file called"openfeint_offline_config.xml" that you can download when logged in to the openfeint website as a developer then this will perform the functionality you require. I have not really tested this yet though.
As you are using openfeint, would you mind telling me if you launch openfeint immediately as soon as your game first launches or do you require the player to press a button to initialise it? I tried to have it only launch when a button is pressed but it seemed to cause crashes. Therefore I am seeking a robust solution to this.

[import]uid: 7863 topic_id: 7574 reply_id: 26880[/import]

Definitely a button. Never annoy the user with pop-ups :slight_smile: I will try what you said after work today.

Here is OpenFeint with a button:

  
local callOpenFeint = function()  
 openfeint.init("", "", "Name", "")  
 openfeintEnabled = true  
 openfeint.launchDashboard()  
end  
  
local function openfeintButtonPress( event )  
 if event.phase == "release" then  
 if event.id == "openfeintButton" then  
 callOpenFeint()  
 end  
 end  
end  
  
local openfeintButton = ui.newButton  
 {  
 default = "circleRed.png",  
 over = "circleRedOver.png",  
 onEvent = openfeintButtonPress,  
 id = "openfeintButton",  
 text = "O",  
 emboss = true,  
 x = 200,  
 y = 200  
 }  

Note: You don’t actually need the event.id == “openfeintButton” part as you only have one button in this example, but it’s good practice for tying multiple buttons to one handler (so that you don’t have to keep writing different handlers)

[import]uid: 36054 topic_id: 7574 reply_id: 26899[/import]

@blasterv

Hey thanks for this. I think I did try something like that where I had a global variable boolOpenFeintInitialised (that I saved to disk) however my testers were reporting it crashing when they clicked on the button on subsequent visits. I think there was another issue if the user opened the openfeint dashboard but did not choose to enable it. The global variable was set as if it was enabled or something like that.

Anyway I will give it another go as I do find the popup appearing really annoying. [import]uid: 7863 topic_id: 7574 reply_id: 26903[/import]

On the first point: You don’t want to call init more than once. There is no reason to. That’s why the bool is there, to prevent you from doing that.

On the second point: It doesn’t matter whether they agree or not. As soon as INIT is called, OpenFeint is activated and will work, though if the user does not enable it things will occur locally (which brings us back to my problem – trying your solution now actually).
[import]uid: 36054 topic_id: 7574 reply_id: 27002[/import]

Sadly putting the offline XML into my project doesn’t do anything. Perhaps there is something I need to do to include it/activate it, or perhaps it is simply not supported? [import]uid: 36054 topic_id: 7574 reply_id: 27003[/import]

@blasterv - any joy with the offline functionality?

Also just wanted to say thanks for the help with initialising openFeint with a button. This seems to working grand now. [import]uid: 7863 topic_id: 7574 reply_id: 27362[/import]

No problem. Sadly, no luck at all. [import]uid: 36054 topic_id: 7574 reply_id: 27469[/import]

Huh, it is now working for high scores (local scores get uploaded automatically), but not achievements. I think at this point, just to be safe, I will store things locally myself. [import]uid: 36054 topic_id: 7574 reply_id: 27564[/import]