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.75 by root, Wed Dec 26 21:38:02 2007 UTC vs.
Revision 1.76 by root, Fri Dec 28 19:40:22 2007 UTC

52 ); 52 );
53 53
54 1 54 1
55} 55}
56 56
57sub safe_spot($$$) {
58 my ($m, $x, $y) = @_;
59
60 scalar grep $_->type == cf::SAVEBED, $m->at ($x, $y)
61}
62
57sub enter_map { 63sub enter_map {
58 my ($pl) = @_; 64 my ($pl) = @_;
59 65
60 my $ob = $pl->ob; 66 my $ob = $pl->ob;
61 67
72 # the map was reset in the meantime 78 # the map was reset in the meantime
73 my $age = $cf::RUNTIME - $time; 79 my $age = $cf::RUNTIME - $time;
74 80
75 warn $ob->name, " map reset after logout, logout age $age (>= $MAX_DISCONNECT_TIME)\n";#d# 81 warn $ob->name, " map reset after logout, logout age $age (>= $MAX_DISCONNECT_TIME)\n";#d#
76 82
77 # for now, just go back to savebed
78 ($map, $x, $y) = $pl->savebed; 83 ($map, $x, $y) = $pl->savebed;
79 84
85 if (safe_spot $m, $x, $y) {
86 # do nothing, this is simply ok without a special scary message
80 if ($age >= $MAX_DISCONNECT_TIME) { 87 } elsif ($age >= $MAX_DISCONNECT_TIME) {
81 $ob->message ( 88 $ob->message (
82 "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " 89 "You didn't use a bed to reality to leave this realm, leaving your body in great danger. "
83 . "Unfortunately, nobody was near to help you when the monsters arrived to eat you. " 90 . "Unfortunately, nobody was near to help you when the monsters arrived to eat you. "
84 . "Maybe you can find comfort in the thought that your body was quite satisfying in taste... " 91 . "Maybe you can find comfort in the thought that your body was quite satisfying in taste... "
85 . "H<You disconnected too long without having used a savebed.>", 92 . "H<You disconnected too long without having used a savebed.>",
96 . "Better use a savebed next time, much worse things could have happened... " 103 . "Better use a savebed next time, much worse things could have happened... "
97 . "H<You disconnected without having used a savebed. When you do that for too long, you might die.>", 104 . "H<You disconnected without having used a savebed. When you do that for too long, you might die.>",
98 cf::NDI_RED 105 cf::NDI_RED
99 ); 106 );
100 } 107 }
108 } elsif (safe_spot $m, $x, $y) {
109 # do nothing, this is simply ok without a special scary message
101 } else { 110 } else {
102 $ob->message ( 111 $ob->message (
103 "You didn't use a bed to reality to leave this realm. This is very dangerous, " 112 "You didn't use a bed to reality to leave this realm. This is very dangerous, "
104 . "as lots of things could happen when you leave by other means, such as cave-ins, " 113 . "as lots of things could happen when you leave by other means, such as cave-ins, "
105 . "or monsters suddenly snapping your body. Better use a savebed next time. " 114 . "or monsters suddenly snapping your body. Better use a savebed next time. "

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines