From 86c9c86eebdad234520461f61f925eb60f965312 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 25 Jul 2017 03:13:03 +0100 Subject: allow pass recharge with no loss of current time up to 1/4 of parcel pass time. --- .../CoreModules/World/Land/LandManagementModule.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/Land') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 377f243..a3146c1 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -579,8 +579,9 @@ namespace OpenSim.Region.CoreModules.World.Land return true; return false; }); - - int expires = Util.UnixTimeSinceEpoch() + (int)(3600.0 * ldata.PassHours); + int now = Util.UnixTimeSinceEpoch(); + int expires = (int)(3600.0 * ldata.PassHours + 0.5f); + int currenttime = -1; if (idx != -1) { if(ldata.ParcelAccessList[idx].Expires == 0) @@ -589,18 +590,17 @@ namespace OpenSim.Region.CoreModules.World.Land return; } - if(expires < land.LandData.ParcelAccessList[idx].Expires - 300f) - { - remote_client.SendAgentAlertMessage("Your pass to parcel is still valid for 5 minutes", false); - return; - } + currenttime = ldata.ParcelAccessList[idx].Expires - now; + if(currenttime > (int)(0.25f * expires + 0.5f)) + currenttime = (int)(0.25f * expires + 0.5f); } LandAccessEntry entry = new LandAccessEntry(); entry.AgentID = targetID; entry.Flags = AccessList.Access; - entry.Expires = expires; - + entry.Expires = now + expires; + if(currenttime > 0) + entry.Expires += currenttime; IMoneyModule mm = m_scene.RequestModuleInterface(); if(cost != 0 && mm != null) { -- cgit v1.1