* Rex merge, SceneEvents.cs did not merge smooth

afrisby-3
Adam Frisby 2008-02-23 03:57:50 +00:00
parent 26d477e32b
commit 7fdd23d249
1 changed files with 472 additions and 367 deletions

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
@ -126,13 +126,28 @@ namespace OpenSim.Region.Environment.Scenes
public event NewGridInstantMessage OnGridInstantMessageToGroupsModule; public event NewGridInstantMessage OnGridInstantMessageToGroupsModule;
public delegate void ClientClosed(LLUUID clientID);
// rex, new events // rex, new events
public delegate void OnAddEntityDelegate(uint localID); public delegate void OnAddEntityDelegate(uint localID);
public event OnAddEntityDelegate OnAddEntity; public event OnAddEntityDelegate OnAddEntity;
public event ClientClosed OnClientClosed;
public delegate void OnRemoveEntityDelegate(uint localID); public delegate void OnRemoveEntityDelegate(uint localID);
public event OnRemoveEntityDelegate OnRemoveEntity; public event OnRemoveEntityDelegate OnRemoveEntity;
public delegate void ScriptChangedEvent(uint localID, uint change);
public event ScriptChangedEvent OnScriptChangedEvent;
public class MoneyTransferArgs : System.EventArgs
{
public LLUUID sender;
public LLUUID reciever;
// Always false. The SL protocol sucks.
public bool authenticated = false;
public int amount;
public delegate void OnPythonScriptCommandDelegate(string vCommand); public delegate void OnPythonScriptCommandDelegate(string vCommand);
public event OnPythonScriptCommandDelegate OnPythonScriptCommand; public event OnPythonScriptCommandDelegate OnPythonScriptCommand;
@ -146,154 +161,234 @@ namespace OpenSim.Region.Environment.Scenes
public event OnPrimVolumeCollisionDelegate OnPrimVolumeCollision; public event OnPrimVolumeCollisionDelegate OnPrimVolumeCollision;
// rex-end // rex-end
public int transactiontype;
public string description;
public MoneyTransferArgs(LLUUID asender, LLUUID areciever, int aamount, int atransactiontype, string adescription) {
sender = asender;
reciever = areciever;
amount = aamount;
transactiontype = atransactiontype;
description = adescription;
}
}
public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e);
public event MoneyTransferEvent OnMoneyTransfer;
/* Designated Event Deletage Instances */
private ScriptChangedEvent handler001 = null; //OnScriptChangedEvent;
private ClientMovement handler002 = null; //OnClientMovement;
private OnPermissionErrorDelegate handler003 = null; //OnPermissionError;
private OnPluginConsoleDelegate handler004 = null; //OnPluginConsole;
private OnFrameDelegate handler005 = null; //OnFrame;
private OnNewClientDelegate handler006 = null; //OnNewClient;
private OnNewPresenceDelegate handler007 = null; //OnNewPresence;
private OnRemovePresenceDelegate handler008 = null; //OnRemovePresence;
private OnBackupDelegate handler009 = null; //OnBackup;
private OnParcelPrimCountUpdateDelegate handler010 = null; //OnParcelPrimCountUpdate;
private MoneyTransferEvent handler011 = null; //OnMoneyTransfer;
private OnParcelPrimCountAddDelegate handler012 = null; //OnParcelPrimCountAdd;
private OnShutdownDelegate handler013 = null; //OnShutdown;
private ObjectGrabDelegate handler014 = null; //OnObjectGrab;
private NewRezScript handler015 = null; //OnRezScript;
private RemoveScript handler016 = null; //OnRemoveScript;
private SceneGroupMoved handler017 = null; //OnSceneGroupMove;
private SceneGroupGrabed handler018 = null; //OnSceneGroupGrab;
private LandObjectAdded handler020 = null; //OnLandObjectAdded;
private LandObjectRemoved handler021 = null; //OnLandObjectRemoved;
private AvatarEnteringNewParcel handler022 = null; //OnAvatarEnteringNewParcel;
private NewGridInstantMessage handler023 = null; //OnGridInstantMessageToIMModule;
private NewGridInstantMessage handler024 = null; //OnGridInstantMessageToFriendsModule;
private ClientClosed handler025 = null; //OnClientClosed;
public void TriggerOnScriptChangedEvent(uint localID, uint change)
{
handler001 = OnScriptChangedEvent;
if (handler001 != null)
handler001(localID, change);
}
public void TriggerOnClientMovement(ScenePresence avatar) public void TriggerOnClientMovement(ScenePresence avatar)
{ {
if (OnClientMovement != null) handler002 = OnClientMovement;
OnClientMovement(avatar); if (handler002 != null)
handler002(avatar);
} }
public void TriggerPermissionError(LLUUID user, string reason) public void TriggerPermissionError(LLUUID user, string reason)
{ {
if (OnPermissionError != null) handler003 = OnPermissionError;
OnPermissionError(user, reason); if (handler003 != null)
handler003(user, reason);
} }
public void TriggerOnPluginConsole(string[] args) public void TriggerOnPluginConsole(string[] args)
{ {
if (OnPluginConsole != null) handler004 = OnPluginConsole;
OnPluginConsole(args); if (handler004 != null)
handler004(args);
} }
public void TriggerOnFrame() public void TriggerOnFrame()
{ {
if (OnFrame != null) handler005 = OnFrame;
if (handler005 != null)
{ {
OnFrame(); handler005();
} }
} }
public void TriggerOnNewClient(IClientAPI client) public void TriggerOnNewClient(IClientAPI client)
{ {
if (OnNewClient != null) handler006 = OnNewClient;
OnNewClient(client); if (handler006 != null)
handler006(client);
} }
public void TriggerOnNewPresence(ScenePresence presence) public void TriggerOnNewPresence(ScenePresence presence)
{ {
if (OnNewPresence != null) handler007 = OnNewPresence;
OnNewPresence(presence); if (handler007 != null)
handler007(presence);
} }
public void TriggerOnRemovePresence(LLUUID agentId) public void TriggerOnRemovePresence(LLUUID agentId)
{ {
if (OnRemovePresence != null) handler008 = OnRemovePresence;
if (handler008 != null)
{ {
OnRemovePresence(agentId); handler008(agentId);
} }
} }
public void TriggerOnBackup(IRegionDataStore dstore) public void TriggerOnBackup(IRegionDataStore dstore)
{ {
if (OnBackup != null) handler009 = OnBackup;
if (handler009 != null)
{ {
OnBackup(dstore); handler009(dstore);
} }
} }
public void TriggerParcelPrimCountUpdate() public void TriggerParcelPrimCountUpdate()
{ {
/* handler010 = OnParcelPrimCountUpdate;
* Removed by Adam to prevent some exceptions, temporary. if (handler010 != null)
* */
if (OnParcelPrimCountUpdate != null)
{ {
OnParcelPrimCountUpdate(); handler010();
}
} }
public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e)
{
handler011 = OnMoneyTransfer;
if (handler011 != null)
{
handler011(sender, e);
} }
}
public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
{ {
if (OnParcelPrimCountAdd != null) handler012 = OnParcelPrimCountAdd;
if (handler012 != null)
{ {
OnParcelPrimCountAdd(obj); handler012(obj);
} }
} }
public void TriggerShutdown() public void TriggerShutdown()
{ {
if (OnShutdown != null) handler013 = OnShutdown;
OnShutdown(); if (handler013 != null)
handler013();
} }
public void TriggerObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) public void TriggerObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
{ {
if (OnObjectGrab != null) handler014 = OnObjectGrab;
if (handler014 != null)
{ {
OnObjectGrab(localID, offsetPos, remoteClient); handler014(localID, offsetPos, remoteClient);
} }
} }
public void TriggerRezScript(uint localID, LLUUID itemID, string script) public void TriggerRezScript(uint localID, LLUUID itemID, string script)
{ {
if (OnRezScript != null) handler015 = OnRezScript;
if (handler015 != null)
{ {
OnRezScript(localID, itemID, script); handler015(localID, itemID, script);
} }
} }
public void TriggerRemoveScript(uint localID, LLUUID itemID) public void TriggerRemoveScript(uint localID, LLUUID itemID)
{ {
if (OnRemoveScript != null) handler016 = OnRemoveScript;
if (handler016 != null)
{ {
OnRemoveScript(localID, itemID); handler016(localID, itemID);
} }
} }
public bool TriggerGroupMove(LLUUID groupID, LLVector3 delta) public bool TriggerGroupMove(LLUUID groupID, LLVector3 delta)
{ {
if (OnSceneGroupMove != null) handler017 = OnSceneGroupMove;
if (handler017 != null)
{ {
return OnSceneGroupMove(groupID, delta); return handler017(groupID, delta);
} }
return true; return true;
} }
public void TriggerGroupGrab(LLUUID groupID, LLVector3 offset, LLUUID userID) public void TriggerGroupGrab(LLUUID groupID, LLVector3 offset, LLUUID userID)
{ {
if (OnSceneGroupGrab != null) handler018 = OnSceneGroupGrab;
if (handler018 != null)
{ {
OnSceneGroupGrab(groupID, offset, userID); handler018(groupID, offset, userID);
} }
} }
public void TriggerLandObjectAdded(Land newParcel, LLUUID regionID) public void TriggerLandObjectAdded(Land newParcel, LLUUID regionID)
{ {
if (OnLandObjectAdded != null) handler020 = OnLandObjectAdded;
if (handler020 != null)
{ {
OnLandObjectAdded(newParcel, regionID); handler020(newParcel, regionID);
} }
} }
public void TriggerLandObjectRemoved(LLUUID globalID) public void TriggerLandObjectRemoved(LLUUID globalID)
{ {
if (OnLandObjectRemoved != null) handler021 = OnLandObjectRemoved;
if (handler021 != null)
{ {
OnLandObjectRemoved(globalID); handler021(globalID);
} }
} }
public void TriggerLandObjectUpdated(uint localParcelID, Land newParcel) public void TriggerLandObjectUpdated(uint localParcelID, Land newParcel)
{ {
//triggerLandObjectRemoved(localParcelID); //triggerLandObjectRemoved(localParcelID);
TriggerLandObjectAdded(newParcel, newParcel.m_scene.RegionInfo.RegionID); TriggerLandObjectAdded(newParcel, newParcel.m_scene.RegionInfo.RegionID);
} }
public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, LLUUID regionID) public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, LLUUID regionID)
{ {
if (OnAvatarEnteringNewParcel != null) handler022 = OnAvatarEnteringNewParcel;
if (handler022 != null)
{ {
OnAvatarEnteringNewParcel(avatar, localLandID, regionID); handler022(avatar, localLandID, regionID);
} }
} }
@ -304,22 +399,32 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if ((whichModule & InstantMessageReceiver.IMModule) != 0) if ((whichModule & InstantMessageReceiver.IMModule) != 0)
{ {
handler023 = OnGridInstantMessageToIMModule;
if (OnGridInstantMessageToIMModule != null) if (handler023 != null)
{ {
OnGridInstantMessageToIMModule(message); handler023(message);
} }
} }
if ((whichModule & InstantMessageReceiver.FriendsModule) != 0) if ((whichModule & InstantMessageReceiver.FriendsModule) != 0)
{ {
if (OnGridInstantMessageToFriendsModule != null) handler024 = OnGridInstantMessageToFriendsModule;
if (handler024 != null)
{ {
OnGridInstantMessageToFriendsModule(message); handler024(message);
} }
} }
} }
public void TriggerClientClosed(LLUUID ClientID)
{
handler025 = OnClientClosed;
if (handler025 != null)
{
handler025(ClientID);
}
}
// rex, new function // rex, new function
public void TriggerOnAddEntity(uint localID) public void TriggerOnAddEntity(uint localID)
{ {