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.36 by root, Wed Apr 4 02:20:27 2007 UTC vs.
Revision 1.42 by root, Wed Apr 18 17:32:06 2007 UTC

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 8
9my $PLAYERDIR = sprintf "%s/%s", cf::localdir, cf::playerdir;
10
11# paranoia function to overwrite a string-in-place 9# paranoia function to overwrite a string-in-place
12sub nuke_str { 10sub nuke_str {
13 substr $_[0], 0, (length $_[0]), "x" x length $_[0] 11 substr $_[0], 0, (length $_[0]), "x" x length $_[0]
14} 12}
15 13
16sub query { 14sub query {
17 my ($ns, $flags, $text) = @_; 15 my ($ns, $flags, $text) = @_;
18 16
19 my $current = $Coro::current; 17 my $current = $Coro::current;
20 $ns->query ($flags, $text, sub { $current->ready; $current = $_[0]; }); 18 $ns->query ($flags, $text, sub { $current->ready; $current = $_[0] });
21 Coro::schedule while ref $current; 19 Coro::schedule while ref $current;
22 20
23 $current 21 $current
24} 22}
25 23
137 135
138 } elsif ($k eq "extmap") { 136 } elsif ($k eq "extmap") {
139 $ns->extmap ($v); 137 $ns->extmap ($v);
140 138
141 } elsif ($k eq "facecache") { 139 } elsif ($k eq "facecache") {
140 if (!$v) {
141 $v = 1;
142 $setup{$k} = $v;
143 $ns->send_drawinfo ("(trying to forcefully enable facecaching)", cf::NDI_RED);
144 }
145
142 $ns->facecache ($v); 146 $ns->facecache ($v);
143 147
144 } elsif ($k eq "faceset") { 148 } elsif ($k eq "faceset") {
145 $ns->faceset (0); 149 $ns->faceset (0);
146 $setup{$k} = 0; 150 $setup{$k} = 0;
168 } elsif ($k eq "extendedMapInfos") { 172 } elsif ($k eq "extendedMapInfos") {
169 $ns->ext_mapinfos ($v); 173 $ns->ext_mapinfos ($v);
170 174
171 } elsif ($k eq "extendedTextInfos") { 175 } elsif ($k eq "extendedTextInfos") {
172 $ns->has_readable_type ($v); 176 $ns->has_readable_type ($v);
177
178 } elsif ($k eq "smoothing") { # cfplus-style smoothing
179 $ns->smoothing ($v);
173 180
174 } elsif ($k eq "fxix") { 181 } elsif ($k eq "fxix") {
175 $ns->fxix ($v); 182 $ns->fxix ($v);
176 183
177 } else { 184 } else {
354 . "(check for Numlock and other semi-obvious error sources).", 361 . "(check for Numlock and other semi-obvious error sources).",
355 cf::NDI_RED 362 cf::NDI_RED
356 ); 363 );
357 next; 364 next;
358 } 365 }
366 } else {
367 # unable to load the playerfile:
368 # check wether the player dir exists, which means the file is corrupted or
369 # something very similar.
370 if (!aio_stat cf::player::playerdir $user) {
371 $ns->send_drawinfo (
372 "Unable to retrieve this player. It might be a locked or broken account. "
373 . "If this is your account, ask a dungeon master for assistance. "
374 . "Otherwise choose a different login name.",
375 cf::NDI_RED
376 );
377 next;
378 }
359 } 379 }
360 380
361 # the rest of this function is character creation 381 # the rest of this function is character creation
362 382
363 # just to make sure nothing is left over 383 # just to make sure nothing is left over
523 or next; 543 or next;
524 $pl->valid or next; 544 $pl->valid or next;
525 545
526 eval { 546 eval {
527 if ($pl->{last_save} + $SAVE_TIMEOUT <= $cf::RUNTIME) { 547 if ($pl->{last_save} + $SAVE_TIMEOUT <= $cf::RUNTIME) {
528 $cf::WAIT_FOR_TICK_ONE->wait; 548 cf::wait_for_tick_begin;
529 $pl->save; 549 $pl->save;
530 550
531 unless ($pl->active) { 551 unless ($pl->active) {
532 # check refcounts, this is tricky and needs to be adjusted to fit server internals 552 # check refcounts, this is tricky and needs to be adjusted to fit server internals
533 my $ob = $pl->ob; 553 my $ob = $pl->ob;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines