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.35 by root, Wed Apr 4 02:07:19 2007 UTC vs.
Revision 1.41 by root, Tue Apr 17 10:06:33 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines