2 <head><link rel="stylesheet" type="text/css" href="aymargeddon.css">
3 <title>Aymargeddon</title></head>
6 $udat{-current} = 'player.epl';
10 $db = DataBase->new();
15 $id = $db->authenticate($fdat{'login'},$fdat{'passwd'},
16 $fdat{'passwd2'},$fdat{'passwd3'});
19 $db->set_language($udat{-lang});
20 #set language in Database in PLAYER.LANGUAGE
21 $db->update_hash('PLAYER',"PLAYER=$id",{'LANGUAGE' => $udat{-lang}});
24 # set language according to PLAYER.LANGUAGE
25 # read_player() returns the first DB line in ARRAY format
26 ($udat{-lang}) = $db->read_player($id,'LANGUAGE');
31 # TODO: klappt nich weil $::conf nicht funktioniert im Embperl :-(
32 # $out = '<body style="font-size:10pt" bgcolor="'.$conf->{-COLOR}->{-EMPTY}.'">';
33 $out = '<body style="line-height:12pt;font-size:10pt">';
37 [$ if $id $] [# logged in - show game list, messages, etc. pp. #]
43 $udat{-game} = $fdat{'game'} if exists $fdat{'game'};
44 $aym = Aymargeddon->new($udat{-game},$id,$db) if exists $udat{-game};
46 if(exists $fdat{'game'}){
47 $udat{-loc} = $aym->startfield();
48 $udat{-loc} =~ /^(\d+)\_(\d+)$/;
49 my ($x,$y) = ($1, $2);
50 my $size = $aym->get_size();
51 $udat{-xoff} = $x -$size;
57 # register for selected role in game
58 if($fdat{'role'} and $fdat{'charname'}){
59 my $return = $aym->new_role($fdat{'role'},
62 # $fdat{'description'});
64 print OUT "<strong>Error: cant register role.</strong><p>";
68 # delete all messages if wanted.
69 # TODO: write timestamp in link and delete only to this time
70 if($fdat{delete_all_messages} == 1){
71 $aym->delete_all_messages($fdat{time});
77 $own_games = $db->games_of_player($id);
78 $open_games = $db->open_games("HOME=-1");
81 for my $og (@$own_games){
85 @real_open_games = ();
86 for $og (@$open_games){
87 push @real_open_games, $og unless exists $such{$og->[0]};
89 # Util::log("real open games: ". Dumper(\@real_open_games), 2);
90 ($rn) = $db->read_player($id, 'REALNAME') unless exists $udat{-game};
93 [$ if not exists $udat{-game} $]
95 [+ $db->loc('PLAYER_WELCOME').' Aymargeddon '.$rn +]!<p>
99 <table width=100% border=0><colgroup><col width="200"><col></colgroup>
100 <tr><td valign="top" bgcolor="#b8a266">
101 <p>[+ $db->loc('PLAYER_OWN_GAMES') +]<p>
102 [$ foreach $og (@$own_games) $]
103 [- $og = $og->[0]; ($og_name) = $db->read_game($og,'NAME'); -]
104 <a href="player.epl?game=[+$og+]">[+$og_name+]</a><p>
106 [$ if $#{@$own_games} < 0 $]
107 [+ $db->loc('PLAYER_GAMES_NONE') +]<p>
110 <p>[+ $db->loc('PLAYER_OPENGAMES') +]:<p>
111 [$ foreach $og (@real_open_games) $]
112 [- ($og_name) = $db->read_game($og,'NAME'); -]
113 <a href="player.epl?game=[+$og+]">[+$og_name+]</a><p>
115 [$ if $#{@real_open_games} < 0 $]
116 [+ $db->loc('PLAYER_GAMES_NONE') +]<p>
119 <td valign="top" bgcolor="#fcffd9">
120 [$ if not exists $udat{-game} $]
122 [+ $db->loc('PLAYER_CHOOSE_GAME') +]
124 [$ elsif exists $fdat{'cmd'} $]
125 [- Execute('command_frames.epl') -]
126 [$ elsif $such{$udat{-game}} $]
130 ($gn) = $db->read_game($udat{-game},'NAME');
131 my @list = $aym->charname($udat{-id});
134 [+ $db->loc('PLAYER_WELCOME') +] <strong>[+ $gn +]</strong>, [+ $cn +].<p>
139 $messages = $aym->read_messages();
142 <strong>[+ $db->loc('PLAYER_MESSAGES_HEADING') +]</strong><p>
143 <a href="player.epl?delete_all_messages=1&time=[+$now+]">
144 [+ $db->loc('PLAYER_DELETE_MESSAGES')+]</a><p>
145 [$ foreach $msg (@$messages) $]
146 [+ $aym->show_message($msg->[0]) +]<br>
148 [$ if $#{@$messages} < 0 $]
149 [+ $db->loc('PLAYER_NO_MESSAGE') +]
152 [# we dont show events in a global list any more
153 <strong>[+ $db->loc('PLAYER_EVENTS') +]</strong><p>
155 $events = $aym->role_events();
157 [$ foreach $e (@$events) $]
158 [+ $aym->show_event($e->{'ID'}) +]<p>
160 [$ if $#{@$events} < 0 $]
161 [+ $db->loc('PLAYER_NO_EVENTS') +]<p>
164 <strong>[+ $db->loc('PLAYER_STATISTIC') +]</strong><p>
165 [+ $aym->show_statistic() +]
166 <p><a href="mapframe.epl">[+ $db->loc('PLAYER_TO_MAP') +]</a>
169 [- Execute('role_select.epl'); -]
172 [$ else $] [# wrong login #]
174 [- Execute("menu.epl"); -]
175 <p><p>[+ $db->loc('LOGIN_FAILED') +]<p>
176 [- print OUT $db->loc('ERROR_NO_LOGIN'); -]