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.7 by root, Tue Dec 26 05:44:13 2006 UTC vs.
Revision 1.8 by root, Wed Dec 27 15:04:38 2006 UTC

60 system "cd \Q$PLAYERDIR\E " 60 system "cd \Q$PLAYERDIR\E "
61 . "&& mv \Q$user\E ~\Q$Coro::current\E~deleting~ 2>/dev/null " 61 . "&& mv \Q$user\E ~\Q$Coro::current\E~deleting~ 2>/dev/null "
62 . "&& (rm -rf ~\Q$Coro::current\E~deleting~ &)"; 62 . "&& (rm -rf ~\Q$Coro::current\E~deleting~ &)";
63} 63}
64 64
65sub on_addme { 65sub addme {
66 my ($ns) = @_; 66 my ($ns) = @_;
67 67
68 $ns->destroy if $ns->pl; 68 $ns->destroy if $ns->pl;
69 69
70 $ns->coro (sub { 70 $ns->coro (sub {
257 $ob->reply (undef, "In the future, you will wake up here when you die."); 257 $ob->reply (undef, "In the future, you will wake up here when you die.");
258 $ob->contr->save (1); 258 $ob->contr->save (1);
259 259
260 $ob->contr->ns->query (cf::CS_QUERY_SINGLECHAR, "Do you want to continue playing (y/n)?", sub { 260 $ob->contr->ns->query (cf::CS_QUERY_SINGLECHAR, "Do you want to continue playing (y/n)?", sub {
261 if ($_[0] !~ /^[yY]/) { 261 if ($_[0] !~ /^[yY]/) {
262 $ob->contr->invoke (cf::EVENT_PLAYER_LOGOUT, 1);
262 $ob->contr->ns->destroy; 263 $ob->contr->ns->destroy;
263 } else { 264 } else {
264 $ob->contr->enable_save (1); 265 $ob->contr->enable_save (1);
265 } 266 }
266 }); 267 });
267 }, 268 },
268); 269);
269 270
270cf::client->attach (package => __PACKAGE__); 271cf::player->attach (
272 on_login => sub {
273 my ($pl) = @_;
274 my $name = $pl->ob->name;
271 275
276 $_->ob->message ("$name has entered the game.", cf::NDI_DK_ORANGE | cf::NDI_UNIQUE) for cf::player::list;
277 },
278 on_logout => sub {
279 my ($pl, $cleanly) = @_;
280 my $name = $pl->ob->name;
281
282 if ($cleanly) {
283 $_->ob->message ("$name left the game.", cf::NDI_DK_ORANGE | cf::NDI_UNIQUE) for cf::player::list;
284 } else {
285 $_->ob->message ("$name uncerimoniously disconnected.", cf::NDI_DK_ORANGE | cf::NDI_UNIQUE) for cf::player::list;
286 }
287 },
288);
289
290cf::client->attach (
291 on_addme => \&addme,
292);
293

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines