… | |
… | |
3 | # login handling |
3 | # login handling |
4 | |
4 | |
5 | use Fcntl; |
5 | use Fcntl; |
6 | use Coro::AIO; |
6 | use Coro::AIO; |
7 | use List::Util qw(min max); |
7 | use List::Util qw(min max); |
8 | |
|
|
9 | my $PLAYERDIR = sprintf "%s/%s", cf::localdir, cf::playerdir; |
|
|
10 | |
8 | |
11 | # paranoia function to overwrite a string-in-place |
9 | # paranoia function to overwrite a string-in-place |
12 | sub nuke_str { |
10 | sub nuke_str { |
13 | substr $_[0], 0, (length $_[0]), "x" x length $_[0] |
11 | substr $_[0], 0, (length $_[0]), "x" x length $_[0] |
14 | } |
12 | } |
… | |
… | |
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; |
… | |
… | |
539 | or next; |
543 | or next; |
540 | $pl->valid or next; |
544 | $pl->valid or next; |
541 | |
545 | |
542 | eval { |
546 | eval { |
543 | if ($pl->{last_save} + $SAVE_TIMEOUT <= $cf::RUNTIME) { |
547 | if ($pl->{last_save} + $SAVE_TIMEOUT <= $cf::RUNTIME) { |
544 | $cf::WAIT_FOR_TICK_ONE->wait; |
548 | cf::wait_for_tick_begin; |
545 | $pl->save; |
549 | $pl->save; |
546 | |
550 | |
547 | unless ($pl->active) { |
551 | unless ($pl->active) { |
548 | # 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 |
549 | my $ob = $pl->ob; |
553 | my $ob = $pl->ob; |