diff options
author | Teravus Ovares | 2008-01-04 02:24:05 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-01-04 02:24:05 +0000 |
commit | 960b7e93b1fd48f240a11343716dc0be7e7b782d (patch) | |
tree | bfea99b29cc98b8420cf3847f23ae692a29c4a05 /OpenSim/Region | |
parent | * Fixing a the time clock issue on Sim Restart messages. See Mantis 287 (diff) | |
download | opensim-SC_OLD-960b7e93b1fd48f240a11343716dc0be7e7b782d.zip opensim-SC_OLD-960b7e93b1fd48f240a11343716dc0be7e7b782d.tar.gz opensim-SC_OLD-960b7e93b1fd48f240a11343716dc0be7e7b782d.tar.bz2 opensim-SC_OLD-960b7e93b1fd48f240a11343716dc0be7e7b782d.tar.xz |
* 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.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 35 | ||||
-rw-r--r-- | OpenSim/Region/Environment/EstateManager.cs | 32 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 91 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneBase.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 3 |
5 files changed, 133 insertions, 33 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 7bdbb67..c2c514e 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -134,6 +134,14 @@ namespace OpenSim.Region.ClientStack | |||
134 | } | 134 | } |
135 | 135 | ||
136 | /// <summary> | 136 | /// <summary> |
137 | /// This is a utility method used by single states to not duplicate kicks and blue card of death messages. | ||
138 | /// </summary> | ||
139 | public bool ChildAgentStatus() | ||
140 | { | ||
141 | return m_scene.PresenceChildStatus(AgentId); | ||
142 | } | ||
143 | |||
144 | /// <summary> | ||
137 | /// First name of the agent/avatar represented by the client | 145 | /// First name of the agent/avatar represented by the client |
138 | /// </summary> | 146 | /// </summary> |
139 | public string FirstName | 147 | public string FirstName |
@@ -257,13 +265,16 @@ namespace OpenSim.Region.ClientStack | |||
257 | 265 | ||
258 | public void Kick(string message) | 266 | public void Kick(string message) |
259 | { | 267 | { |
260 | KickUserPacket kupack = (KickUserPacket) PacketPool.Instance.GetPacket(PacketType.KickUser); | 268 | if (!ChildAgentStatus()) |
261 | kupack.UserInfo.AgentID = AgentId; | 269 | { |
262 | kupack.UserInfo.SessionID = SessionId; | 270 | KickUserPacket kupack = (KickUserPacket)PacketPool.Instance.GetPacket(PacketType.KickUser); |
263 | kupack.TargetBlock.TargetIP = (uint) 0; | 271 | kupack.UserInfo.AgentID = AgentId; |
264 | kupack.TargetBlock.TargetPort = (ushort) 0; | 272 | kupack.UserInfo.SessionID = SessionId; |
265 | kupack.UserInfo.Reason = Helpers.StringToField(message); | 273 | kupack.TargetBlock.TargetIP = (uint)0; |
266 | OutPacket(kupack, ThrottleOutPacketType.Task); | 274 | kupack.TargetBlock.TargetPort = (ushort)0; |
275 | kupack.UserInfo.Reason = Helpers.StringToField(message); | ||
276 | OutPacket(kupack, ThrottleOutPacketType.Task); | ||
277 | } | ||
267 | } | 278 | } |
268 | 279 | ||
269 | public void Stop() | 280 | public void Stop() |
@@ -2786,7 +2797,7 @@ namespace OpenSim.Region.ClientStack | |||
2786 | { | 2797 | { |
2787 | ObjectAddPacket addPacket = (ObjectAddPacket) Pack; | 2798 | ObjectAddPacket addPacket = (ObjectAddPacket) Pack; |
2788 | PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); | 2799 | PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); |
2789 | MainLog.Instance.Verbose("REZData", addPacket.ToString()); | 2800 | // MainLog.Instance.Verbose("REZData", addPacket.ToString()); |
2790 | //BypassRaycast: 1 | 2801 | //BypassRaycast: 1 |
2791 | //RayStart: <69.79469, 158.2652, 98.40343> | 2802 | //RayStart: <69.79469, 158.2652, 98.40343> |
2792 | //RayEnd: <61.97724, 141.995, 92.58341> | 2803 | //RayEnd: <61.97724, 141.995, 92.58341> |
@@ -3585,6 +3596,14 @@ namespace OpenSim.Region.ClientStack | |||
3585 | return shape; | 3596 | return shape; |
3586 | } | 3597 | } |
3587 | 3598 | ||
3599 | public void SendBlueBoxMessage(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) | ||
3600 | { | ||
3601 | if (!ChildAgentStatus()) | ||
3602 | SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)1, (uint)Util.UnixTimeSinceEpoch()); | ||
3603 | |||
3604 | //SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)21,(uint) Util.UnixTimeSinceEpoch()); | ||
3605 | } | ||
3606 | |||
3588 | public void SendLogoutPacket() | 3607 | public void SendLogoutPacket() |
3589 | { | 3608 | { |
3590 | LogoutReplyPacket logReply = (LogoutReplyPacket) PacketPool.Instance.GetPacket(PacketType.LogoutReply); | 3609 | LogoutReplyPacket logReply = (LogoutReplyPacket) PacketPool.Instance.GetPacket(PacketType.LogoutReply); |
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs index 1367cb3..64b9d78 100644 --- a/OpenSim/Region/Environment/EstateManager.cs +++ b/OpenSim/Region/Environment/EstateManager.cs | |||
@@ -198,18 +198,48 @@ namespace OpenSim.Region.Environment | |||
198 | EstateChangeCovenant(packet); | 198 | EstateChangeCovenant(packet); |
199 | } | 199 | } |
200 | break; | 200 | break; |
201 | case "estateaccessdelta": | 201 | case "estateaccessdelta": // Estate access delta manages the banlist and allow list too. |
202 | if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId)) | 202 | if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId)) |
203 | { | 203 | { |
204 | estateAccessDelta(remote_client, packet); | 204 | estateAccessDelta(remote_client, packet); |
205 | } | 205 | } |
206 | break; | 206 | break; |
207 | case "simulatormessage": | ||
208 | if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId)) | ||
209 | { | ||
210 | SendSimulatorBlueBoxMessage(remote_client, packet); | ||
211 | } | ||
212 | break; | ||
213 | case "instantmessage": | ||
214 | if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId)) | ||
215 | { | ||
216 | SendEstateBlueBoxMessage(remote_client, packet); | ||
217 | } | ||
218 | break; | ||
207 | default: | 219 | default: |
208 | MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); | 220 | MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); |
209 | break; | 221 | break; |
210 | } | 222 | } |
211 | } | 223 | } |
212 | 224 | ||
225 | private void SendSimulatorBlueBoxMessage(IClientAPI remote_client, EstateOwnerMessagePacket packet) | ||
226 | { | ||
227 | LLUUID invoice = packet.MethodData.Invoice; | ||
228 | LLUUID SenderID = new LLUUID(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter)); | ||
229 | string SenderName = Helpers.FieldToUTF8String(packet.ParamList[3].Parameter); | ||
230 | string Message = Helpers.FieldToUTF8String(packet.ParamList[4].Parameter); | ||
231 | m_scene.SendRegionMessageFromEstateTools(SenderID, packet.AgentData.SessionID, SenderName, Message); | ||
232 | |||
233 | } | ||
234 | private void SendEstateBlueBoxMessage(IClientAPI remote_client, EstateOwnerMessagePacket packet) | ||
235 | { | ||
236 | LLUUID invoice = packet.MethodData.Invoice; | ||
237 | LLUUID SenderID = packet.AgentData.AgentID; | ||
238 | string SenderName = Helpers.FieldToUTF8String(packet.ParamList[0].Parameter); | ||
239 | string Message = Helpers.FieldToUTF8String(packet.ParamList[1].Parameter); | ||
240 | m_scene.SendEstateMessageFromEstateTools(SenderID, packet.AgentData.SessionID, SenderName, Message); | ||
241 | |||
242 | } | ||
213 | private void sendDetailedEstateData(IClientAPI remote_client, EstateOwnerMessagePacket packet) | 243 | private void sendDetailedEstateData(IClientAPI remote_client, EstateOwnerMessagePacket packet) |
214 | { | 244 | { |
215 | 245 | ||
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 | |||
389 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); | 389 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); |
390 | MainLog.Instance.Error("REGION", "Restarting Region in " + (seconds/60) + " minutes"); | 390 | MainLog.Instance.Error("REGION", "Restarting Region in " + (seconds/60) + " minutes"); |
391 | m_restartTimer.Start(); | 391 | m_restartTimer.Start(); |
392 | SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes"); | 392 | SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), "", RegionInfo.RegionName + ": Restarting in 2 Minutes"); |
393 | //SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes"); | ||
393 | } | 394 | } |
394 | } | 395 | } |
395 | 396 | ||
@@ -403,8 +404,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
403 | if (m_RestartTimerCounter <= m_incrementsof15seconds) | 404 | if (m_RestartTimerCounter <= m_incrementsof15seconds) |
404 | { | 405 | { |
405 | if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) | 406 | if (m_RestartTimerCounter == 4 || m_RestartTimerCounter == 6 || m_RestartTimerCounter == 7) |
406 | SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) + | 407 | SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), "", RegionInfo.RegionName + ": Restarting in " + |
407 | " seconds"); | 408 | ((8 - m_RestartTimerCounter) * 15) + " seconds"); |
409 | |||
410 | // SendGeneralAlert(RegionInfo.RegionName + ": Restarting in " + ((8 - m_RestartTimerCounter)*15) + | ||
411 | //" seconds"); | ||
408 | } | 412 | } |
409 | else | 413 | else |
410 | { | 414 | { |
@@ -1813,13 +1817,54 @@ namespace OpenSim.Region.Environment.Scenes | |||
1813 | } | 1817 | } |
1814 | 1818 | ||
1815 | /// <summary> | 1819 | /// <summary> |
1816 | /// | 1820 | /// Sends a Big Blue Box message on the upper right of the screen to the client |
1821 | /// for all agents in the region | ||
1817 | /// </summary> | 1822 | /// </summary> |
1818 | /// <param name="godID"></param> | 1823 | /// <param name="FromAvatarID">The person sending the message</param> |
1819 | /// <param name="sessionID"></param> | 1824 | /// <param name="fromSessionID">The session of the person sending the message</param> |
1820 | /// <param name="agentID"></param> | 1825 | /// <param name="FromAvatarName">The name of the person doing the sending</param> |
1821 | /// <param name="kickflags"></param> | 1826 | /// <param name="Message">The Message being sent to the user</param> |
1822 | /// <param name="reason"></param> | 1827 | public void SendRegionMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) |
1828 | { | ||
1829 | |||
1830 | List<ScenePresence> presenceList = GetScenePresences(); | ||
1831 | |||
1832 | foreach (ScenePresence presence in presenceList) | ||
1833 | { | ||
1834 | if (!presence.IsChildAgent) | ||
1835 | presence.ControllingClient.SendBlueBoxMessage(FromAvatarID, fromSessionID, FromAvatarName, Message); | ||
1836 | } | ||
1837 | } | ||
1838 | |||
1839 | /// <summary> | ||
1840 | /// Sends a Big Blue Box message on the upper right of the screen to the client | ||
1841 | /// for all agents in the estate | ||
1842 | /// </summary> | ||
1843 | /// <param name="FromAvatarID">The person sending the message</param> | ||
1844 | /// <param name="fromSessionID">The session of the person sending the message</param> | ||
1845 | /// <param name="FromAvatarName">The name of the person doing the sending</param> | ||
1846 | /// <param name="Message">The Message being sent to the user</param> | ||
1847 | public void SendEstateMessageFromEstateTools(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) | ||
1848 | { | ||
1849 | |||
1850 | ClientManager.ForEachClient(delegate(IClientAPI controller) | ||
1851 | { | ||
1852 | controller.SendBlueBoxMessage(FromAvatarID, fromSessionID, FromAvatarName, Message); | ||
1853 | } | ||
1854 | ); | ||
1855 | } | ||
1856 | |||
1857 | /// <summary> | ||
1858 | /// Kicks User specified from the simulator. This logs them off of the grid | ||
1859 | /// If the client gets the UUID: 44e87126e7944ded05b37c42da3d5cdb it assumes | ||
1860 | /// that you're kicking it even if the avatar's UUID isn't the UUID that the | ||
1861 | /// agent is assigned | ||
1862 | /// </summary> | ||
1863 | /// <param name="godID">The person doing the kicking</param> | ||
1864 | /// <param name="sessionID">The session of the person doing the kicking</param> | ||
1865 | /// <param name="agentID">the person that is being kicked</param> | ||
1866 | /// <param name="kickflags">This isn't used apparently</param> | ||
1867 | /// <param name="reason">The message to send to the user after it's been turned into a field</param> | ||
1823 | public void handleGodlikeKickUser(LLUUID godID, LLUUID sessionID, LLUUID agentID, uint kickflags, byte[] reason) | 1868 | public void handleGodlikeKickUser(LLUUID godID, LLUUID sessionID, LLUUID agentID, uint kickflags, byte[] reason) |
1824 | { | 1869 | { |
1825 | // For some reason the client sends this seemingly hard coded UUID for kicking everyone. Dun-know. | 1870 | // 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 | |||
1832 | { | 1877 | { |
1833 | ClientManager.ForEachClient(delegate(IClientAPI controller) | 1878 | ClientManager.ForEachClient(delegate(IClientAPI controller) |
1834 | { | 1879 | { |
1835 | ScenePresence p = GetScenePresence(controller.AgentId); | 1880 | if (controller.AgentId != godID) |
1836 | bool childagent = !p.Equals(null) && p.IsChildAgent; | ||
1837 | if (controller.AgentId != godID && !childagent) | ||
1838 | // Do we really want to kick the initiator of this madness? | ||
1839 | { | ||
1840 | controller.Kick(Helpers.FieldToUTF8String(reason)); | 1881 | controller.Kick(Helpers.FieldToUTF8String(reason)); |
1841 | 1882 | ||
1842 | if (childagent) | 1883 | |
1843 | { | 1884 | |
1844 | m_innerScene.removeUserCount(false); | ||
1845 | } | ||
1846 | else | ||
1847 | { | ||
1848 | m_innerScene.removeUserCount(true); | ||
1849 | } | ||
1850 | } | ||
1851 | } | 1885 | } |
1852 | ); | 1886 | ); |
1853 | // This is a bit crude. It seems the client will be null before it actually stops the thread | 1887 | // 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 | |||
2200 | } | 2234 | } |
2201 | 2235 | ||
2202 | /// <summary> | 2236 | /// <summary> |
2237 | /// Request an Avatar's Child Status - used by ClientView when a 'kick everyone' or 'estate message' occurs | ||
2238 | /// </summary> | ||
2239 | /// <param name="avatarID">AvatarID to lookup</param> | ||
2240 | /// <returns></returns> | ||
2241 | public bool PresenceChildStatus(LLUUID avatarID) | ||
2242 | { | ||
2243 | ScenePresence cp = GetScenePresence(avatarID); | ||
2244 | return cp.IsChildAgent; | ||
2245 | } | ||
2246 | |||
2247 | /// <summary> | ||
2203 | /// | 2248 | /// |
2204 | /// </summary> | 2249 | /// </summary> |
2205 | /// <param name="action"></param> | 2250 | /// <param name="action"></param> |
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 | |||
157 | OnRestart(RegionInfo); | 157 | OnRestart(RegionInfo); |
158 | } | 158 | } |
159 | 159 | ||
160 | 160 | public virtual bool PresenceChildStatus(LLUUID avatarID) | |
161 | { | ||
162 | return false; | ||
163 | } | ||
161 | public abstract bool OtherRegionUp(RegionInfo thisRegion); | 164 | public abstract bool OtherRegionUp(RegionInfo thisRegion); |
162 | 165 | ||
163 | #endregion | 166 | #endregion |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index b6db4cc..809a13b 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -493,7 +493,10 @@ namespace SimpleApp | |||
493 | get { return m_circuitCode; } | 493 | get { return m_circuitCode; } |
494 | set { m_circuitCode = value; } | 494 | set { m_circuitCode = value; } |
495 | } | 495 | } |
496 | public void SendBlueBoxMessage(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) | ||
497 | { | ||
496 | 498 | ||
499 | } | ||
497 | public void SendLogoutPacket() | 500 | public void SendLogoutPacket() |
498 | { | 501 | { |
499 | } | 502 | } |