… | |
… | |
39 | use CFClient::MapWidget; |
39 | use CFClient::MapWidget; |
40 | |
40 | |
41 | $Event::DIED = sub { |
41 | $Event::DIED = sub { |
42 | CFClient::error $_[1]; |
42 | CFClient::error $_[1]; |
43 | }; |
43 | }; |
|
|
44 | |
|
|
45 | #$SIG{__WARN__} = sub { Carp::cluck $_[0] };#d# |
44 | |
46 | |
45 | our $VERSION = '0.1'; |
47 | our $VERSION = '0.1'; |
46 | |
48 | |
47 | my $MAX_FPS = 60; |
49 | my $MAX_FPS = 60; |
48 | my $MIN_FPS = 5; # unused as of yet |
50 | my $MIN_FPS = 5; # unused as of yet |
… | |
… | |
560 | } |
562 | } |
561 | |
563 | |
562 | sub update_metaserver { |
564 | sub update_metaserver { |
563 | my ($HOST) = @_; |
565 | my ($HOST) = @_; |
564 | |
566 | |
565 | 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..."); |
566 | |
570 | |
567 | my $buf; |
571 | my $buf; |
568 | |
572 | |
569 | 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 | } |
570 | |
579 | |
571 | Event->io (fd => $fh, poll => 'r', cb => sub { |
580 | Event->io (fd => $fh, poll => 'r', cb => sub { |
572 | my $res = sysread $fh, $buf, 8192, length $buf; |
581 | my $res = sysread $fh, $buf, 8192, length $buf; |
573 | |
582 | |
574 | if (!defined $res) { |
583 | if (!defined $res) { |
575 | $_[0]->w->cancel; |
584 | $_[0]->w->cancel; |
576 | status "metaserver: $!"; |
585 | $label->set_text ("error while retrieving server list: $!"); |
577 | } elsif ($res == 0) { |
586 | } elsif ($res == 0) { |
578 | $_[0]->w->cancel; |
587 | $_[0]->w->cancel; |
579 | status "server list retrieved"; |
588 | status "server list retrieved"; |
580 | |
589 | |
581 | my $table = $METASERVER->{table}; |
590 | utf8::decode $buf if utf8::valid $buf; |
582 | |
591 | |
583 | $table->clear; |
592 | $table->clear; |
584 | |
593 | |
585 | my @col = qw(Use #Users Host Uptime Version Description); |
594 | my @col = qw(Use #Users Host Uptime Version Description); |
586 | $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[$_]) |
… | |
… | |
610 | $m = [$users, $host, $uptime, $version, $desc]; |
619 | $m = [$users, $host, $uptime, $version, $desc]; |
611 | |
620 | |
612 | $y++; |
621 | $y++; |
613 | |
622 | |
614 | $table->add (0, $y, new CFClient::UI::VBox children => [ |
623 | $table->add (0, $y, new CFClient::UI::VBox children => [ |
615 | (new CFClient::UI::Button text => " ", connect_activate => sub { |
624 | (new CFClient::UI::Button text => "Use", connect_activate => sub { |
616 | $HOST->set_text ($CFG->{host} = $host); |
625 | $HOST->set_text ($CFG->{host} = $host); |
617 | }), |
626 | }), |
618 | (new CFClient::UI::Empty expand => 1), |
627 | (new CFClient::UI::Empty expand => 1), |
619 | ]); |
628 | ]); |
620 | |
629 | |
… | |
… | |
1464 | |
1473 | |
1465 | Event::loop; |
1474 | Event::loop; |
1466 | |
1475 | |
1467 | END { CFClient::SDL_Quit } |
1476 | END { CFClient::SDL_Quit } |
1468 | |
1477 | |
|
|
1478 | =head1 pclient - Crossfire+ and Crossfire game client |
1469 | |
1479 | |
|
|
1480 | Pclient is a Crossfire+ and Crossfire game client. |
|
|
1481 | |
|
|
1482 | =head2 Features |
|
|
1483 | |
|
|
1484 | =over 4 |
|
|
1485 | |
|
|
1486 | =item Fullscreen Map |
|
|
1487 | |
|
|
1488 | PClient can uses a fullscreen map, which greatly enhances how much of the |
|
|
1489 | game world you can see. |
|
|
1490 | |
|
|
1491 | =item Persistent Map Cache (Crossfire+ only) |
|
|
1492 | |
|
|
1493 | PClient can persistently cache all map data it received from the |
|
|
1494 | server. This not only allows it to display an overview map, but also |
|
|
1495 | ensures that once-explored areas will be available the next time you want |
|
|
1496 | to explore more. |
|
|
1497 | |
|
|
1498 | =item Hardware acceleration |
|
|
1499 | |
|
|
1500 | Unlike most Crossfire clients, PClient take advantage of OpenGL hardware |
|
|
1501 | acceleration. Most modern graphics cards have difficulties with 2D |
|
|
1502 | acceleration, while 3D graphics is accelerated well. |
|
|
1503 | |
|
|
1504 | =item No arbitrary limits |
|
|
1505 | |
|
|
1506 | Unlike other Crossfire clients, pclient does not suffer from arbitrary |
|
|
1507 | limits (like a fixed amount of face numbers). There are still limits, but |
|
|
1508 | they 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 | |
|
|
1518 | Most likely, you don't have accelerated OpenGL support. Try to find a |
|
|
1519 | newer driver, or a driver from your hardware vendor, that features OpenGL |
|
|
1520 | support. |
|
|
1521 | |
|
|
1522 | If this is not an option, the following Setup options reduce the load and |
|
|
1523 | will likely make the client playable with sofwtare rendering (it will |
|
|
1524 | still 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 | |
|
|
1542 | Marc Lehmann <crossfire@schmorp.de>, Robin Redeker <elmex@ta-sa.org> |
|
|
1543 | |
|
|
1544 | |
|
|
1545 | |