aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCharles Krinke2008-05-26 16:16:48 +0000
committerCharles Krinke2008-05-26 16:16:48 +0000
commited717ec181ef9946fbb5182d59e9f051ae1478ac (patch)
treef5357655e40c618338756937fecd5092fbb1c656
parentdisabling m_log again. (diff)
downloadopensim-SC_OLD-ed717ec181ef9946fbb5182d59e9f051ae1478ac.zip
opensim-SC_OLD-ed717ec181ef9946fbb5182d59e9f051ae1478ac.tar.gz
opensim-SC_OLD-ed717ec181ef9946fbb5182d59e9f051ae1478ac.tar.bz2
opensim-SC_OLD-ed717ec181ef9946fbb5182d59e9f051ae1478ac.tar.xz
Thank you kindly, Melanie for a patch for script reset
that creates the event handler chain ready to hook by script engines
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/EventManager.cs12
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs1
7 files changed, 37 insertions, 0 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 7fb8091..48b4eb3 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -640,6 +640,7 @@ namespace OpenSim.Framework
640 public delegate void EstateBlueBoxMessageRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message); 640 public delegate void EstateBlueBoxMessageRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message);
641 public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics); 641 public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics);
642 public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey); 642 public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey);
643 public delegate void ScriptReset(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID);
643 644
644 645
645 public interface IClientAPI 646 public interface IClientAPI
@@ -836,6 +837,7 @@ namespace OpenSim.Framework
836 event UUIDNameRequest OnUUIDGroupNameRequest; 837 event UUIDNameRequest OnUUIDGroupNameRequest;
837 838
838 event RequestObjectPropertiesFamily OnObjectGroupRequest; 839 event RequestObjectPropertiesFamily OnObjectGroupRequest;
840 event ScriptReset OnScriptReset;
839 841
840 [Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")] 842 [Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")]
841 void OutPacket(Packet newPack, ThrottleOutPacketType packType); 843 void OutPacket(Packet newPack, ThrottleOutPacketType packType);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index e27a003..c9a6b84 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -254,6 +254,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
254 private UUIDNameRequest handlerUUIDGroupNameRequest = null; 254 private UUIDNameRequest handlerUUIDGroupNameRequest = null;
255 255
256 private RequestObjectPropertiesFamily handlerObjectGroupRequest = null; 256 private RequestObjectPropertiesFamily handlerObjectGroupRequest = null;
257 private ScriptReset handlerScriptReset = null;
257 258
258 /* Properties */ 259 /* Properties */
259 260
@@ -859,6 +860,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
859 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; 860 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
860 public event EstateDebugRegionRequest OnEstateDebugRegionRequest; 861 public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
861 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; 862 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
863 public event ScriptReset OnScriptReset;
862 864
863 #region Scene/Avatar to Client 865 #region Scene/Avatar to Client
864 866
@@ -5797,6 +5799,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5797 // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client 5799 // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client
5798 //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet"); 5800 //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet");
5799 break; 5801 break;
5802 case PacketType.ScriptReset:
5803 ScriptResetPacket scriptResetPacket = (ScriptResetPacket)Pack;
5804 handlerScriptReset = OnScriptReset;
5805 if (handlerScriptReset != null)
5806 {
5807 handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID);
5808 }
5809 break;
5800 case PacketType.ViewerStats: 5810 case PacketType.ViewerStats:
5801 // TODO: handle this packet 5811 // TODO: handle this packet
5802 m_log.Warn("[CLIENT]: unhandled ViewerStats packet"); 5812 m_log.Warn("[CLIENT]: unhandled ViewerStats packet");
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index 09069a9..bad089d 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -288,6 +288,8 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
288 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; 288 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
289 public event EstateDebugRegionRequest OnEstateDebugRegionRequest; 289 public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
290 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; 290 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
291 public event ScriptReset OnScriptReset;
292
291#pragma warning restore 67 293#pragma warning restore 67
292 #endregion 294 #endregion
293 295
diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs
index 6cecb6d..e77bebc 100644
--- a/OpenSim/Region/Environment/Scenes/EventManager.cs
+++ b/OpenSim/Region/Environment/Scenes/EventManager.cs
@@ -85,11 +85,13 @@ namespace OpenSim.Region.Environment.Scenes
85 85
86 public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient); 86 public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient);
87 public delegate void ObjectDeGrabDelegate(uint localID, IClientAPI remoteClient); 87 public delegate void ObjectDeGrabDelegate(uint localID, IClientAPI remoteClient);
88 public delegate void ScriptResetDelegate(uint localID, LLUUID itemID);
88 89
89 public delegate void OnPermissionErrorDelegate(LLUUID user, string reason); 90 public delegate void OnPermissionErrorDelegate(LLUUID user, string reason);
90 91
91 public event ObjectGrabDelegate OnObjectGrab; 92 public event ObjectGrabDelegate OnObjectGrab;
92 public event ObjectDeGrabDelegate OnObjectDeGrab; 93 public event ObjectDeGrabDelegate OnObjectDeGrab;
94 public event ScriptResetDelegate OnScriptReset;
93 95
94 public event OnPermissionErrorDelegate OnPermissionError; 96 public event OnPermissionErrorDelegate OnPermissionError;
95 97
@@ -310,6 +312,7 @@ namespace OpenSim.Region.Environment.Scenes
310 private OnShutdownDelegate handlerShutdown = null; //OnShutdown; 312 private OnShutdownDelegate handlerShutdown = null; //OnShutdown;
311 private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab; 313 private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab;
312 private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab; 314 private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab;
315 private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset
313 private NewRezScript handlerRezScript = null; //OnRezScript; 316 private NewRezScript handlerRezScript = null; //OnRezScript;
314 private RemoveScript handlerRemoveScript = null; //OnRemoveScript; 317 private RemoveScript handlerRemoveScript = null; //OnRemoveScript;
315 private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove; 318 private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove;
@@ -484,6 +487,15 @@ namespace OpenSim.Region.Environment.Scenes
484 } 487 }
485 } 488 }
486 489
490 public void TriggerScriptReset(uint localID, LLUUID itemID)
491 {
492 handlerScriptReset = OnScriptReset;
493 if (handlerScriptReset != null)
494 {
495 handlerScriptReset(localID, itemID);
496 }
497 }
498
487 public void TriggerRezScript(uint localID, LLUUID itemID, string script) 499 public void TriggerRezScript(uint localID, LLUUID itemID, string script)
488 { 500 {
489 handlerRezScript = OnRezScript; 501 handlerRezScript = OnRezScript;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 8419399..41bd2d3 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -288,5 +288,14 @@ namespace OpenSim.Region.Environment.Scenes
288 } 288 }
289 client.SendAvatarPickerReply(agent_data, data_args); 289 client.SendAvatarPickerReply(agent_data, data_args);
290 } 290 }
291
292 public void ProcessScriptReset(IClientAPI remoteClient, LLUUID objectID,
293 LLUUID itemID)
294 {
295 SceneObjectPart part=GetSceneObjectPart(objectID);
296 if(part == null)
297 return;
298 EventManager.TriggerScriptReset(part.LocalId, itemID);
299 }
291 } 300 }
292} 301}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 4d380f9..c9f23af 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1704,6 +1704,7 @@ namespace OpenSim.Region.Environment.Scenes
1704 client.OnUndo += m_innerScene.HandleUndo; 1704 client.OnUndo += m_innerScene.HandleUndo;
1705 client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate; 1705 client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate;
1706 client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; 1706 client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
1707 client.OnScriptReset += ProcessScriptReset;
1707 1708
1708 // EventManager.TriggerOnNewClient(client); 1709 // EventManager.TriggerOnNewClient(client);
1709 } 1710 }
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 0410e1c..4407462 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -193,6 +193,7 @@ namespace OpenSim.Region.Examples.SimpleModule
193 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; 193 public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
194 public event EstateDebugRegionRequest OnEstateDebugRegionRequest; 194 public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
195 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; 195 public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
196 public event ScriptReset OnScriptReset;
196 197
197 198
198#pragma warning restore 67 199#pragma warning restore 67