diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 9df1e00cf6..1c38011a8c 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -298,6 +298,7 @@ namespace OpenSim.Framework public delegate void EstateBlueBoxMessageRequest(IClientAPI remoteClient, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message); public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, UUID invoice, UUID senderID, bool scripted, bool collisionEvents, bool physics); public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, UUID invoice, UUID senderID, UUID prey); + public delegate void EstateTeleportAllUsersHomeRequest(IClientAPI remoteClient, UUID invoice, UUID senderID); public delegate void RegionHandleRequest(IClientAPI remoteClient, UUID regionID); public delegate void ParcelInfoRequest(IClientAPI remoteClient, UUID parcelID); @@ -518,6 +519,7 @@ namespace OpenSim.Framework event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; event EstateDebugRegionRequest OnEstateDebugRegionRequest; event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; + event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest; event UUIDNameRequest OnUUIDGroupNameRequest; event RegionHandleRequest OnRegionHandleRequest; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index c8923e0752..72d2a76c6d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -965,6 +965,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; public event EstateDebugRegionRequest OnEstateDebugRegionRequest; public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; + public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest; public event RegionHandleRequest OnRegionHandleRequest; public event ParcelInfoRequest OnParcelInfoRequest; public event ScriptReset OnScriptReset; @@ -5877,6 +5878,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP OnEstateTeleportOneUserHomeRequest(this, invoice, SenderID, Prey); } break; + case "teleporthomeallusers": + if (((Scene)m_scene).ExternalChecks.ExternalChecksCanIssueEstateCommand(this.AgentId, false)) + { + UUID invoice = messagePacket.MethodData.Invoice; + UUID SenderID = messagePacket.AgentData.AgentID; + OnEstateTeleportAllUsersHomeRequest(this, invoice, SenderID); + } + break; case "colliders": handlerLandStatRequest = OnLandStatRequest; if (handlerLandStatRequest != null) diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 3dddc2b0fe..616132b15a 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs @@ -383,6 +383,28 @@ namespace OpenSim.Region.Environment.Modules.World.Estate } } + private void handleEstateTeleportAllUsersHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID) + { + // Get a fresh list that will not change as people get teleported away + List prescences = m_scene.GetScenePresences(); + foreach (ScenePresence p in prescences) + { + if (p.UUID != senderID) + { + // make sure they are still there, we could be working down a long list + ScenePresence s = m_scene.GetScenePresence(p.UUID); + if (s != null) + { + // Also make sure they are actually in the region + if (!s.IsChildAgent) + { + m_scene.TeleportClientHome(s.UUID, s.ControllingClient); + } + } + } + } + } + private void HandleRegionInfoRequest(IClientAPI remote_client) { @@ -723,6 +745,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage; client.OnEstateDebugRegionRequest += handleEstateDebugRegionRequest; client.OnEstateTeleportOneUserHomeRequest += handleEstateTeleportOneUserHomeRequest; + client.OnEstateTeleportAllUsersHomeRequest += handleEstateTeleportAllUsersHomeRequest; client.OnRegionInfoRequest += HandleRegionInfoRequest; client.OnEstateCovenantRequest += HandleEstateCovenantRequest; diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 8c76884618..9476571677 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -305,6 +305,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; public event EstateDebugRegionRequest OnEstateDebugRegionRequest; public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; + public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest; public event EstateChangeInfo OnEstateChangeInfo; public event ScriptReset OnScriptReset; public event GetScriptRunning OnGetScriptRunning; diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 92a96f91bf..19673181ba 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -201,6 +201,7 @@ namespace OpenSim.Region.Examples.SimpleModule public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; public event EstateDebugRegionRequest OnEstateDebugRegionRequest; public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; + public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest; public event ScriptReset OnScriptReset; public event GetScriptRunning OnGetScriptRunning; public event SetScriptRunning OnSetScriptRunning;