I recently added a new game to my website that uses some custom Storable
hooks for serialization. All of a sudden I'm getting this weird error.
Can anyone tell me why this particular error is coming up and how I
can figure out exactly what is happening? Thanks so much for your time!
P.S. SDG::Game line 608 is:
my $game = thaw($data);
------------
System error
error: code sub {
package Golem::Game;
use strict 'refs';
my $state = shift @_;
my $game = $state->notes('game') || die;
my $phase = $state->notes('phase') || die;
my(@order) = (sort {$b->allocated($phase) <=> $a->allocated($phase);}
@{$$game{'players'};});
my $msg = 'The allocations for ' . uc($phase) . ' are: ';
my @list;
foreach my $player (@order) {
push @list, $player->name . ' ' . $player->allocated($phase);
}
$msg .= join(', ', @list);
$game->log($msg);
if ($order[0]->allocated($phase) == $order[1]->allocated($phase)) {
my $winner;
my @tied;
push @tied, shift @order;
push @tied, shift @order while $order[0]->allocated($phase) ==
$tied[-1]->allocated($phase);
my $archmage;
foreach my $player (@tied) {
if ($$game{'archmage'} == $player->index) {
$archmage = $player;
last;
}
}
if (defined $archmage) {
$winner = $archmage;
}
else {
my $count = $$game{'archmage'};
MAIN: do {
$count = ($count + 1) % scalar(@{$$game{'players'};});
foreach my $player (@tied) {
if ($count == $player->index) {
$winner = $player;
last MAIN;
}
}
} while $count != $$game{'archmage'};
}
die if not defined $winner;
$state->notes('winner', $winner);
my $owner;
foreach my $player (@{$$game{'players'};}) {
if ($player->hasArtifact('loki')) {
$owner = $player;
last;
}
}
if (defined $owner) {
$state->notes('tied', \@tied);
$owner->mustMove;
$$game{'currplayer'} = $owner->index;
$game->log($owner->name . ' possesses the Amulet of Loki. We now wait to
see if they will use it to resolve this conflict. Otherwise, ' .
$winner->name . ' will be declared the victor.');
}
}
else {
$state->notes('winner', $order[0]);
}
} caused an error: Can't locate object method "throw" via package
"HTML::Mason::Exception" (perhaps you forgot to load
"HTML::Mason::Exception"?) at
/usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/Exceptions.pm line 129.
Stack:
[blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/thaw.al):366]
[/home/html/games/lib/SDG/Game.pm:608]
[/home/html/games/HTML/mhtml/welcome.mhtml:8]
[/home/html/games/HTML/main.html:28]
[/home/html/games/HTML/autohandler:10], at
/home/html/games/lib/SDG/Game.pm line 608
context: ...
265: # whether they should generate a full stack trace (confess() and
cluck())
266: # or simply report the caller's package (croak() and carp()),
respectively.
267: # confess() and croak() die, carp() and cluck() warn.
268:
269: sub croak { die shortmess @_ }
270: sub confess { die longmess @_ }
271: sub carp { warn shortmess @_ }
272: sub cluck { warn longmess @_ }
273:
...
code stack: /usr/local/lib/perl5/5.8.7/Carp.pm:269
blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/logcroak.al):74
blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/thaw.al):367
/home/html/games/lib/SDG/Game.pm:608
/home/html/games/HTML/mhtml/welcome.mhtml:8
/home/html/games/HTML/main.html:28
/home/html/games/HTML/autohandler:10
--
Aaron Dalton | Super Duper Games
aaron@... | http://superdupergames.org
|