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.65 by root, Sun Jul 15 08:48:01 2007 UTC vs.
Revision 1.70 by root, Sun Sep 2 12:37:10 2007 UTC

86 cf::NDI_RED 86 cf::NDI_RED
87 ); 87 );
88 # kill them. 88 # kill them.
89 # reminds me of the famous badness 10000 syndrome... 89 # reminds me of the famous badness 10000 syndrome...
90 $ob->stats->hp (-10000); #] if they survive this they deserved to live 90 $ob->stats->hp (-10000); #] if they survive this they deserved to live
91 $pl->killer ("cave-in"); 91 $pl->killer ("a cave-in");
92 } else { 92 } else {
93 $ob->message ( 93 $ob->message (
94 "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " 94 "You didn't use a bed to reality to leave this realm, leaving your body in great danger. "
95 . "Fortunately, some friendly dwellers found you, checked your passport, and brought you to safety. " 95 . "Fortunately, some friendly dwellers found you, checked your passport, and brought you to safety. "
96 . "Better use a savebed next time, much worse things could have happened... " 96 . "Better use a savebed next time, much worse things could have happened... "
116# delete a player directory, be non-blocking AND synchronous... 116# delete a player directory, be non-blocking AND synchronous...
117# (thats hard, so we crap out and fork). 117# (thats hard, so we crap out and fork).
118sub nuke_playerdir { 118sub nuke_playerdir {
119 my ($user) = @_; 119 my ($user) = @_;
120 120
121 aio_stat "$PLAYERDIR/$user"; 121 aio_rename "$PLAYERDIR/$user", "$PLAYERDIR/~$Coro::current~deleting~";
122 system "cd \Q$PLAYERDIR\E " 122 system "rm -rf \Q$PLAYERDIR/~$Coro::current~deleting~\E &";
123 . "&& mv \Q$user\E ~\Q$Coro::current\E~deleting~ 2>/dev/null "
124 . "&& (rm -rf ~\Q$Coro::current\E~deleting~ &)";
125} 123}
126 124
127cf::client->attach (on_addme => sub { 125cf::client->attach (on_addme => sub {
128 my ($ns) = @_; 126 my ($ns) = @_;
129 127
142*** 140***
143*** CFPlus: all known versions automatically enable the facecache. 141*** CFPlus: all known versions automatically enable the facecache.
144*** cfclient: use the -cache commandline option. 142*** cfclient: use the -cache commandline option.
145*** cfclient: map will not redraw automatically (bug). 143*** cfclient: map will not redraw automatically (bug).
146*** gcfclient: use -cache commandline option, or enable 144*** gcfclient: use -cache commandline option, or enable
147*** gcfclient: Client=>Configure=>Map & Image=>Cache Images. 145*** gcfclient: Client => Configure => Map & Image => Cache Images.
148*** jcrossclient: your client is broken, use CFPlus or gcfclient. 146*** jcrossclient: your client is broken, use CFPlus or gcfclient.
149*** 147***
150*** 148***
151EOF 149EOF
152 if ($ns->version =~ /jcrossclient/) { 150 if ($ns->version =~ /jcrossclient/) {
357 355
358 $ob->set_animation (2); 356 $ob->set_animation (2);
359 $ob->add_statbonus; 357 $ob->add_statbonus;
360 358
361 while () { 359 while () {
362 $ns->send_msg (-1, "chargen-race-title", ucfirst $pl->title); 360 $ns->send_msg ("chargen-race-title", ucfirst $pl->title, -1);
363 my $msg = $ob->msg; 361 my $msg = $ob->msg;
364 $msg =~ s/(?<=\S)\n(?=\S)/ /g; 362 $msg =~ s/(?<=\S)\n(?=\S)/ /g;
365 $ns->send_msg (cf::NDI_BLUE, "chargen-race-description", $msg); 363 $ns->send_msg ("chargen-race-description", $msg, cf::NDI_BLUE);
366 364
367 my $res = query $ns, cf::CS_QUERY_SINGLECHAR, 365 my $res = query $ns, cf::CS_QUERY_SINGLECHAR,
368 "Now choose a character.\nPress any key to change outlook.\nPress `d' when you're pleased.\n"; 366 "Now choose a character.\nPress any key to change outlook.\nPress `d' when you're pleased.\n";
369 367
370 last if $res =~ /[dD]/; 368 last if $res =~ /[dD]/;
477 }, 475 },
478); 476);
479 477
480############################################################################# 478#############################################################################
481 479
482our $SCHEDULE_INTERVAL = 10; # time the player scheduler sleeps between runs 480our $SCHEDULE_INTERVAL = $cf::CFG{player_schedule_interval} || 10; # time the player scheduler sleeps between runs
483our $SAVE_TIMEOUT = 20; # save players every n seconds 481our $SAVE_TIMEOUT = $cf::CFG{player_save_interval} || 20; # save players every n seconds
484 482
485our $SCHEDULER = cf::async_ext { 483our $SCHEDULER = cf::async_ext {
486 my $schedule_interval = Coro::Event->timer (after => 1, interval => $SCHEDULE_INTERVAL); 484 my $schedule_interval = Coro::Event->timer (after => 1);
487 while () { 485 while () {
486 $schedule_interval->interval ($SCHEDULE_INTERVAL);
488 $schedule_interval->next; 487 $schedule_interval->next;
489 488
490 # this weird form of iteration over values is used because 489 # this weird form of iteration over values is used because
491 # the hash changes underneath us frequently, and for 490 # the hash changes underneath us frequently, and for
492 # keeps a direct reference to the value without (in 5.8 perls) 491 # keeps a direct reference to the value without (in 5.8 perls)
497 or next; 496 or next;
498 $pl->valid or next; 497 $pl->valid or next;
499 498
500 eval { 499 eval {
501 if ($pl->{last_save} + $SAVE_TIMEOUT <= $cf::RUNTIME) { 500 if ($pl->{last_save} + $SAVE_TIMEOUT <= $cf::RUNTIME) {
502 cf::wait_for_tick_begin;
503 $pl->save; 501 $pl->save;
504 502
505 unless ($pl->active || $pl->ns) { 503 unless ($pl->active || $pl->ns) {
506 # check refcounts, this is tricky and needs to be adjusted to fit server internals 504 # check refcounts, this is tricky and needs to be adjusted to fit server internals
507 my $ob = $pl->ob; 505 my $ob = $pl->ob;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines