--- deliantra/server/ext/rent.ext 2007/06/26 04:56:10 1.10 +++ deliantra/server/ext/rent.ext 2008/07/17 09:13:09 1.14 @@ -12,6 +12,7 @@ "/pup_land/nurnberg/apartment/main" => [ 300, "nürnberg", "sauerkraut"], "/pup_land/lone_town/apartment/groundfloor" => [50000, "lone town", "looney"], "/brest/apartments/brest_town_house" => [30000, "brest", "brecht"], + "/elmex/jeweler/jeweler_inn_upper" => [ 500, "jeweler town", "jewelor"], ); # we have to special case some special cases :) @@ -47,6 +48,8 @@ sub pay_balance { my ($pl) = @_; + cf::cede_to_tick; + update_balance $pl; return unless $pl->{rent}{balance} > 0; @@ -145,7 +148,7 @@ if ($pl->{rent}{last_online_check}) { $pl->{rent}{last_online_check} = time - List::Util::min 3600, - $pl->ob->get_ob_key_value ("schmorplog_last_save") - $pl->{rent}{last_online_check}; + $pl->ob->kv_get ("schmorplog_last_save") - $pl->{rent}{last_online_check}; } else { $pl->{rent}{last_online_check} = time; } @@ -177,19 +180,13 @@ } } - $pl->ob->reply (undef, "Your highness, you have to rent this apartment in The Apartment Shop in Scorn first!"); + $pl->ob->reply (undef, "Your highness, you have to rent this apartment in The Apartment Shop in Scorn or other apartment shops first!"); reject_entry $pl; } }, ; -our $RENT_TIMER = Event->timer ( - reentrant => 0, - after => 60, - interval => 3600, - data => cf::WF_AUTOCANCEL, - cb => sub { - pay_balance $_ for cf::player::list; - }, -); +our $RENT_TIMER = cf::periodic 3600, Coro::unblock_sub { + pay_balance $_ for cf::player::list; +};