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.176 by root, Mon Apr 24 10:19:40 2006 UTC vs.
Revision 1.178 by root, Tue Apr 25 08:39:18 2006 UTC

36 36
37use CFClient; 37use CFClient;
38use CFClient::UI; 38use CFClient::UI;
39use CFClient::MapWidget; 39use CFClient::MapWidget;
40 40
41$SIG{__DIE__} = sub { CFClient::fatal "$_[0]"; exit 1 }; 41$Event::DIED = sub {
42 CFClient::error $_[1];
43};
44
45#$SIG{__WARN__} = sub { Carp::cluck $_[0] };#d#
42 46
43our $VERSION = '0.1'; 47our $VERSION = '0.1';
44 48
45my $MAX_FPS = 60; 49my $MAX_FPS = 60;
46my $MIN_FPS = 5; # unused as of yet 50my $MIN_FPS = 5; # unused as of yet
558} 562}
559 563
560sub update_metaserver { 564sub update_metaserver {
561 my ($HOST) = @_; 565 my ($HOST) = @_;
562 566
563 status "fetching metaserver list..."; 567 my $table = $METASERVER->{table};
568 $table->clear;
569 $table->add (0, 0, my $label = new CFClient::UI::Label max_w => $WIDTH * 0.8, text => "fetching metaserver list...");
564 570
565 my $buf; 571 my $buf;
566 572
567 my $fh = new IO::Socket::INET PeerHost => $META_SERVER, Blocking => 0; 573 my $fh = new IO::Socket::INET PeerHost => $META_SERVER, Blocking => 0;
574
575 unless ($fh) {
576 $label->set_text ("unable to contact metaserver: $!");
577 return;
578 }
568 579
569 Event->io (fd => $fh, poll => 'r', cb => sub { 580 Event->io (fd => $fh, poll => 'r', cb => sub {
570 my $res = sysread $fh, $buf, 8192, length $buf; 581 my $res = sysread $fh, $buf, 8192, length $buf;
571 582
572 if (!defined $res) { 583 if (!defined $res) {
573 $_[0]->w->cancel; 584 $_[0]->w->cancel;
574 status "metaserver: $!"; 585 $label->set_text ("error while retrieving server list: $!");
575 } elsif ($res == 0) { 586 } elsif ($res == 0) {
576 $_[0]->w->cancel; 587 $_[0]->w->cancel;
577 status "server list retrieved"; 588 status "server list retrieved";
578 589
579 my $table = $METASERVER->{table}; 590 utf8::decode $buf if utf8::valid $buf;
580 591
581 $table->clear; 592 $table->clear;
582 593
583 my @col = qw(Use #Users Host Uptime Version Description); 594 my @col = qw(Use #Users Host Uptime Version Description);
584 $table->add ($_, 0, new CFClient::UI::Label align => 0, fg => [1, 1, 0], text => $col[$_]) 595 $table->add ($_, 0, new CFClient::UI::Label align => 0, fg => [1, 1, 0], text => $col[$_])
608 $m = [$users, $host, $uptime, $version, $desc]; 619 $m = [$users, $host, $uptime, $version, $desc];
609 620
610 $y++; 621 $y++;
611 622
612 $table->add (0, $y, new CFClient::UI::VBox children => [ 623 $table->add (0, $y, new CFClient::UI::VBox children => [
613 (new CFClient::UI::Button text => " ", connect_activate => sub { 624 (new CFClient::UI::Button text => "Use", connect_activate => sub {
614 $HOST->set_text ($CFG->{host} = $host); 625 $HOST->set_text ($CFG->{host} = $host);
615 }), 626 }),
616 (new CFClient::UI::Empty expand => 1), 627 (new CFClient::UI::Empty expand => 1),
617 ]); 628 ]);
618 629
837 $BUTTONBAR->{children}[1]->emit ("activate"); # pop up server setup 848 $BUTTONBAR->{children}[1]->emit ("activate"); # pop up server setup
838} 849}
839 850
840sub video_shutdown { 851sub video_shutdown {
841 $CFClient::UI::ROOT->{children} = []; 852 $CFClient::UI::ROOT->{children} = [];
853 undef $CFClient::UI::GRAB;
854 undef $CFClient::UI::HOVER;
842 undef $SDL_ACTIVE; 855 undef $SDL_ACTIVE;
843} 856}
844 857
845my @bgmusic = qw(game1.ogg game2.ogg game3.ogg game5.ogg game6.ogg ross1.ogg ross2.ogg ross3.ogg ross4.ogg ross5.ogg); #d# 858my @bgmusic = qw(game1.ogg game2.ogg game3.ogg game5.ogg game6.ogg ross1.ogg ross2.ogg ross3.ogg ross4.ogg ross5.ogg); #d#
846my $bgmusic;#TODO#hack#d# 859my $bgmusic;#TODO#hack#d#
1460 1473
1461Event::loop; 1474Event::loop;
1462 1475
1463END { CFClient::SDL_Quit } 1476END { CFClient::SDL_Quit }
1464 1477
1478=head1 pclient - Crossfire+ and Crossfire game client
1465 1479
1480Pclient is a Crossfire+ and Crossfire game client.
1481
1482=head2 Features
1483
1484=over 4
1485
1486=item Fullscreen Map
1487
1488PClient can uses a fullscreen map, which greatly enhances how much of the
1489game world you can see.
1490
1491=item Persistent Map Cache (Crossfire+ only)
1492
1493PClient can persistently cache all map data it received from the
1494server. This not only allows it to display an overview map, but also
1495ensures that once-explored areas will be available the next time you want
1496to explore more.
1497
1498=item Hardware acceleration
1499
1500Unlike most Crossfire clients, PClient take advantage of OpenGL hardware
1501acceleration. Most modern graphics cards have difficulties with 2D
1502acceleration, while 3D graphics is accelerated well.
1503
1504=item No arbitrary limits
1505
1506Unlike other Crossfire clients, pclient does not suffer from arbitrary
1507limits (like a fixed amount of face numbers). There are still limits, but
1508they are not arbitrarily low :)
1509
1510=back
1511
1512=head1 FAQ
1513
1514=over 4
1515
1516=item The client is very sluggish and slow, what can I do about this?
1517
1518Most likely, you don't have accelerated OpenGL support. Try to find a
1519newer driver, or a driver from your hardware vendor, that features OpenGL
1520support.
1521
1522If this is not an option, the following Setup options reduce the load and
1523will likely make the client playable with sofwtare rendering (it will
1524still be slow, though):
1525
1526=over 4
1527
1528=item B<Video Mode> should be set as low as possible (e.g. 640x480)
1529
1530=item Enable B<Fast & Ugly> mode
1531
1532=item Disable B<Fog of War>
1533
1534=item Increase B<Map Scale>
1535
1536=back
1537
1538=back
1539
1540=head1 AUTHOR
1541
1542Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org>
1543
1544
1545

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines