--- deliantra/server/ext/login.ext 2007/07/14 14:54:05 1.63 +++ deliantra/server/ext/login.ext 2007/07/14 19:27:59 1.64 @@ -5,6 +5,8 @@ use Fcntl; use Coro::AIO; +our $MAX_DISCONNECT_TIME = $cf::CFG{max_disconnect_time} || 3600; + # paranoia function to overwrite a string-in-place sub nuke_str { substr $_[0], 0, (length $_[0]), "x" x length $_[0] @@ -69,22 +71,38 @@ if ($time < $m->{instantiate_time}) { # the map was reset in the meantime my $age = $cf::RUNTIME - $time; - warn $ob->name, " map reset after logout, logout age $age\n";#d# + + warn $ob->name, " map reset after logout, logout age $age (>= $MAX_DISCONNECT_TIME)\n";#d# # for now, just go back to savebed ($map, $x, $y) = $pl->savebed; - $pl->ns->send_drawinfo ( - "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " - . "Fortunately, some friendly dwellers found you, checked your passport, and brought you to safety. " - . "Better use a savebed next time, much worse things could have happened...", - cf::NDI_RED - ); + if ($age >= $MAX_DISCONNECT_TIME) { + $ob->message ( + "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " + . "Unfortunately, nobody was near to help you when the monsters arrived to eat you. " + . "Maybe you can find comfort in the thought that your body was quite satisfying in taste... " + . "H", + cf::NDI_RED + ); + # kill them. + # reminds me of the famous badness 10000 syndrome... + $ob->stats->hp (-10000); #] if they survive this they deserved to live + } else { + $ob->message ( + "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " + . "Fortunately, some friendly dwellers found you, checked your passport, and brought you to safety. " + . "Better use a savebed next time, much worse things could have happened... " + . "H", + cf::NDI_RED + ); + } } else { - $pl->ns->send_drawinfo ( + $ob->message ( "You didn't use a bed to reality to leave this realm. This is very dangerous, " . "as lots of things could happen when you leave by other means, such as cave-ins, " - . "or monsters suddenly snapping your body. Better use a savebed next time.", + . "or monsters suddenly snapping your body. Better use a savebed next time. " + . "H", cf::NDI_RED ); }