ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/login.ext
(Generate patch)

Comparing deliantra/server/ext/login.ext (file contents):
Revision 1.52 by root, Sun Jun 10 03:16:54 2007 UTC vs.
Revision 1.58 by root, Sun Jul 1 03:16:56 2007 UTC

1#! perl # MANDATORY 1#! perl # mandatory
2 2
3# login handling 3# login handling
4 4
5use Fcntl; 5use Fcntl;
6use Coro::AIO; 6use Coro::AIO;
7use List::Util qw(min max); 7use List::Util qw(min max);
8
9our %EXT_SETUP;
8 10
9# paranoia function to overwrite a string-in-place 11# paranoia function to overwrite a string-in-place
10sub nuke_str { 12sub nuke_str {
11 substr $_[0], 0, (length $_[0]), "x" x length $_[0] 13 substr $_[0], 0, (length $_[0]), "x" x length $_[0]
12} 14}
203 205
204 } elsif ($k eq "smoothing") { # cfplus-style smoothing 206 } elsif ($k eq "smoothing") { # cfplus-style smoothing
205 $ns->smoothing ($v); 207 $ns->smoothing ($v);
206 208
207 } elsif ($k eq "fxix") { 209 } elsif ($k eq "fxix") {
210 $v = 2 if $v > 2;
208 $ns->fxix ($v); 211 $ns->fxix ($v);
212 $setup{$k} = $v;
209 213
210 } elsif ($k eq "msg") { 214 } elsif ($k eq "msg") {
215 $v = 2 if $v > 2;
211 $ns->can_msg ($v); 216 $ns->can_msg ($v >= 2);
217 $setup{$k} = $v;
218
219 } elsif ($k eq "xwidget") {
220 # eXperimental server-side widgets
221 $ns->{can_widget} = 1;
212 222
213 } elsif ($k eq "excmd") { 223 } elsif ($k eq "excmd") {
214 # we support it 224 # we support it
215 225
216 } else { 226 } else {
474 $pl->chargen_race_next; 484 $pl->chargen_race_next;
475 } 485 }
476 486
477 $pl->chargen_race_done; 487 $pl->chargen_race_done;
478 488
489 while () {
490 my $res = query $ns, cf::CS_QUERY_SINGLECHAR,
491 "Now choose a gender.\nPress 'f' to become female, and 'm' to become male.\n";
492
493 if ($res =~ /^[fF]/) {
494 $pl->gender (1);
495 last;
496 } elsif ($res =~ /^[mM]/) {
497 $pl->gender (0);
498 last;
499 }
500 }
501
502 $ob->reply (undef, "Welcome to Crossfire!");
503
479 delete $pl->{deny_save}; 504 delete $pl->{deny_save};
480 505
481 last; 506 last;
482 } 507 }
483 }); 508 });
606 631
607 # remove from sight and get fresh "copies" 632 # remove from sight and get fresh "copies"
608 $pl = delete $cf::PLAYER{$ob->name}; 633 $pl = delete $cf::PLAYER{$ob->name};
609 $ob = $pl->ob; 634 $ob = $pl->ob;
610 635
611 $ob->destroy;
612 $pl->destroy; 636 $pl->destroy; # destroys $ob
613 } else { 637 } else {
614 my $a_ = $pl->refcnt;#d# 638 my $a_ = $pl->refcnt;#d#
615 my $b_ = $ob->refcnt;#d# 639 my $b_ = $ob->refcnt;#d#
616 640
617 warn "player-scheduler refcnt ", $ob->name, " pl $pl_ref ob $ob_ref (C pl $a_ ob $b_)\n";#d# 641 warn "player-scheduler refcnt ", $ob->name, " pl $pl_ref ob $ob_ref (C pl $a_ ob $b_)\n";#d#

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines