From 960b7e93b1fd48f240a11343716dc0be7e7b782d Mon Sep 17 00:00:00 2001
From: Teravus Ovares
Date: Fri, 4 Jan 2008 02:24:05 +0000
Subject: * Added the ability for estate managers to use the magic secondlife
blue card of death to send out region and estate messages. * Switched over
Region Restart notices to the magic secondlife blue card of death method.
---
OpenSim/Region/Environment/Scenes/Scene.cs | 91 +++++++++++++++++++-------
OpenSim/Region/Environment/Scenes/SceneBase.cs | 5 +-
2 files changed, 72 insertions(+), 24 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 8032502..0a8df98 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -389,7 +389,8 @@ namespace OpenSim.Region.Environment.Scenes
m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
MainLog.Instance.Error("REGION", "Restarting Region in " + (seconds/60) + " minutes");
m_restartTimer.Start();
- SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes");
+ SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), "", RegionInfo.RegionName + ": Restarting in 2 Minutes");
+ //SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes");
}
}
@@ -403,8 +404,11 @@ namespace OpenSim.Region.Environment.Scenes
if (m_RestartTimerCounter <= m_incrementsof15seconds)
{
if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7)
- SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) +
- " seconds");
+ SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), "", RegionInfo.RegionName + ": Restarting in " +
+ ((8 - m_RestartTimerCounter) * 15) + " seconds");
+
+ // SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) +
+ //" seconds");
}
else
{
@@ -1813,13 +1817,54 @@ namespace OpenSim.Region.Environment.Scenes
}
///
- ///
+ /// Sends a Big Blue Box message on the upper right of the screen to the client
+ /// for all agents in the region
///
- ///
- ///
- ///
- ///
- ///
+ /// The person sending the message
+ /// The session of the person sending the message
+ /// The name of the person doing the sending
+ /// The Message being sent to the user
+ public void SendRegionMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message)
+ {
+
+ List presenceList = GetScenePresences();
+
+ foreach (ScenePresence presence in presenceList)
+ {
+ if (!presence.IsChildAgent)
+ presence.ControllingClient.SendBlueBoxMessage(FromAvatarID, fromSessionID, FromAvatarName, Message);
+ }
+ }
+
+ ///
+ /// Sends a Big Blue Box message on the upper right of the screen to the client
+ /// for all agents in the estate
+ ///
+ /// The person sending the message
+ /// The session of the person sending the message
+ /// The name of the person doing the sending
+ /// The Message being sent to the user
+ public void SendEstateMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message)
+ {
+
+ ClientManager.ForEachClient(delegate(IClientAPI controller)
+ {
+ controller.SendBlueBoxMessage(FromAvatarID, fromSessionID, FromAvatarName, Message);
+ }
+ );
+ }
+
+ ///
+ /// Kicks User specified from the simulator. This logs them off of the grid
+ /// If the client gets the UUID: 44e87126e7944ded05b37c42da3d5cdb it assumes
+ /// that you're kicking it even if the avatar's UUID isn't the UUID that the
+ /// agent is assigned
+ ///
+ /// The person doing the kicking
+ /// The session of the person doing the kicking
+ /// the person that is being kicked
+ /// This isn't used apparently
+ /// The message to send to the user after it's been turned into a field
public void handleGodlikeKickUser(LLUUID godID, LLUUID sessionID, LLUUID agentID, uint kickflags, byte[] reason)
{
// For some reason the client sends this seemingly hard coded UUID for kicking everyone. Dun-know.
@@ -1832,22 +1877,11 @@ namespace OpenSim.Region.Environment.Scenes
{
ClientManager.ForEachClient(delegate(IClientAPI controller)
{
- ScenePresence p = GetScenePresence(controller.AgentId);
- bool childagent = !p.Equals(null) && p.IsChildAgent;
- if (controller.AgentId != godID && !childagent)
- // Do we really want to kick the initiator of this madness?
- {
+ if (controller.AgentId != godID)
controller.Kick(Helpers.FieldToUTF8String(reason));
- if (childagent)
- {
- m_innerScene.removeUserCount(false);
- }
- else
- {
- m_innerScene.removeUserCount(true);
- }
- }
+
+
}
);
// This is a bit crude. It seems the client will be null before it actually stops the thread
@@ -2200,6 +2234,17 @@ namespace OpenSim.Region.Environment.Scenes
}
///
+ /// Request an Avatar's Child Status - used by ClientView when a 'kick everyone' or 'estate message' occurs
+ ///
+ /// AvatarID to lookup
+ ///
+ public bool PresenceChildStatus(LLUUID avatarID)
+ {
+ ScenePresence cp = GetScenePresence(avatarID);
+ return cp.IsChildAgent;
+ }
+
+ ///
///
///
///
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index fe8f8da..bf8bedc 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -157,7 +157,10 @@ namespace OpenSim.Region.Environment.Scenes
OnRestart(RegionInfo);
}
-
+ public virtual bool PresenceChildStatus(LLUUID avatarID)
+ {
+ return false;
+ }
public abstract bool OtherRegionUp(RegionInfo thisRegion);
#endregion
--
cgit v1.1