[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pbmserv-dev] Werewolf/Haggis code



On Wed, Jul 28, 2004 at 10:09:04AM -0400, Richard Rognlie wrote:
> On Wed, Jul 28, 2004 at 09:29:52AM +0100, Geoff Hubbard wrote:
> > Can anyone see any problem with using the much simpler Data::Dumper to
> > dump and load game data structures out to file rather than the current
> > rather 'clever' save game implementation?
> 
> How would that affect hand tweaking of data files when necessary?

The Data::Dumper data file would look something like this:

$players = {
          'player6' => {
                         'queue' => undef,
                         'lastmove' => 1091026843,
                         'alias' => undef,
                         'joinorder' => '7',
                         'role' => 'villager',
                         'action' => 'sleeping'
                       },
          'player1' => {
                         'queue' => undef,
                         'lastmove' => 1091026843,
                         'alias' => 'incognito',
                         'joinorder' => '2',
                         'action' => undef,
                         'role' => 'werewolf'
                       },
        };

It gets read in and eval'ed by Perl to recover the data structures.
Perfectly tweakable and human readable.. 

Geoff.
kryten.
etc.