1 [- use FROGS::Config qw($conf); -]
3 <head><link rel="stylesheet" type="text/css" href="aymargeddon.css">
4 <title>Aymargeddon</title></head>
7 $udat{-current} = 'player.epl';
11 $db = DataBase->new();
16 $id = $db->authenticate($fdat{'login'},$fdat{'passwd'},
17 $fdat{'passwd2'},$fdat{'passwd3'});
20 $db->set_language($udat{-lang});
21 #set language in Database in PLAYER.LANGUAGE
22 $db->update_hash('PLAYER',"PLAYER=$id",{'LANGUAGE' => $udat{-lang}});
25 # set language according to PLAYER.LANGUAGE
26 # read_player() returns the first DB line in ARRAY format
27 ($udat{-lang}) = $db->read_player($id,'LANGUAGE');
32 # TODO: klappt nich :-(
33 # $out = '<body style="font-size:10pt" bgcolor="'.$conf->{-COLOR}->{-EMPTY}.'">';
34 $out = '<body style="line-height:12pt;font-size:10pt">';
38 [$ if $id $] [# logged in - show game list, messages, etc. pp. #]
44 $udat{-game} = $fdat{'game'} if exists $fdat{'game'};
45 $aym = Aymargeddon->new($udat{-game},$id,$db) if exists $udat{-game};
47 if(exists $fdat{'game'}){
48 $udat{-loc} = $aym->startfield();
49 $udat{-loc} =~ /^(\d+)\_(\d+)$/;
50 my ($x,$y) = ($1, $2);
51 my $size = $aym->get_size();
52 $udat{-xoff} = $x -$size;
58 # register for selected role in game
59 if($fdat{'role'} and $fdat{'charname'}){
60 my $return = $aym->new_role($fdat{'role'},
63 # $fdat{'description'});
65 print OUT "<strong>Error: cant register role.</strong><p>";
69 # delete all messages if wanted.
70 # TODO: write timestamp in link and delete only to this time
71 if($fdat{delete_all_messages} == 1){
72 $aym->delete_all_messages($fdat{time});
78 $own_games = $db->games_of_player($id);
79 $open_games = $db->open_games("HOME=-1");
82 for my $og (@$own_games){
86 @real_open_games = ();
87 for $og (@$open_games){
88 push @real_open_games, $og unless exists $such{$og->[0]};
90 # Util::log("real open games: ". Dumper(\@real_open_games), 2);
91 ($rn) = $db->read_player($id, 'REALNAME') unless exists $udat{-game};
94 [$ if not exists $udat{-game} $]
96 [+ $db->loc('PLAYER_WELCOME').' Aymargeddon '.$rn +]!<p>
100 <table width=100% border=0><colgroup><col width="200"><col></colgroup>
101 <tr><td valign="top" bgcolor="#b8a266">
102 <p>[+ $db->loc('PLAYER_OWN_GAMES') +]<p>
103 [$ foreach $og (@$own_games) $]
104 [- $og = $og->[0]; ($og_name) = $db->read_game($og,'NAME'); -]
105 <a href="player.epl?game=[+$og+]">[+$og_name+]</a><p>
107 [$ if $#{@$own_games} < 0 $]
108 [+ $db->loc('PLAYER_GAMES_NONE') +]<p>
111 <p>[+ $db->loc('PLAYER_OPENGAMES') +]:<p>
112 [$ foreach $og (@real_open_games) $]
113 [- ($og_name) = $db->read_game($og,'NAME'); -]
114 <a href="player.epl?game=[+$og+]">[+$og_name+]</a><p>
116 [$ if $#{@real_open_games} < 0 $]
117 [+ $db->loc('PLAYER_GAMES_NONE') +]<p>
120 <td valign="top" bgcolor="#fcffd9">
121 [$ if not exists $udat{-game} $]
123 [+ $db->loc('PLAYER_CHOOSE_GAME') +]
125 [$ elsif exists $fdat{'cmd'} $]
126 [- Execute('command_frames.epl') -]
127 [$ elsif $such{$udat{-game}} $]
131 ($gn) = $db->read_game($udat{-game},'NAME');
132 my @list = $aym->charname($udat{-id});
135 [+ $db->loc('PLAYER_WELCOME') +] <strong>[+ $gn +]</strong>, [+ $cn +].<p>
140 $messages = $aym->read_messages();
143 <strong>[+ $db->loc('PLAYER_MESSAGES_HEADING') +]</strong><p>
144 <a href="player.epl?delete_all_messages=1&time=[+$now+]">
145 [+ $db->loc('PLAYER_DELETE_MESSAGES')+]</a><p>
146 [$ foreach $msg (@$messages) $]
147 [+ $aym->show_message($msg->[0]) +]<br>
149 [$ if $#{@$messages} < 0 $]
150 [+ $db->loc('PLAYER_NO_MESSAGE') +]
153 [# we dont show events in a global list any more
154 <strong>[+ $db->loc('PLAYER_EVENTS') +]</strong><p>
156 $events = $aym->role_events();
158 [$ foreach $e (@$events) $]
159 [+ $aym->show_event($e->{'ID'}) +]<p>
161 [$ if $#{@$events} < 0 $]
162 [+ $db->loc('PLAYER_NO_EVENTS') +]<p>
165 <strong>[+ $db->loc('PLAYER_STATISTIC') +]</strong><p>
166 [+ $aym->show_statistic() +]
167 <p><a href="mapframe.epl">[+ $db->loc('PLAYER_TO_MAP') +]</a>
170 [- Execute('role_select.epl'); -]
173 [$ else $] [# wrong login #]
175 [- Execute("menu.epl"); -]
176 <p><p>[+ $db->loc('LOGIN_FAILED') +]<p>
177 [- print OUT $db->loc('ERROR_NO_LOGIN'); -]