allow pass recharge with no loss of current time up to 1/4 of parcel pass time.

0.9.0-post-fixes
UbitUmarov 2017-07-25 03:13:03 +01:00
parent c5b34a51fd
commit 86c9c86eeb
1 changed files with 9 additions and 9 deletions

View File

@ -579,8 +579,9 @@ namespace OpenSim.Region.CoreModules.World.Land
return true; return true;
return false; return false;
}); });
int now = Util.UnixTimeSinceEpoch();
int expires = Util.UnixTimeSinceEpoch() + (int)(3600.0 * ldata.PassHours); int expires = (int)(3600.0 * ldata.PassHours + 0.5f);
int currenttime = -1;
if (idx != -1) if (idx != -1)
{ {
if(ldata.ParcelAccessList[idx].Expires == 0) if(ldata.ParcelAccessList[idx].Expires == 0)
@ -589,18 +590,17 @@ namespace OpenSim.Region.CoreModules.World.Land
return; return;
} }
if(expires < land.LandData.ParcelAccessList[idx].Expires - 300f) currenttime = ldata.ParcelAccessList[idx].Expires - now;
{ if(currenttime > (int)(0.25f * expires + 0.5f))
remote_client.SendAgentAlertMessage("Your pass to parcel is still valid for 5 minutes", false); currenttime = (int)(0.25f * expires + 0.5f);
return;
}
} }
LandAccessEntry entry = new LandAccessEntry(); LandAccessEntry entry = new LandAccessEntry();
entry.AgentID = targetID; entry.AgentID = targetID;
entry.Flags = AccessList.Access; entry.Flags = AccessList.Access;
entry.Expires = expires; entry.Expires = now + expires;
if(currenttime > 0)
entry.Expires += currenttime;
IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>(); IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>();
if(cost != 0 && mm != null) if(cost != 0 && mm != null)
{ {