Thank you kindly, Melanie for a patch for script reset

that creates the event handler chain ready to hook by script engines
0.6.0-stable
Charles Krinke 2008-05-26 16:16:48 +00:00
parent 30a9469757
commit ed717ec181
7 changed files with 37 additions and 0 deletions

View File

@ -640,6 +640,7 @@ namespace OpenSim.Framework
public delegate void EstateBlueBoxMessageRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message); public delegate void EstateBlueBoxMessageRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message);
public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics); public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics);
public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey); public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey);
public delegate void ScriptReset(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID);
public interface IClientAPI public interface IClientAPI
@ -836,6 +837,7 @@ namespace OpenSim.Framework
event UUIDNameRequest OnUUIDGroupNameRequest; event UUIDNameRequest OnUUIDGroupNameRequest;
event RequestObjectPropertiesFamily OnObjectGroupRequest; event RequestObjectPropertiesFamily OnObjectGroupRequest;
event ScriptReset OnScriptReset;
[Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")] [Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")]
void OutPacket(Packet newPack, ThrottleOutPacketType packType); void OutPacket(Packet newPack, ThrottleOutPacketType packType);

View File

@ -254,6 +254,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private UUIDNameRequest handlerUUIDGroupNameRequest = null; private UUIDNameRequest handlerUUIDGroupNameRequest = null;
private RequestObjectPropertiesFamily handlerObjectGroupRequest = null; private RequestObjectPropertiesFamily handlerObjectGroupRequest = null;
private ScriptReset handlerScriptReset = null;
/* Properties */ /* Properties */
@ -859,6 +860,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
public event EstateDebugRegionRequest OnEstateDebugRegionRequest; public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
public event ScriptReset OnScriptReset;
#region Scene/Avatar to Client #region Scene/Avatar to Client
@ -5797,6 +5799,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client
//m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet"); //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet");
break; break;
case PacketType.ScriptReset:
ScriptResetPacket scriptResetPacket = (ScriptResetPacket)Pack;
handlerScriptReset = OnScriptReset;
if (handlerScriptReset != null)
{
handlerScriptReset(this, scriptResetPacket.Script.ObjectID, scriptResetPacket.Script.ItemID);
}
break;
case PacketType.ViewerStats: case PacketType.ViewerStats:
// TODO: handle this packet // TODO: handle this packet
m_log.Warn("[CLIENT]: unhandled ViewerStats packet"); m_log.Warn("[CLIENT]: unhandled ViewerStats packet");

View File

@ -288,6 +288,8 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
public event EstateDebugRegionRequest OnEstateDebugRegionRequest; public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
public event ScriptReset OnScriptReset;
#pragma warning restore 67 #pragma warning restore 67
#endregion #endregion

View File

@ -85,11 +85,13 @@ namespace OpenSim.Region.Environment.Scenes
public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient); public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient);
public delegate void ObjectDeGrabDelegate(uint localID, IClientAPI remoteClient); public delegate void ObjectDeGrabDelegate(uint localID, IClientAPI remoteClient);
public delegate void ScriptResetDelegate(uint localID, LLUUID itemID);
public delegate void OnPermissionErrorDelegate(LLUUID user, string reason); public delegate void OnPermissionErrorDelegate(LLUUID user, string reason);
public event ObjectGrabDelegate OnObjectGrab; public event ObjectGrabDelegate OnObjectGrab;
public event ObjectDeGrabDelegate OnObjectDeGrab; public event ObjectDeGrabDelegate OnObjectDeGrab;
public event ScriptResetDelegate OnScriptReset;
public event OnPermissionErrorDelegate OnPermissionError; public event OnPermissionErrorDelegate OnPermissionError;
@ -310,6 +312,7 @@ namespace OpenSim.Region.Environment.Scenes
private OnShutdownDelegate handlerShutdown = null; //OnShutdown; private OnShutdownDelegate handlerShutdown = null; //OnShutdown;
private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab; private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab;
private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab; private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab;
private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset
private NewRezScript handlerRezScript = null; //OnRezScript; private NewRezScript handlerRezScript = null; //OnRezScript;
private RemoveScript handlerRemoveScript = null; //OnRemoveScript; private RemoveScript handlerRemoveScript = null; //OnRemoveScript;
private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove; private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove;
@ -484,6 +487,15 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
public void TriggerScriptReset(uint localID, LLUUID itemID)
{
handlerScriptReset = OnScriptReset;
if (handlerScriptReset != null)
{
handlerScriptReset(localID, itemID);
}
}
public void TriggerRezScript(uint localID, LLUUID itemID, string script) public void TriggerRezScript(uint localID, LLUUID itemID, string script)
{ {
handlerRezScript = OnRezScript; handlerRezScript = OnRezScript;

View File

@ -288,5 +288,14 @@ namespace OpenSim.Region.Environment.Scenes
} }
client.SendAvatarPickerReply(agent_data, data_args); client.SendAvatarPickerReply(agent_data, data_args);
} }
public void ProcessScriptReset(IClientAPI remoteClient, LLUUID objectID,
LLUUID itemID)
{
SceneObjectPart part=GetSceneObjectPart(objectID);
if(part == null)
return;
EventManager.TriggerScriptReset(part.LocalId, itemID);
}
} }
} }

View File

@ -1704,6 +1704,7 @@ namespace OpenSim.Region.Environment.Scenes
client.OnUndo += m_innerScene.HandleUndo; client.OnUndo += m_innerScene.HandleUndo;
client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate; client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate;
client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
client.OnScriptReset += ProcessScriptReset;
// EventManager.TriggerOnNewClient(client); // EventManager.TriggerOnNewClient(client);
} }

View File

@ -193,6 +193,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
public event EstateDebugRegionRequest OnEstateDebugRegionRequest; public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
public event ScriptReset OnScriptReset;
#pragma warning restore 67 #pragma warning restore 67