ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/pclient
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/pclient (file contents):
Revision 1.76 by root, Tue Apr 11 22:14:14 2006 UTC vs.
Revision 1.140 by root, Wed Apr 19 06:06:46 2006 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2 2
3use strict; 3use strict;
4use utf8; 4use utf8;
5 5
6use Glib; 6use Time::HiRes 'time';
7use Gtk2 -init; 7use Event;
8 8
9use SDL; 9use SDL;
10use SDL::App; 10use SDL::App;
11use SDL::Event; 11use SDL::Event;
12use SDL::Surface; 12use SDL::Surface;
13
14use SDL::Mixer;
15use SDL::Sound;
16use SDL::Music;
17
13use SDL::OpenGL; 18use SDL::OpenGL;
14use SDL::OpenGL::Constants;
15 19
16use Crossfire; 20use Crossfire;
17use Crossfire::Protocol; 21use Crossfire::Protocol;
18 22
23use Compress::LZF;
24
19use CFClient; 25use CFClient;
20use CFClient::UI; 26use CFClient::UI;
21 27
22our $VERSION = '0.1'; 28our $VERSION = '0.1';
23 29
24my $MAX_FPS = 60; 30my $MAX_FPS = 60;
25my $TICKS_PER_FRAME = int 1000 / $MAX_FPS - 1; # min ticks per frame 31my $MIN_FPS = 5; # unused as of yet
26 32
33our $META_SERVER = "crossfire.real-time.com:13326";
34
35our $FACEMAP;
36our $TILECACHE;
27our $FACECACHE; 37our $MAPCACHE;
38
39our $LAST_REFRESH;
40our $NOW;
28 41
29our $CFG; 42our $CFG;
30our $CONN; 43our $CONN;
44our $FAST; # fast, low-quality mode, possibly useful for software-rendering
31 45
32our @SDL_MODES; 46our @SDL_MODES;
33our $WIDTH; 47our $WIDTH;
34our $HEIGHT; 48our $HEIGHT;
35our $FULLSCREEN; 49our $FULLSCREEN;
50our $FONTSIZE;
36 51
37our $NOW; 52our $MAP;
38
39our $MAPWIDGET; 53our $MAPWIDGET;
40our $FONTSIZE; 54our $BUTTONBAR;
55our $LOGVIEW;
56our $CONSOLE;
57our $METASERVER;
41 58
59our $GAUGES;
60
42our $SDL_TIMER; 61our $SDL_ACTIVE;
43our $SDL_APP;
44our $SDL_EV; 62our $SDL_EV;
45our %SDL_CB; 63our %SDL_CB;
64
65our $SDL_MIXER;
66our @SOUNDS; # event => file mapping
67our %AUDIO_CHUNKS; # audio files
46 68
47our $ALT_ENTER_MESSAGE; 69our $ALT_ENTER_MESSAGE;
48our $STATUS_LINE; 70our $STATUS_LINE;
49our $DEBUG_STATUS; 71our $DEBUG_STATUS;
50 72
51my $last_refresh; 73sub status {
52my %ANIMATE; 74 $STATUS_LINE->set_text ($_[0]);
53my $refresh_handler; 75 $STATUS_LINE->move (0, $HEIGHT - $ALT_ENTER_MESSAGE->{h} - $STATUS_LINE->{h});
76}
54 77
55our ($tw, $te); # Test widget #d# 78sub debug {
79 $DEBUG_STATUS->set_text ($_[0]);
80 $DEBUG_STATUS->move ($WIDTH - $DEBUG_STATUS->{w}, 0, $DEBUG_STATUS->{w}, $DEBUG_STATUS->{h});
81}
56 82
57sub init_screen { 83sub start_game {
58 $SDL_APP = new SDL::App 84 status "logging in...";
59 -flags => SDL_ANYFORMAT | SDL_HWSURFACE,
60 -title => "Crossfire+ Client",
61 -width => $WIDTH,
62 -height => $HEIGHT,
63 -opengl => 1,
64 -red_size => 5,
65 -green_size => 5,
66 -blue_size => 5,
67 -alpha_size => 0,
68 -double_buffer => 1,
69 -fullscreen => $FULLSCREEN,
70 -resizeable => 0;
71 85
72 $SDL_EV = new SDL::Event; 86 my $mapsize = List::Util::min 32, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32;
73 $SDL_EV->set_unicode (1);
74 87
75 $SDL_TIMER = add Glib::Timeout 1000 / $MAX_FPS, sub { 88 $MAPCACHE = CFClient::db_table "mapcache_$CFG->{host}";
76 ($SDL_CB{$SDL_EV->type} || sub { warn "unhandled event ", $SDL_EV->type })->()
77 while $SDL_EV->poll;
78 89
79 1 90 $MAP = new CFClient::Map $mapsize, $mapsize;
80 };
81 91
82 $last_refresh = SDL::GetTicks; 92 my ($host, $port) = split /:/, $CFG->{host};
83
84 CFClient::gl_init;
85
86 $FONTSIZE = int $HEIGHT / 50;
87
88 #############################################################################
89
90 glClearColor 0.45, 0.45, 0.45, 1;
91
92 glEnable GL_TEXTURE_2D;
93 glEnable GL_COLOR_MATERIAL;
94 glShadeModel GL_FLAT;
95 glDisable GL_DEPTH_TEST;
96 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
97
98 #############################################################################
99
100 $DEBUG_STATUS = new CFClient::UI::Label;
101 $CFClient::UI::TOPLEVEL->add ($DEBUG_STATUS);
102 93
103 $STATUS_LINE = new CFClient::UI::Label
104 y => $HEIGHT * 59 / 60 - $FONTSIZE;
105 $CFClient::UI::TOPLEVEL->add ($STATUS_LINE);
106
107 $ALT_ENTER_MESSAGE = new CFClient::UI::Label
108 y => $HEIGHT * 59 / 60,
109 height => $HEIGHT / 60,
110 text => "Use <b>Alt-Enter</b> to toggle fullscreen mode";
111 $CFClient::UI::TOPLEVEL->add ($ALT_ENTER_MESSAGE);
112
113 $MAPWIDGET = new CFClient::UI::MapWidget;
114 $CFClient::UI::TOPLEVEL->add ($MAPWIDGET);
115 $MAPWIDGET->focus_in;
116}
117
118sub destroy_screen {
119 remove Glib::Source $SDL_TIMER;
120 undef $SDL_APP;
121 undef $SDL_EV;
122 SDL::Quit;
123}
124
125sub config_dialog {
126 my $dialog = new CFClient::UI::FancyFrame x => 300, y => 100,
127 child => (my $vbox = new CFClient::UI::VBox);
128 $vbox->add (new CFClient::UI::Label align => 0, text => "Setup");
129 $vbox->add (my $table = new CFClient::UI::Table expand => 1);
130
131 $table->add (0, 0, new CFClient::UI::Label align => 1, text => "Video Mode");
132 $table->add (1, 0, my $hbox = new CFClient::UI::HBox);
133
134 $hbox->add (my $mode_slider = new CFClient::UI::Slider req_w => 100, range => [$CFG->{sdl_mode}, 0, scalar @SDL_MODES, 1]);
135 $hbox->add (my $mode_label = new CFClient::UI::Label);
136
137 $mode_slider->connect (changed => sub {
138 my (undef, $value) = @_;
139
140 $CFG->{sdl_mode} = $value = int $value + 0.5;
141 $mode_label->set_text (sprintf "%dx%d", @{$SDL_MODES[$value]});
142 });
143 $mode_slider->emit (changed => $mode_slider->{range}[0]);
144
145 $table->add (0, 1, new CFClient::UI::Label align => 1, text => "Host");
146 $table->add (1, 1, my $host = new CFClient::UI::Entry text => $CFG->{host});
147
148 $table->add (0, 2, new CFClient::UI::Label align => 1, text => "Port");
149 $table->add (1, 2, my $port = new CFClient::UI::Entry text => $CFG->{port});
150
151 $table->add (0, 3, new CFClient::UI::Label align => 1, text => "Username");
152 $table->add (1, 3, my $user = new CFClient::UI::Entry text => $CFG->{user});
153
154 $table->add (0, 4, new CFClient::UI::Label align => 1, text => "Password");
155 $table->add (1, 4, my $pass = new CFClient::UI::Entry text => $CFG->{password}, hidden => 1);
156
157 $table->add (0, 5, new CFClient::UI::Label align => 1, text => "Map Size");
158 $table->add (1, 5, my $mapsize_slider = new CFClient::UI::Slider req_w => 100, range => [$CFG->{mapsize}, 10, 100 + 1, 1]);
159
160 $CFClient::UI::TOPLEVEL->add ($dialog);
161}
162
163sub start_game {
164 $WIDTH = $CFG->{width};
165 $HEIGHT = $CFG->{height};
166 $FULLSCREEN = 0;
167
168 init_screen;
169
170 config_dialog;
171
172 my $mapsize = List::Util::min 64, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32;
173
174 $CONN = new conn 94 $CONN = new conn
175 host => $CFG->{host}, 95 host => $host,
176 port => $CFG->{port}, 96 port => $port || 13327,
177 user => $CFG->{user}, 97 user => $CFG->{user},
178 pass => $CFG->{password}, 98 pass => $CFG->{password},
179 mapw => $mapsize, 99 mapw => $mapsize,
180 maph => $mapsize, 100 maph => $mapsize,
181 ; 101 ;
182 102
103 status "login successful";
104
183 CFClient::lowdelay fileno $CONN->{fh}; 105 CFClient::lowdelay fileno $CONN->{fh};
184} 106}
185 107
186sub stop_game { 108sub stop_game {
187 remove Glib::Source $refresh_handler if $refresh_handler;
188 undef $refresh_handler;
189
190 undef $CONN; 109 undef $CONN;
191 destroy_screen;
192} 110}
193 111
194sub force_refresh { 112sub client_setup {
195 glViewport 0, 0, $WIDTH, $HEIGHT; 113 my $dialog = new CFClient::UI::FancyFrame
114 child => (my $vbox = new CFClient::UI::VBox);
115 $vbox->add (new CFClient::UI::Label valign => 0, align => 0, text => "Client Setup");
116 $vbox->add (my $table = new CFClient::UI::Table expand => 1, col_expand => [0, 1]);
196 117
197 glMatrixMode GL_PROJECTION; 118 $table->add (0, 0, new CFClient::UI::Label valign => 0, align => 1, text => "Video Mode");
198 glLoadIdentity; 119 $table->add (1, 0, my $hbox = new CFClient::UI::HBox);
199 glOrtho 0, $WIDTH, $HEIGHT, 0, -10000 , 10000;
200 glMatrixMode GL_MODELVIEW;
201 glLoadIdentity;
202 120
203 glClear GL_COLOR_BUFFER_BIT; 121 $hbox->add (my $mode_slider = new CFClient::UI::Slider expand => 1, req_w => 100, range => [$CFG->{sdl_mode}, 0, scalar @SDL_MODES, 1]);
122 $hbox->add (my $mode_label = new CFClient::UI::Label valign => 0, height => 0.8);
204 123
205 $CFClient::UI::TOPLEVEL->draw; 124 $mode_slider->connect (changed => sub {
125 my ($self, $value) = @_;
206 126
207 SDL::GLSwapBuffers; 127 $CFG->{sdl_mode} = $self->{range}[0] = $value = int $value;
208} 128 $mode_label->set_text (sprintf "%dx%d", @{$SDL_MODES[$value]});
129 });
130 $mode_slider->emit (changed => $mode_slider->{range}[0]);
209 131
210sub debug { 132 $table->add (0, 1, new CFClient::UI::Label valign => 0, align => 1, text => "Fullscreen");
211 $DEBUG_STATUS->set_text ($_[0]); 133 $table->add (1, 1, new CFClient::UI::CheckBox state => $CFG->{fullscreen}, connect_changed => sub {
212 my ($w, $h) = $DEBUG_STATUS->size_request; 134 my ($self, $value) = @_;
213 $DEBUG_STATUS->size_allocate ($WIDTH - $w, 0, $w, $h); 135 $CFG->{fullscreen} = $value;
214} 136 });
215 137
216my $FPS; 138 $table->add (0, 2, new CFClient::UI::Label valign => 0, align => 1, text => "Fast & Ugly");
139 $table->add (1, 2, new CFClient::UI::CheckBox state => $CFG->{fast}, connect_changed => sub {
140 my ($self, $value) = @_;
141 $CFG->{fast} = $value;
142 });
217 143
218sub refresh { 144 $table->add (0, 3, new CFClient::UI::Label valign => 0, align => 1, text => "Fog of War");
219 $refresh_handler ||= add Glib::Idle sub { 145 $table->add (1, 3, new CFClient::UI::CheckBox state => $CFG->{fow_enable}, connect_changed => sub {
220 if ($SDL_APP) { 146 my ($self, $value) = @_;
221 $NOW = SDL::GetTicks; 147 $CFG->{fow_enable} = $value;
148 });
222 149
223 if ($NOW - $last_refresh < $TICKS_PER_FRAME) { 150 $table->add (0, 4, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Intensity");
224 SDL::Delay $TICKS_PER_FRAME - ($NOW - $last_refresh); 151 $table->add (1, 4, new CFClient::UI::Slider range => [$CFG->{fow_intensity}, 0, 1 + 0.001, 0.001], connect_changed => sub {
225 $NOW = SDL::GetTicks; 152 my ($self, $value) = @_;
153 $CFG->{fow_intensity} = $value;
154 });
155
156 $table->add (0, 5, new CFClient::UI::Label valign => 0, align => 1, text => "FoW Smooth");
157 $table->add (1, 5, new CFClient::UI::CheckBox state => $CFG->{fow_smooth}, connect_changed => sub {
158 my ($self, $value) = @_;
159 $CFG->{fow_smooth} = $value;
160 status "Fog of War smoothing requires OpenGL 1.2 or higher" if $CFClient::GL_VERSION < 1.2;
161 });
162
163 $table->add (0, 6, new CFClient::UI::Label valign => 0, align => 1, text => "Log Fontsize");
164 $table->add (1, 6, new CFClient::UI::Slider range => [$CFG->{gui_fontsize}, 0.5, 1.5, 0.1], connect_changed => sub {
165 $CFG->{gui_fontsize} = 0.1 * int $_[0] * 10;
166# $FONTSIZE = int $HEIGHT / 40 * $CFG->{gui_fontsize};
167 });
168
169 $table->add (0, 7, new CFClient::UI::Label valign => 0, align => 1, text => "Log Fontsize");
170 $table->add (1, 7, new CFClient::UI::Slider range => [$CFG->{log_fontsize}, 0.7, 1.5, 0.1], connect_changed => sub {
171 $LOGVIEW->set_fontsize ($CFG->{log_fontsize} = 0.1 * int $_[0] * 10);
172 });
173
174 $table->add (1, 8, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub {
175 video_shutdown ();
176 video_init ();
177 });
178
179 $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Audio Enable");
180 $table->add (1, 9, new CFClient::UI::CheckBox state => $CFG->{audio_enable}, connect_changed => sub {
181 $CFG->{audio_enable} = $_[1];
182 });
183# $table->add (0, 9, new CFClient::UI::Label valign => 0, align => 1, text => "Effects Volume");
184# $table->add (1, 8, new CFClient::UI::Slider range => [$CFG->{effects_volume}, 0, 128, 1], connect_changed => sub {
185# $CFG->{effects_volume} = $_[1];
186# });
187 $table->add (0, 10, new CFClient::UI::Label valign => 0, align => 1, text => "Bg. Music");
188 $table->add (1, 10, my $hbox = new CFClient::UI::HBox);
189 $hbox->add (new CFClient::UI::CheckBox expand => 1, state => $CFG->{bgm_enable}, connect_changed => sub {
190 $CFG->{bgm_enable} = $_[1];
191 });
192 $hbox->add (new CFClient::UI::Slider expand => 1, range => [$CFG->{bgm_volume}, 0, 128, 1], connect_changed => sub {
193 $CFG->{bgm_volume} = $_[1];
194 $SDL_MIXER->music_volume ($_[1]);
195 });
196
197 $table->add (1, 11, new CFClient::UI::Button expand => 1, align => 0, text => "Apply", connect_activate => sub {
198 audio_shutdown ();
199 audio_init ();
200 });
201
202 $dialog
203}
204
205sub metaserver_dialog {
206 my $dialog = new CFClient::UI::FancyFrame
207 child => (my $vbox = new CFClient::UI::VBox);
208
209 $vbox->add ($dialog->{table} = new CFClient::UI::Table);
210
211 $dialog
212}
213
214sub update_metaserver {
215 my ($HOST) = @_;
216
217 status "fetching metaserver list...";
218
219 my $buf;
220
221 my $fh = new IO::Socket::INET PeerHost => $META_SERVER, Blocking => 0;
222
223 Event->io (fd => $fh, poll => 'r', cb => sub {
224 my $res = sysread $fh, $buf, 8192, length $buf;
225
226 if (!defined $res) {
227 $_[0]->w->cancel;
228 status "metaserver: $!";
229 } elsif ($res == 0) {
230 $_[0]->w->cancel;
231 status "server list retrieved";
232
233 my $table = $METASERVER->{table};
234
235 $table->clear;
236
237 my @col = qw(Use #Users Host Uptime Version Description);
238 $table->add ($_, 0, new CFClient::UI::Label align => 0, fg => [1, 1, 0], text => $col[$_])
239 for 0 .. $#col;
240
241 my @align = qw(1 0 1 1 -1);
242
243 my $y = 0;
244 for my $m (sort { $b->[3] <=> $a->[3] } map [split /\|/], split /\015?\012/, $buf) {
245 my ($ip, $last, $host, $users, $version, $desc, $ibytes, $obytes, $uptime) = @$m;
246
247 for ($desc) {
248 s/<br>/\n/gi;
249 s/<li>/\n· /gi;
250 s/<.*?>//sgi;
251 s/&/&amp;/g;
252 s/</&lt;/g;
253 s/>/&gt;/g;
254 }
255
256 $uptime = sprintf "%dd %02d:%02d:%02d",
257 (int $m->[8] / 86400),
258 (int $m->[8] / 3600) % 24,
259 (int $m->[8] / 60) % 60,
260 $m->[8] % 60;
261
262 $m = [$users, $host, $uptime, $version, $desc];
263
264 $y++;
265
266 $table->add (0, $y, new CFClient::UI::VBox children => [
267 (new CFClient::UI::Button text => " ", connect_activate => sub {
268 $HOST->set_text ($CFG->{host} = $host);
269 }),
270 (new CFClient::UI::Empty expand => 1),
271 ]);
272
273 $table->add ($_ + 1, $y, new CFClient::UI::Label align => $align[$_], text => $m->[$_], fontsize => 0.8)
274 for 0 .. $#$m;
226 } 275 }
227 276 }
228 my $interval = ($NOW - $last_refresh) * 0.001; 277 });
229 $last_refresh = $NOW; 278}
230 279
231 if ($interval) { 280sub server_setup {
232 $FPS ||= 1 / $interval; 281 my $dialog = new CFClient::UI::FancyFrame
233 $FPS = $FPS * 0.96 + (1 / $interval) * 0.04; 282 child => (my $vbox = new CFClient::UI::VBox);
234 debug sprintf "%5.02f", $FPS; 283
284 $vbox->add (new CFClient::UI::Label align => 0, text => "Server Setup");
285 $vbox->add (my $table = new CFClient::UI::Table expand => 1, col_expand => [0, 1]);
286 $table->add (0, 2, new CFClient::UI::Label align => 1, text => "Host:Port");
287
288 {
289 $table->add (1, 2, my $vbox = new CFClient::UI::VBox);
290
291 $vbox->add (my $HOST = new CFClient::UI::Entry text => $CFG->{host}, connect_changed => sub {
292 my ($self, $value) = @_;
293 $CFG->{host} = $value;
294 });
295
296 $METASERVER = metaserver_dialog;
297
298 $vbox->add (new CFClient::UI::Flopper text => "Metaserver", other => $METASERVER, connect_open => sub {
299 update_metaserver $HOST;
300 });
301 }
302
303 $table->add (0, 4, new CFClient::UI::Label align => 1, text => "Username");
304 $table->add (1, 4, new CFClient::UI::Entry text => $CFG->{user}, connect_changed => sub {
305 my ($self, $value) = @_;
306 $CFG->{user} = $value;
307 });
308
309 $table->add (0, 5, new CFClient::UI::Label align => 1, text => "Password");
310 $table->add (1, 5, new CFClient::UI::Entry text => $CFG->{password}, hidden => 1, connect_changed => sub {
311 my ($self, $value) = @_;
312 $CFG->{password} = $value;
313 });
314
315 $table->add (0, 6, new CFClient::UI::Label align => 1, text => "Def. say cmd");
316 $table->add (1, 6, my $saycmd = new CFClient::UI::Entry text => $CFG->{say_command}, connect_changed => sub {
317 my ($self, $value) = @_;
318 $CFG->{say_command} = $value;
319 });
320
321 $table->add (0, 7, new CFClient::UI::Label align => 1, text => "Map Size");
322 $table->add (1, 7, new CFClient::UI::Slider
323 req_w => 100,
324 range => [$CFG->{mapsize}, 10, 100 + 1, 1],
325 connect_changed => sub {
326 my ($self, $value) = @_;
327
328 $CFG->{mapsize} = $self->{range}[0] = $value = int $value;
329 },
330 );
331
332 $table->add (1, 8, new CFClient::UI::Button expand => 1, align => 0, text => "Login", connect_activate => sub {
333 start_game;
334 });
335
336 $dialog
337}
338
339sub message_window {
340 my $window = new CFClient::UI::FancyFrame
341 border_bg => [1, 1, 1, 0.5],
342 bg => [0.3, 0.3, 0.3, 0.8],
343 user_w => int $::WIDTH / 3,
344 user_h => int $::HEIGHT / 5,
345 child => (my $vbox = new CFClient::UI::VBox);
346
347 $vbox->add ($LOGVIEW = new CFClient::UI::TextView
348 expand => 1,
349 fontsize => $::CFG->{log_fontsize},
350 );
351
352 $vbox->add (my $input = new CFClient::UI::Entry
353 connect_focus_in => sub {
354 my ($input, $prev_focus) = @_;
355
356 delete $input->{refocus_map};
357
358 if ($prev_focus == $MAPWIDGET && $input->{auto_activated}) {
359 $input->{refocus_map} = 1;
235 } 360 }
361 delete $input->{auto_activated};
362 },
363 connect_activate => sub {
364 my ($input, $text) = @_;
365 $input->set_text ('');
236 366
237 force_refresh; 367 if ($text =~ /^\/(.*)/) {
238 $_->animate ($interval) for grep $_, values %ANIMATE; 368 $::CONN->user_send ($1);
239
240 if (%ANIMATE) {
241 1
242 } else { 369 } else {
243 undef $refresh_handler; 370 my $say_cmd = $::CFG->{say_command} || 'say';
371 $::CONN->user_send ("$say_cmd $text");
372 }
373 if ($input->{refocus_map}) {
374 delete $input->{refocus_map};
375 $MAPWIDGET->focus_in
376 }
377 },
378 connect_escape => sub {
379 $MAPWIDGET->focus_in
380 },
381 );
382
383 $CONSOLE = {
384 window => $window,
385 input => $input
386 };
387
388 $window
389}
390
391sub sdl_init {
392 #SDL::Init SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE
393 SDL::Init SDL_INIT_AUDIO | SDL_INIT_VIDEO
394 and die "SDL::Init failed!\n";
395}
396
397sub video_init {
398 sdl_init;
399
400 ($WIDTH, $HEIGHT) = @{ $SDL_MODES[$CFG->{sdl_mode}] };
401 $FULLSCREEN = $CFG->{fullscreen};
402 $FAST = $CFG->{fast};
403
404 SDL::GLSetAttribute SDL_GL_RED_SIZE, 5;
405 SDL::GLSetAttribute SDL_GL_GREEN_SIZE, 5;
406 SDL::GLSetAttribute SDL_GL_BLUE_SIZE, 5;
407 SDL::GLSetAttribute SDL_GL_ALPHA_SIZE, 1;
408
409 SDL::GLSetAttribute SDL_GL_ACCUM_RED_SIZE, 0;
410 SDL::GLSetAttribute SDL_GL_ACCUM_GREEN_SIZE, 0;
411 SDL::GLSetAttribute SDL_GL_ACCUM_BLUE_SIZE, 0;
412 SDL::GLSetAttribute SDL_GL_ACCUM_ALPHA_SIZE, 0;
413
414 SDL::GLSetAttribute SDL_GL_DOUBLEBUFFER, 1;
415 SDL::GLSetAttribute SDL_GL_BUFFER_SIZE, 15;
416 SDL::GLSetAttribute SDL_GL_DEPTH_SIZE, 0;
417
418 SDL::SetVideoMode $WIDTH, $HEIGHT, 0,
419 SDL_HWSURFACE | SDL_ANYFORMAT | SDL_OPENGL | SDL_DOUBLEBUF
420 | ($FULLSCREEN ? SDL_FULLSCREEN : 0)
421 or die "SDL::SetVideoMode failed!\n";
422
423 SDL::WMSetCaption "Crossfire+ Client", "Crossfire+";
424
425 $SDL_EV = new SDL::Event;
426 $SDL_EV->set_unicode (1);
427
428 $SDL_ACTIVE = 1;
429
430 $LAST_REFRESH = time - 0.01;
431
432 CFClient::gl_init;
433
434 $FONTSIZE = int $HEIGHT / 40 * $CFG->{gui_fontsize};
435
436 #############################################################################
437
438 $DEBUG_STATUS = new CFClient::UI::Label padding => 0, z => 100;
439 $DEBUG_STATUS->show;
440
441 $STATUS_LINE = new CFClient::UI::Label
442 padding => 0,
443 y => $HEIGHT - $FONTSIZE * 1.8;
444 $STATUS_LINE->show;
445
446 $ALT_ENTER_MESSAGE = new CFClient::UI::Label
447 padding => 0,
448 fontsize => 0.8,
449 markup => "Use <b>Alt-Enter</b> to toggle fullscreen mode";
450 $ALT_ENTER_MESSAGE->show;
451 $ALT_ENTER_MESSAGE->move (0, $HEIGHT - $ALT_ENTER_MESSAGE->{h});
452
453 $CFClient::UI::ROOT->add ($MAPWIDGET = new CFClient::UI::MapWidget);
454 $MAPWIDGET->focus_in;
455 $MAPWIDGET->connect (activate_console => sub {
456 my ($mapwidget, $preset) = @_;
457
458 if ($CONSOLE) {
459 $CONSOLE->{input}->{auto_activated} = 1;
460 $CONSOLE->{input}->focus_in;
461
462 if ($preset && $CONSOLE->{input}->get_text eq '') {
463 $CONSOLE->{input}->set_text ($preset);
464 }
465 }
466 });
467
468 $CFClient::UI::ROOT->add ($BUTTONBAR = new CFClient::UI::HBox);
469
470 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Client Setup", other => client_setup);
471 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Server Setup", other => server_setup);
472 $BUTTONBAR->add (new CFClient::UI::Flopper text => "Message Window", other => message_window);
473
474 $BUTTONBAR->add (new CFClient::UI::Button text => "Save Config", connect_activate => sub {
475 CFClient::write_cfg "$Crossfire::VARDIR/pclientrc";
476 status "Configuration Saved";
477 });
478
479 $BUTTONBAR->{children}[1]->emit ("activate"); # pop up server setup
480
481 my $tgw = new CFClient::UI::FancyFrame (x => $WIDTH - 300, y => 0);
482 $tgw->add (my $hbox = new CFClient::UI::HBox ());
483
484 $hbox->add (my $hg = new CFClient::UI::VGauge (gauge => 'hp'));
485 $hbox->add (my $mg = new CFClient::UI::VGauge (gauge => 'mana'));
486 $hbox->add (my $gg = new CFClient::UI::VGauge (gauge => 'grace'));
487 $hbox->add (my $fg = new CFClient::UI::VGauge (gauge => 'food'));
488
489 $GAUGES = { food => $fg, mana => $mg, hp => $hg, grace => $gg };
490 $CFClient::UI::ROOT->add ($tgw);
491}
492
493sub video_shutdown {
494 $CFClient::UI::ROOT->{children} = [];
495 undef $SDL_ACTIVE;
496 undef $SDL_EV;
497}
498
499my $bgmusic;#TODO#hack#d#
500
501sub audio_init {
502 if ($CFG->{audio_enable}) {
503 if (open my $fh, "<:utf8", CFClient::find_rcfile "sounds/config") {
504 $SDL_MIXER = new SDL::Mixer;
505 $SDL_MIXER->allocate_channels (8);
506
507 # TODO: hack, do play loop and mood music
508 if ($CFG->{bgm_enable}) {
509 $bgmusic = new SDL::Music CFClient::find_rcfile "music/game3.ogg";
510 $SDL_MIXER->play_music ($bgmusic, -1);
511 $SDL_MIXER->music_volume ($CFG->{bgm_volume});
512 }
513
514 while (<$fh>) {
515 next if /^\s*#/;
516 next if /^\s*$/;
517
518 my ($file, $volume, $event) = split /\s+/, $_, 3;
519
520 push @SOUNDS, "$volume,$file";
521
522 $AUDIO_CHUNKS{"$volume,$file"} ||= do {
523 my $chunk = new SDL::Sound CFClient::find_rcfile "sounds/$file";
524 $chunk->volume ($volume * 128 / 100);
525 $chunk
244 0 526 };
245 } 527 }
246 } else { 528 } else {
247 undef $refresh_handler; 529 status "unable to open sound config: $!";
248 0
249 } 530 }
250 }; 531 }
532}
533
534sub audio_shutdown {
535 undef $SDL_MIXER;
536 @SOUNDS = ();
537 %AUDIO_CHUNKS = ();
538}
539
540my %animate_object;
541my $animate_timer;
542
543my $want_refresh;
544my $can_refresh;
545
546my $fps = 9;
547
548sub force_refresh {
549 $fps = $fps * 0.95 + 1 / ($NOW - $LAST_REFRESH) * 0.05;
550 debug sprintf "%3.2f", $fps;
551
552 $want_refresh = 0;
553 $can_refresh = 0;
554
555 $CFClient::UI::ROOT->draw;
556
557 SDL::GLSwapBuffers;
558
559 $LAST_REFRESH = $NOW;
560}
561
562my $refresh_watcher = Event->timer (after => 0, hard => 1, interval => 1 / $MAX_FPS, cb => sub {
563 $NOW = time;
564
565 ($SDL_CB{$SDL_EV->type} || sub { warn "unhandled event ", $SDL_EV->type })->()
566 while $SDL_EV->poll;
567
568 if (%animate_object) {
569 $_->animate ($LAST_REFRESH - $NOW) for values %animate_object;
570 $want_refresh++;
571 }
572
573 if ($want_refresh) {
574 force_refresh;
575 } else {
576 $can_refresh = 1;
577 }
578});
579
580sub refresh {
581 $want_refresh++;
251} 582}
252 583
253sub animation_start { 584sub animation_start {
254 my ($widget) = @_; 585 my ($widget) = @_;
255 $ANIMATE{$widget} = $widget; 586 $animate_object{$widget} = $widget;
256 Scalar::Util::weaken $ANIMATE{$widget};
257
258 refresh;
259} 587}
260 588
261sub animation_stop { 589sub animation_stop {
262 my ($widget) = @_; 590 my ($widget) = @_;
263 delete $ANIMATE{$widget}; 591 delete $animate_object{$widget};
592}
593
594@conn::ISA = Crossfire::Protocol::;
595
596sub conn::stats_update {
597 my ($self, $stats) = @_;
598
599 # i love text protocols!!!
600 # FIXME: the stats are somehow weird
601 my $hp = $stats->{1};
602 my $hp_m = $stats->{2};
603 my $sp = $stats->{3};
604 my $sp_m = $stats->{4};
605 my $fo = $stats->{18};
606 my $fo_m = 1000;
607 my $gr = $stats->{23};
608 my $gr_m = $stats->{24};
609
610 #d# warn "DATA $hp $hp_m $sp $sp_m $fo $fo_m $gr $gr_m\n";
611 $GAUGES->{hp}->set_value ($hp, $hp_m);
612 $GAUGES->{mana}->set_value ($sp, $sp_m);
613 $GAUGES->{food}->set_value ($fo, $fo_m);
614 $GAUGES->{grace}->set_value ($gr, $gr_m);
615}
616
617sub conn::user_send {
618 my ($self, $command) = @_;
619
620 $self->send_command ($command);
621 status $command;
622}
623
624sub conn::map_scroll {
625 my ($self, $dx, $dy) = @_;
626
627 $MAP->scroll ($dx, $dy);
628}
629
630sub conn::feed_map1a {
631 my ($self, $data) = @_;
632
633# $self->Crossfire::Protocol::feed_map1a ($data);
634
635 $MAP->map1a_update ($data);
636 $MAPWIDGET->update;
637}
638
639sub conn::flush_map {
640 my ($self) = @_;
641
642 my $map_info = delete $self->{map_info}
643 or return;
644
645 my ($hash, $x, $y, $w, $h) = @$map_info;
646
647 my $data = $MAP->get_rect ($x, $y, $w, $h);
648 $MAPCACHE->put ($hash => Compress::LZF::compress $data);
649
650 warn sprintf "SAVEmap[%s] length %d\n", $hash, length $data;#d#
651
652}
653
654sub conn::map_clear {
655 my ($self) = @_;
656
657 $self->flush_map;
658 delete $self->{neigh};
659
660 $MAP->clear;
661}
662
663
664sub conn::load_map($$$) {
665 my ($self, $hash, $x, $y) = @_;
666
667 if (defined (my $data = $MAPCACHE->get ($hash))) {
668 $data = Compress::LZF::decompress $data;
669 warn sprintf "LOADmap[%s,%d,%d] length %d\n", $hash, $x, $y, length $data;#d#
670 for my $id ($MAP->set_rect ($x, $y, $data)) {
671 my $data = $TILECACHE->get ($id)
672 or next;
673
674 $self->set_texture ($id => $data);
675 }
676 }
677}
678
679sub conn::flood_fill {
680 my ($self, $path, $hash, $flags, $x0, $y0, $x1, $y1) = @_;
681
682 # the server does not allow map paths > 6
683 return if 6 <= length $path;
684
685 for my $tile (1..4) {
686 next if $self->{neigh}{$hash}[$tile];
687 next unless $flags & (1 << ($tile - 1));
688
689 my $neigh = $self->{neigh}{$hash} ||= [];
690
691 $self->send_mapinfo ("spatial $path$tile", sub {
692 my ($mode, $flags, $x, $y, $w, $h, $hash) = @_;
693
694 #warn "map<$path>_$tile=<$mode,$x,$y,$w,$h,$hash>\n";#d#
695 return if $mode ne "spatial";
696
697 $x += $MAP->ox;
698 $y += $MAP->oy;
699
700 $self->load_map ($hash, $x, $y)
701 unless $self->{neigh}{$hash}[5]++;#d#
702
703 $neigh->[$tile] = [$x, $y, $w, $h];
704
705 $self->flood_fill ("$path$tile", $hash, $flags, $x0, $y0, $x1, $y1)
706 if $x >= $x0 && $x + $w < $x1 && $y >= $y0 && $y + $h < $y1;
707 });
708 }
709}
710
711sub conn::map_change {
712 my ($self, $mode, $flags, $x, $y, $w, $h, $hash) = @_;
713
714 $self->flush_map;
715
716 my ($ox, $oy) = ($::MAP->ox, $::MAP->oy);
717
718 my $mapmapw = 250;
719 my $mapmaph = 250;
720
721 $self->flood_fill ("", $hash, $flags,
722 $ox - $mapmapw * 0.5, $oy - $mapmapw * 0.5,
723 $ox + $mapmapw * 0.5, $oy + $mapmapw * 0.5);
724
725 $x += $ox;
726 $y += $oy;
727
728 $self->{map_info} = [$hash, $x, $y, $w, $h];
729
730 $self->load_map ($hash, $x, $y);
731}
732
733sub conn::face_find {
734 my ($self, $facenum, $face) = @_;
735
736 my $hash = "$face->{chksum},$face->{name}";
737
738 my $id = $FACEMAP->get ($hash);
739
740 unless ($id) {
741 # create new id for face
742 # i love transactions
743 for (1..100) {
744 my $txn = $CFClient::DB_ENV->txn_begin;
745 my $status = $FACEMAP->db_get (id => $id, BerkeleyDB::DB_RMW);
746 if ($status == 0 || $status == BerkeleyDB::DB_NOTFOUND) {
747 $id++;
748 if ($FACEMAP->put (id => $id) == 0
749 && $FACEMAP->put ($hash => $id) == 0) {
750 $txn->txn_commit;
751
752 goto gotid;
753 }
754 }
755 $txn->abort;
756 }
757
758 CFClient::fatal "maximum number of transaction retries reached - database problems?";
759 }
760
761gotid:
762 $face->{id} = $id;
763 $MAP->set_face ($facenum => $id);
764 $TILECACHE->get ($id)
765}
766
767sub conn::face_update {
768 my ($self, $facenum, $face) = @_;
769
770 $TILECACHE->put ($face->{id} => $face->{image}); #TODO: try to avoid duplicate writes
771
772 $self->set_texture ($face->{id} => delete $face->{image});
773}
774
775sub conn::set_texture {
776 my ($self, $id, $data) = @_;
777
778 $self->{texture}[$id] ||= do {
779 my $tex =
780 new_from_image CFClient::Texture
781 $data, minify => 1;
782
783 $MAP->set_texture ($id, @$tex{qw(name w h s t)}, @{$tex->{minified}});
784 $MAPWIDGET->update;
785
786 $tex
787 };
788}
789
790sub conn::sound_play {
791 my ($self, $x, $y, $soundnum, $type) = @_;
792
793 $SDL_MIXER
794 or return;
795
796 my $chunk = $AUDIO_CHUNKS{$SOUNDS[$soundnum]}
797 or return;
798
799 $SDL_MIXER->play_channel (-1, $chunk);
800 warn "sound $x,$y,$soundnum,$type\n";#d#
801}
802
803sub conn::query {
804 my ($self, $flags, $prompt) = @_;
805
806 #TODO
807 warn "<<<<QUERY:$flags:$prompt>>>\n";#d#
808}
809
810sub conn::drawinfo {
811 my ($self, $color, $text) = @_;
812
813 my @color = (
814 [1.00, 1.00, 1.00], #[0.00, 0.00, 0.00],
815 [1.00, 1.00, 1.00],
816 [0.50, 0.50, 1.00], #[0.00, 0.00, 0.55]
817 [1.00, 0.00, 0.00],
818 [1.00, 0.54, 0.00],
819 [0.11, 0.56, 1.00],
820 [0.93, 0.46, 0.00],
821 [0.18, 0.54, 0.34],
822 [0.56, 0.73, 0.56],
823 [0.80, 0.80, 0.80],
824 [0.55, 0.41, 0.13],
825 [0.99, 0.77, 0.26],
826 [0.74, 0.65, 0.41],
827 );
828
829 $LOGVIEW->add_paragraph ($color[$color], $text);
264} 830}
265 831
266%SDL_CB = ( 832%SDL_CB = (
267 SDL_QUIT() => sub { 833 SDL_QUIT() => sub {
268 main_quit Gtk2; 834 Event::unloop -1;
269 }, 835 },
270 SDL_VIDEORESIZE() => sub { 836 SDL_VIDEORESIZE() => sub {
271 }, 837 },
272 SDL_VIDEOEXPOSE() => sub { 838 SDL_VIDEOEXPOSE() => sub {
273 refresh; 839 refresh;
274 }, 840 },
275 SDL_KEYDOWN() => sub { 841 SDL_KEYDOWN() => sub {
276 if ($SDL_EV->key_mod & KMOD_ALT && $SDL_EV->key_sym == SDLK_RETURN) { 842 if ($SDL_EV->key_mod & KMOD_ALT && $SDL_EV->key_sym == SDLK_RETURN) {
277 # alt-enter 843 # alt-enter
278 $FULLSCREEN = !$FULLSCREEN; 844 video_shutdown;
279 init_screen; 845 $CFG->{fullscreen} = !$CFG->{fullscreen};
846 video_init;
280 } else { 847 } else {
281 CFClient::UI::feed_sdl_key_down_event ($SDL_EV); 848 CFClient::UI::feed_sdl_key_down_event ($SDL_EV);
282 } 849 }
283 }, 850 },
284 SDL_KEYUP() => sub { 851 SDL_KEYUP() => sub {
296 SDL_ACTIVEEVENT() => sub { 863 SDL_ACTIVEEVENT() => sub {
297# printf "active %x %x\n", $SDL_EV->active_gain, $SDL_EV->active_state;#d# 864# printf "active %x %x\n", $SDL_EV->active_gain, $SDL_EV->active_state;#d#
298 }, 865 },
299); 866);
300 867
301@conn::ISA = Crossfire::Protocol::;
302
303sub conn::map_update {
304 my ($self, $dirty) = @_;
305
306 $MAPWIDGET->update;
307}
308
309sub conn::map_scroll {
310 my ($self, $dx, $dy) = @_;
311
312# refresh;
313}
314
315sub conn::map_clear {
316 my ($self) = @_;
317
318# refresh;
319}
320
321sub conn::face_find {
322 my ($self, $face) = @_;
323
324 $FACECACHE->{"$face->{chksum},$face->{name}"}
325}
326
327sub conn::face_update {
328 my ($self, $face) = @_;
329
330 $FACECACHE->{"$face->{chksum},$face->{name}"} = $face->{image};
331
332 $face->{texture} = new_from_image CFClient::Texture delete $face->{image};
333}
334
335sub conn::query {
336 my ($self, $flags, $prompt) = @_;
337
338 warn "<<<<QUERY:$flags:$prompt>>>\n";#d#
339}
340
341sub gtk_add_cfg_field {
342 my ($tbl, $cfg, $klbl, $key, $value) = @_;
343 my $i = $cfg->{_i}++;
344 $tbl->attach_defaults (my $lbl = Gtk2::Label->new ($klbl), 0, 1, $i, $i + 1);
345 $tbl->attach_defaults (my $ent = Gtk2::Entry->new, 1, 2, $i, $i + 1);
346 if ($key eq 'password') {
347 $ent->set_invisible_char ("*");
348 $ent->set (visibility => 0)
349 }
350 $ent->set_text ($value);
351 $ent->signal_connect (changed => sub {
352 my ($ent) = @_;
353 $cfg->{$key} = $ent->get_text;
354 # TODO: Mapsize should be a slider in the game gui
355 if ($key eq 'mapsize' and $cfg->{$key} > 100) {
356 $cfg->{$key} = 100;
357 } elsif ($key eq 'mapsize' and $cfg->{$key} < 50) {
358 $cfg->{$key} = 50;
359 }
360 });
361}
362
363sub run_config_dialog {
364 my (%events) = @_;
365
366 my $w = Gtk2::Window->new;
367
368 my @cfg = (
369 [qw/Host host/],
370 [qw/Port port/],
371 [qw/Mapsize% mapsize/],
372 [qw/Username user/],
373 [qw/Password password/],
374 );
375
376 my $cfg = {};
377
378 $w->add (my $vb = Gtk2::VBox->new);
379 $vb->pack_start (my $t = Gtk2::Table->new (2, scalar @cfg), 0, 0, 0);
380 my $selmode = $::CFG->{width} . 'x' . $::CFG->{height};
381 $t->attach_defaults (Gtk2::Label->new ("Modes"), 0, 1, 0, 1);
382 $t->attach_defaults (my $cb = Gtk2::ComboBox->new_text, 1, 2, 0, 1);
383 my $i = 0;
384 my $act = 0;
385 for (map { "$_->[0]x$_->[1]" } @SDL_MODES) {
386 if ($_ eq $selmode) { $act = $i }
387 $cb->append_text ($_);
388 $i++;
389 }
390 $cb->set_active ($act);
391 $cb->signal_connect (changed => sub {
392 my ($cb) = @_;
393 my $txt = $cb->get_active_text;
394 if ($txt =~ m/(\d+)x(\d+)/) {
395 $::CFG->{width} = $1;
396 $::CFG->{height} = $2;
397 }
398 });
399
400 $cfg->{_i} = 1;
401 for (@cfg) {
402 gtk_add_cfg_field ($t, $cfg, $_->[0], $_->[1], $::CFG->{$_->[1]});
403 }
404
405 $vb->pack_start (my $hb = Gtk2::HBox->new, 0, 0, 0);
406 $hb->pack_start (my $cb = Gtk2::Button->new ("save"), 1, 1, 5);
407 $cb->signal_connect (clicked => sub {
408 for (keys %$cfg) {
409 $::CFG->{$_} = $cfg->{$_}
410 if $_ ne '_i';
411 }
412 CFClient::write_cfg "$CFrossfire::VARDIR/pclientrc";
413 });
414 $hb->pack_start (my $cb = Gtk2::Button->new ("login"), 1, 1, 5);
415 $cb->signal_connect (clicked => sub {
416 for (keys %$cfg) {
417 $::CFG->{$_} = $cfg->{$_}
418 if $_ ne '_i';
419 }
420 my $cb = $events{login} || sub {};
421 $cb->($::CFG->{user}, $::CFG->{password});
422 });
423 $hb->pack_start (my $cb = Gtk2::Button->new ("logout"), 1, 1, 5);
424 $cb->signal_connect (clicked => sub {
425 my $cb = $events{logout} || sub {};
426 $cb->();
427 });
428 $hb->pack_start (my $cb = Gtk2::Button->new ("quit"), 1, 1, 5);
429 $cb->signal_connect (clicked => sub { $w->destroy });
430
431 $w->show_all;
432
433 $w->signal_connect (destroy => sub { Gtk2->main_quit });
434}
435
436
437############################################################################# 868#############################################################################
438 869
439SDL::Init SDL_INIT_EVERYTHING; 870$SIG{INT} = $SIG{TERM} = sub { exit };
440 871
441@SDL_MODES = reverse map [SDL::RectW ($_), SDL::RectH ($_)], 872$TILECACHE = CFClient::db_table "tilecache";
442 @{ SDL::ListModes 0, SDL_FULLSCREEN|SDL_HWSURFACE }; 873$FACEMAP = CFClient::db_table "facemap";
443 874
444CFClient::read_cfg "$Crossfire::VARDIR/pclientrc"; 875CFClient::read_cfg "$Crossfire::VARDIR/pclientrc";
445 876
446$CFG ||= { 877my %DEF_CFG = (
878 sdl_mode => 0,
447 width => 640, 879 width => 640,
448 height => 480, 880 height => 480,
881 fullscreen => 0,
882 fast => 0,
883 fow_enable => 1,
884 fow_intensity => 0.45,
885 fow_smooth => 0,
886 gui_fontsize => 1,
887 log_fontsize => 14,
449 mapsize => 100, 888 mapsize => 100,
450 fullscreen => 0,
451 host => "crossfire.schmorp.de", 889 host => "crossfire.schmorp.de",
452 port => 13327, 890 say_command => 'say',
453}; 891 audio_enable => 1,
892 bgm_enable => 1,
893 bgm_volume => 64,
894);
895
896while (my ($k, $v) = each %DEF_CFG) {
897 $CFG->{$k} = $v unless exists $CFG->{$k};
898}
899
900sdl_init;
901
902@SDL_MODES = reverse
903 grep $_->[0] >= 640 && $_->[1] >= 480,
904 map [SDL::RectW ($_), SDL::RectH ($_)],
905 @{ SDL::ListModes 0, SDL_FULLSCREEN | SDL_HWSURFACE | SDL_OPENGL };
906
907@SDL_MODES or CFClient::fatal "Unable to find a usable video mode\n(hardware accelerated opengl fullscreen)";
908
909$CFG->{sdl_mode} = 0 if $CFG->{sdl_mode} > @SDL_MODES;
454 910
455{ 911{
456 my @fonts = map CFClient::find_rcfile $_, qw(uifont.ttf uifontb.ttf uifonti.ttf uifontbi.ttf); 912 my @fonts = map CFClient::find_rcfile $_, qw(uifont.ttf uifontb.ttf uifonti.ttf uifontbi.ttf);
457 913
458 CFClient::add_font $_ for @fonts; 914 CFClient::add_font $_ for @fonts;
459 CFClient::set_font $fonts[0]; 915 CFClient::set_font $fonts[0];
460} 916}
461 917
462$FACECACHE = eval { Crossfire::load_ref "$Crossfire::VARDIR/pclient.faces" } || {}; 918video_init;
919audio_init;
463 920
464run_config_dialog 921Event::loop;
465 login => sub { start_game },
466 logout => sub { stop_game };
467 922
468main Gtk2; 923END { SDL::Quit }
469 924
470Crossfire::save_ref $FACECACHE, "$Crossfire::VARDIR/pclient.faces"; 925

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines