--- deliantra/server/ext/invite.ext 2006/12/15 19:29:18 1.1 +++ deliantra/server/ext/invite.ext 2007/02/11 02:25:25 1.3 @@ -1,13 +1,13 @@ #! perl +# implement the invite command + # level 1: invite to private rooms only ~lvl 10 # level 2: private rooms and saving maps (guilds, some other public saving maps) # level 3: invite everywhere where no monsters are on the map # level 4: invite everywhere -# implement a 'follow' command - -my $TIMEOUT = 60; +my $TIMEOUT = $cf::CFG{invite_timeout} || 60; # determine whether map cell is damned sub is_damned { @@ -39,10 +39,7 @@ } } - my $path = $map->path; - my $player = sprintf "%s/%s/", cf::localdir, cf::playerdir; - - if ($player eq substr $path, 0, length $player) { + if ($map->path =~ /^~/) { 1 } elsif (grep $_->flag (cf::FLAG_UNIQUE) && $_->flag (cf::FLAG_IS_FLOOR), $map->at ($x, $y)) { 2 @@ -77,8 +74,8 @@ if (is_damned ($map, $x, $y)) { $who->message ("Your god isn't present here, you can't invite someone to unholy ground."); } elsif ($plevel >= $mlevel) { - if (my $other = cf::player::find $args) { - $who->message ("inviting player '$args', to cancel, type: 'invite or wait $TIMEOUT seconds"); + if (my $other = cf::player::find_active $args) { + $who->message ("inviting player '$args', to cancel, use invite with no arguments or wait $TIMEOUT seconds"); $other->ob->message ("$name invites you to $maplevel[$mlevel], to accept, use 'accept-invitation $name"); $invite{$name}{$args} = [time + $TIMEOUT, $map, $x, $y]; } else {