mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Merge branch 'avination' into careminster
This commit is contained in:
@@ -61,6 +61,8 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
public event ChangeDelegate OnEstateInfoChange;
|
||||
public event MessageDelegate OnEstateMessage;
|
||||
|
||||
private int m_delayCount = 0;
|
||||
|
||||
#region Packet Data Responders
|
||||
|
||||
private void clientSendDetailedEstateData(IClientAPI remote_client, UUID invoice)
|
||||
@@ -270,7 +272,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
if (timeInSeconds == -1)
|
||||
{
|
||||
restartModule.AbortRestart("Restart aborted by region manager");
|
||||
m_delayCount++;
|
||||
if (m_delayCount > 3)
|
||||
return;
|
||||
|
||||
restartModule.DelayRestart(3600, "Restart delayed by region manager");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1101,8 +1101,11 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
if (!temp.Contains(currentParcel))
|
||||
{
|
||||
currentParcel.ForceUpdateLandInfo();
|
||||
temp.Add(currentParcel);
|
||||
if (!currentParcel.IsEitherBannedOrRestricted(remote_client.AgentId))
|
||||
{
|
||||
currentParcel.ForceUpdateLandInfo();
|
||||
temp.Add(currentParcel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax];
|
||||
|
||||
private int m_lastSeqId = 0;
|
||||
private int m_expiryCounter = 0;
|
||||
|
||||
protected LandData m_landData = new LandData();
|
||||
protected Scene m_scene;
|
||||
@@ -135,6 +136,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
else
|
||||
LandData.GroupID = UUID.Zero;
|
||||
LandData.IsGroupOwned = is_group_owned;
|
||||
|
||||
m_scene.EventManager.OnFrame += OnFrame;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1199,6 +1202,17 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
#endregion
|
||||
|
||||
private void OnFrame()
|
||||
{
|
||||
m_expiryCounter++;
|
||||
|
||||
if (m_expiryCounter >= 50)
|
||||
{
|
||||
ExpireAccessList();
|
||||
m_expiryCounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void ExpireAccessList()
|
||||
{
|
||||
List<LandAccessEntry> delete = new List<LandAccessEntry>();
|
||||
@@ -1209,7 +1223,22 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
delete.Add(entry);
|
||||
}
|
||||
foreach (LandAccessEntry entry in delete)
|
||||
{
|
||||
LandData.ParcelAccessList.Remove(entry);
|
||||
ScenePresence presence;
|
||||
|
||||
if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent))
|
||||
{
|
||||
ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
|
||||
if (land.LandData.LocalID == LandData.LocalID)
|
||||
{
|
||||
Vector3 pos = m_scene.GetNearestAllowedPosition(presence, land);
|
||||
presence.TeleportWithMomentum(pos);
|
||||
presence.ControllingClient.SendAlertMessage("You have been ejected from this land");
|
||||
}
|
||||
}
|
||||
m_log.DebugFormat("[LAND]: Removing entry {0} because it has expired", entry.AgentID);
|
||||
}
|
||||
|
||||
if (delete.Count > 0)
|
||||
m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this);
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
protected bool m_Notice = false;
|
||||
protected IDialogModule m_DialogModule = null;
|
||||
protected string m_MarkerPath = String.Empty;
|
||||
private int[] m_CurrentAlerts = null;
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
@@ -141,6 +142,7 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
m_Message = message;
|
||||
m_Initiator = initiator;
|
||||
m_Notice = notice;
|
||||
m_CurrentAlerts = alerts;
|
||||
m_Alerts = new List<int>(alerts);
|
||||
m_Alerts.Sort();
|
||||
m_Alerts.Reverse();
|
||||
@@ -152,12 +154,12 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
return;
|
||||
}
|
||||
|
||||
int nextInterval = DoOneNotice();
|
||||
int nextInterval = DoOneNotice(true);
|
||||
|
||||
SetTimer(nextInterval);
|
||||
}
|
||||
|
||||
public int DoOneNotice()
|
||||
public int DoOneNotice(bool sendOut)
|
||||
{
|
||||
if (m_Alerts.Count == 0 || m_Alerts[0] == 0)
|
||||
{
|
||||
@@ -182,34 +184,37 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
|
||||
m_Alerts.RemoveAt(0);
|
||||
|
||||
int minutes = currentAlert / 60;
|
||||
string currentAlertString = String.Empty;
|
||||
if (minutes > 0)
|
||||
if (sendOut)
|
||||
{
|
||||
if (minutes == 1)
|
||||
currentAlertString += "1 minute";
|
||||
else
|
||||
currentAlertString += String.Format("{0} minutes", minutes);
|
||||
int minutes = currentAlert / 60;
|
||||
string currentAlertString = String.Empty;
|
||||
if (minutes > 0)
|
||||
{
|
||||
if (minutes == 1)
|
||||
currentAlertString += "1 minute";
|
||||
else
|
||||
currentAlertString += String.Format("{0} minutes", minutes);
|
||||
if ((currentAlert % 60) != 0)
|
||||
currentAlertString += " and ";
|
||||
}
|
||||
if ((currentAlert % 60) != 0)
|
||||
currentAlertString += " and ";
|
||||
}
|
||||
if ((currentAlert % 60) != 0)
|
||||
{
|
||||
int seconds = currentAlert % 60;
|
||||
if (seconds == 1)
|
||||
currentAlertString += "1 second";
|
||||
else
|
||||
currentAlertString += String.Format("{0} seconds", seconds);
|
||||
}
|
||||
{
|
||||
int seconds = currentAlert % 60;
|
||||
if (seconds == 1)
|
||||
currentAlertString += "1 second";
|
||||
else
|
||||
currentAlertString += String.Format("{0} seconds", seconds);
|
||||
}
|
||||
|
||||
string msg = String.Format(m_Message, currentAlertString);
|
||||
string msg = String.Format(m_Message, currentAlertString);
|
||||
|
||||
if (m_DialogModule != null && msg != String.Empty)
|
||||
{
|
||||
if (m_Notice)
|
||||
m_DialogModule.SendGeneralAlert(msg);
|
||||
else
|
||||
m_DialogModule.SendNotificationToUsersInRegion(m_Initiator, "System", msg);
|
||||
if (m_DialogModule != null && msg != String.Empty)
|
||||
{
|
||||
if (m_Notice)
|
||||
m_DialogModule.SendGeneralAlert(msg);
|
||||
else
|
||||
m_DialogModule.SendNotificationToUsersInRegion(m_Initiator, "System", msg);
|
||||
}
|
||||
}
|
||||
|
||||
return currentAlert - nextAlert;
|
||||
@@ -226,7 +231,25 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
|
||||
private void OnTimer(object source, ElapsedEventArgs e)
|
||||
{
|
||||
int nextInterval = DoOneNotice();
|
||||
int nextInterval = DoOneNotice(true);
|
||||
|
||||
SetTimer(nextInterval);
|
||||
}
|
||||
|
||||
public void DelayRestart(int seconds, string message)
|
||||
{
|
||||
if (m_CountdownTimer == null)
|
||||
return;
|
||||
|
||||
m_CountdownTimer.Stop();
|
||||
m_CountdownTimer = null;
|
||||
|
||||
m_Alerts = new List<int>(m_CurrentAlerts);
|
||||
m_Alerts.Add(seconds);
|
||||
m_Alerts.Sort();
|
||||
m_Alerts.Reverse();
|
||||
|
||||
int nextInterval = DoOneNotice(false);
|
||||
|
||||
SetTimer(nextInterval);
|
||||
}
|
||||
@@ -240,9 +263,9 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
if (m_DialogModule != null && message != String.Empty)
|
||||
m_DialogModule.SendGeneralAlert(message);
|
||||
}
|
||||
if (m_MarkerPath != String.Empty)
|
||||
File.Delete(Path.Combine(m_MarkerPath,
|
||||
m_Scene.RegionInfo.RegionID.ToString()));
|
||||
if (m_MarkerPath != String.Empty)
|
||||
File.Delete(Path.Combine(m_MarkerPath,
|
||||
m_Scene.RegionInfo.RegionID.ToString()));
|
||||
}
|
||||
|
||||
private void HandleRegionRestart(string module, string[] args)
|
||||
|
||||
Reference in New Issue
Block a user