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.80 by root, Sun Jan 13 12:27:12 2008 UTC

52 ); 52 );
53 53
54 1 54 1
55} 55}
56 56
57sub safe_spot($) {
58 my ($pl) = @_;
59
60 my $ob = $pl->ob;
61
62 my $m = $ob->map
63 or return;
64 my $x = $ob->x;
65 my $y = $ob->y;
66
67# return 0;#d#
68# warn join ":", $m->at ($x, $y);#d#
69# warn "FOO$m { ".scalar ($m->at ($x, $y))." }\n";
70# return 0;
71
72 scalar grep $_->type == cf::SAVEBED, $m->at ($x, $y)
73}
74
57sub enter_map { 75sub enter_map {
58 my ($pl) = @_; 76 my ($pl) = @_;
59 77
60 my $ob = $pl->ob; 78 my $ob = $pl->ob;
61 79
64 ? @{delete $ob->{_link_pos}} 82 ? @{delete $ob->{_link_pos}}
65 : ($pl->maplevel, $ob->x, $ob->y); 83 : ($pl->maplevel, $ob->x, $ob->y);
66 84
67 $ob->enter_link; 85 $ob->enter_link;
68 86
87 my $m = cf::map::find $map;
69 if (my $time = delete $pl->{unclean_save}) { 88 my $time = delete $pl->{unclean_save};
70 if (my $m = cf::map::find $map) { 89
90 if ($time && $m) {
71 if ($time < $m->{instantiate_time}) { 91 if ($time < $m->{instantiate_time}) {
72 # the map was reset in the meantime 92 # the map was reset in the meantime
73 my $age = $cf::RUNTIME - $time; 93 my $age = $cf::RUNTIME - $time;
74 94
75 warn $ob->name, " map reset after logout, logout age $age (>= $MAX_DISCONNECT_TIME)\n";#d# 95 warn $ob->name, " map reset after logout, logout age $age (>= $MAX_DISCONNECT_TIME)\n";#d#
76 96
77 # for now, just go back to savebed
78 ($map, $x, $y) = $pl->savebed; 97 ($map, $x, $y) = $pl->savebed;
79 98
80 if ($age >= $MAX_DISCONNECT_TIME) { 99 if ($age >= $MAX_DISCONNECT_TIME) {
81 $ob->message ( 100 $ob->message (
82 "You didn't use a bed to reality to leave this realm, leaving your body in great danger. " 101 "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. " 102 . "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... " 103 . "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.>", 104 . "H<You disconnected too long without having used a savebed.>",
86 cf::NDI_RED 105 cf::NDI_RED
87 ); 106 );
88 # kill them. 107 # kill them.
89 # reminds me of the famous badness 10000 syndrome... 108 # reminds me of the famous badness 10000 syndrome...
90 $ob->stats->hp (-10000); #] if they survive this they deserved to live 109 $ob->stats->hp (-10000); #] if they survive this they deserved to live
91 $pl->killer ("a cave-in"); 110 $pl->killer ("a cave-in");
92 } else {
93 $ob->message (
94 "You didn't use a bed to reality to leave this realm, leaving your body in great danger. "
95 . "Fortunately, some friendly dwellers found you, checked your passport, and brought you to safety. "
96 . "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.>",
98 cf::NDI_RED
99 );
100 }
101 } else { 111 } else {
102 $ob->message ( 112 $ob->message (
103 "You didn't use a bed to reality to leave this realm. This is very dangerous, " 113 "You didn't use a bed to reality to leave this realm, leaving your body in great danger. "
104 . "as lots of things could happen when you leave by other means, such as cave-ins, " 114 . "Fortunately, some friendly dwellers found you, checked your passport, and brought you to safety. "
105 . "or monsters suddenly snapping your body. Better use a savebed next time. " 115 . "Better use a savebed next time, much worse things could have happened... "
106 . "H<Always apply a bed of reality to disconnect from the server.>", 116 . "H<You disconnected without having used a savebed. When you do that for too long, you might die.>",
107 cf::NDI_RED 117 cf::NDI_RED
108 ); 118 );
109 } 119 }
120 } else {
121 $ob->message (
122 "You didn't use a bed to reality to leave this realm. This is very dangerous, "
123 . "as lots of things could happen when you leave by other means, such as cave-ins, "
124 . "or monsters suddenly snapping your body. Better use a savebed next time. "
125 . "H<Always apply a bed of reality to disconnect from the server.>",
126 cf::NDI_RED
127 );
110 } 128 }
111 } 129 }
112 130
113 $ob->goto ($map, $x, $y); 131 $ob->goto ($map, $x, $y);
114} 132}
140*** or it has been disabled. Face caching is mandatory 158*** or it has been disabled. Face caching is mandatory
141*** so please enable it or use a newer client. 159*** so please enable it or use a newer client.
142*** 160***
143*** Look at your client preferences: 161*** Look at your client preferences:
144*** 162***
145*** CFPlus: all known versions automatically enable the facecache. 163*** deliantra: all known versions automatically enable the facecache.
146*** cfclient: use the -cache commandline option. 164*** cfclient: use the -cache commandline option.
147*** cfclient: map will not redraw automatically (bug). 165*** cfclient: map will not redraw automatically (bug).
148*** gcfclient: use -cache commandline option, or enable 166*** gcfclient: use -cache commandline option, or enable
149*** gcfclient: Client => Configure => Map & Image => Cache Images. 167*** gcfclient: Client => Configure => Map & Image => Cache Images.
150*** jcrossclient: your client is broken, use CFPlus or gcfclient. 168*** jcrossclient: your client is broken, use deliantra or gcfclient.
151*** 169***
152*** 170***
153EOF 171EOF
154 if ($ns->version =~ /jcrossclient/) { 172 if ($ns->version =~ /jcrossclient/) {
155 # let them, for now 173 # let them, for now
479 497
480 if ($cleanly) { 498 if ($cleanly) {
481 $_->ob->message ("$name left the game.", cf::NDI_DK_ORANGE | cf::NDI_UNIQUE) for cf::player::list; 499 $_->ob->message ("$name left the game.", cf::NDI_DK_ORANGE | cf::NDI_UNIQUE) for cf::player::list;
482 } else { 500 } else {
483 $_->ob->message ("$name uncerimoniously disconnected.", cf::NDI_DK_ORANGE | cf::NDI_UNIQUE) for cf::player::list; 501 $_->ob->message ("$name uncerimoniously disconnected.", cf::NDI_DK_ORANGE | cf::NDI_UNIQUE) for cf::player::list;
484 $pl->{unclean_save} = $cf::RUNTIME; 502 $pl->{unclean_save} = $cf::RUNTIME
503 unless safe_spot $pl;
485 } 504 }
486 }, 505 },
487); 506);
488 507
489############################################################################# 508#############################################################################

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines