Hello Guest

[CLOSED] AppletLoader should provide random UUID per domain

  • 7 Replies
  • 12763 Views
The AppletLoader should create a random UUID per domain and store this value locally.
This can then be passed via a system property (eg "lwjgl.appletloader.uuid") to the user applet.
An unsigned applet (using the pre-signed LWJGL version from the applet loader zip) can use this UUID to store per user data on the server (like save games).

Optionally the UUID could be different per applet if this is required for privacy reasons or if it simplifies the implementation.

*

Offline Matzon

  • *****
  • 2242
Re: [RFE] AppletLoader should provide random UUID per domain
« Reply #1 on: May 11, 2011, 09:53:10 »
wouldn't it make more sense that the page serving the applet adds its own uuid for its user?

Re: [RFE] AppletLoader should provide random UUID per domain
« Reply #2 on: May 12, 2011, 00:40:39 »
If it just passed random UUID's, two people could end up having the same ID and then two people would be using the same row from the database (although this would be extremely rare).

If have to make unique UUID's, LWJGL does not know what UUID's are already in your database (or on users' file system).

Best option would be to just make a string with datetime(nanoseconds?)+UUID yourself.

Unless I'm missing something more significant here?
cool story, bro

Re: [RFE] AppletLoader should provide random UUID per domain
« Reply #3 on: May 12, 2011, 06:21:14 »
That's all already handled by the UUID class. The chance of a collision is so small that it doesn't matter.

I could use a PHP script (or similar) to create a modified applet page to include such a value and store it via a cookie.
But I would still use a UUID based approach so that I don't need to create a database entry on every page load.
But I'm not sure what PHP has to offer which is comparable to the UUID class - as this class uses cryptographic random generators.

Re: [RFE] AppletLoader should provide random UUID per domain
« Reply #4 on: May 12, 2011, 18:39:46 »
Generating a UUID on first run is the way the google people recommend for tracking the installation of an android app, so you can store user data on the server, like user config, savegames, etc, exactly the same use case that Mattias is asking here.

The advantage of doing it on the appletloader instead of on the webpage with php is that the work is done only once on the appletloader instead of everyone who wants that feature having to implement that.

One disadvantage of doing it on the appletloader is that if you want your app to be deployed also as a webstart, or a standalone instalation (zip + script, or runnable jar) then you would need to do this in your own code instead of on the appletloader because that is only used on the applet deployment.


*

Offline kappa

  • *****
  • 1319
Re: [RFE] AppletLoader should provide random UUID per domain
« Reply #5 on: May 12, 2011, 18:50:39 »
just curious, why this feature can't be implemented on the applet that is loaded instead of the appletloader?
« Last Edit: May 12, 2011, 18:58:07 by kappa »

Re: [RFE] AppletLoader should provide random UUID per domain
« Reply #6 on: May 12, 2011, 19:01:14 »
Because an unsigned applet has no way to save that UUID.

*

Offline kappa

  • *****
  • 1319
Re: [RFE] AppletLoader should provide random UUID per domain
« Reply #7 on: May 12, 2011, 19:39:10 »
Two decent options available these days to save data from Java Applets (without breaking the sandbox)

1) Java Muffins - You get 100kb of local storage. Muffin support is pretty widespread nowadays so pretty usable. Used through JNLP api's.
2) HTML5 Local Storage - You get 5mb local storage and its supported on all modern browsers.

Alternatively we could just add an API to LWJGL that'd give you access to a limited amount of storage (usable from applet or java web start) for example a small class in lwjgl_util.jar.
« Last Edit: May 12, 2011, 19:59:41 by kappa »