Since you're storing character data for registered, logged-in players, is
it possible you could store *all* characters in the database, and then,
when the *non*-logged-in player closes the browser window, flush the
character data from the database? You seem to want to avoid long-term
storage of data for those players who don't register/login, and this would
give you that effect. Then you could use Leonel's approach of passing args.
If you go this route, you might also want to place a time limit on how long
the non-registered player gets to play, like maybe a four-hour limit or a
one day limit or whatever works for your goals in writing this game.
On Wednesday, March 18, 2015 at 12:50:51 PM UTC-4, Gray Kanarek wrote:
>
> I wasn't clearing the session itself, just those two variables (setting
> session.char_dict = {}, session.gamestate = ""), but your point is taken,
> especially with how poorly my current solution is working.
>
> I can't pass around just the id (which was a previous implementation that
> I tried) because characters do not get stored in the database at all (and
> therefore don't have an id) unless the player has an account and is logged
> in. Additionally, any changes to the character are only written to the
> database when the game is saved, again requiring auth.is_logged_in();
> turn-by-turn changes are stored in the character dict only.
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.