Topic: Saving data that persists across power cycles

My game widget needs to store the user's progress that will persist (on a chumby server) across power cycles.  Is this possible?  Any guidance would be appreciated.

I've come across the config discussions on this forum but my game doesn't need a config movie.  I simply need to store level progression info.

Thanks,

tom

Re: Saving data that persists across power cycles

You can use the same server save/restore code that's in the configuration movie in your widget.

Re: Saving data that persists across power cycles

Duane,

Thanks for the quick feedback.  Currently, I've been booting my widget of a thumb drive.  I assume that I'm now at a point where I have to upload the widget to the Chumby server in order to implement save/restore?

Thanks,

tom

Re: Saving data that persists across power cycles

Yes, because the save/restore requires a "widget instance id", which is assigned by the server to associate that particular copy of that widget in that particular channel for that particular user.

5 (edited by kgchumbydev 2007-11-05 11:48:16)

Re: Saving data that persists across power cycles

Duane,

Sorry to keep peppering you with questions today.  I uploaded my widget, configured a channel, etc. and it works as expected.  Cool.

The next step I'm trying to access the environment params, including '_chumby_instance_url' for save/restore.  I tried both:

debug_txt.text = this['_chumby_instance_url']
debug_txt.text = _root._chumby_instance_url
(where debug_txt is a dynamic text object)

but both return an undefined result.  No problems accessing this['_chumby_chumby_name'] or this['_chumby_widget_instance_id'].

Is there anything I have to do in order for '_chumby_instance_url' to be accessible?  I was under the impression that it was automatically set at run-time.

Edit: I'm trying to access '_chumby_instance_url' in my widget, not a config widget (don't need one).

Thanks,

tom

Re: Saving data that persists across power cycles

"_chumby_instance_url" is no longer supported - it wasn't very helpful and made an extremely poor key since it could vary from one execution to the next depending upon the server the widget_instance came from that time.  The key you want to use is "_chumby_widget_instance_id" - it's global across servers.

Re: Saving data that persists across power cycles

Duane,

I must be missing something fundamental.  All I have to go off of is the Banner example, that uses a url passed into the xml load/sendAndLoad().  I don't know how to use '_chumby_widget_instance_id'.  Is there any documentation, or better yet, an example that uses '_chumby_widget_instance_id' to save/restore simple data?  If not, could you please post a snippet for me?

Thanks,

tom

Re: Saving data that persists across power cycles

Please check for "_chumby_widget_instance_href" - I'm pretty sure that's what's *supposed* to be used by the configuration API.

Let me know if it's not there for you.

Re: Saving data that persists across power cycles

Duane,

That worked, thanks!

tom