* Moved all events except gridcomms and regioncomms over to Event Delegate instances to prevent event race conditions

afrisby-rexmerge
Teravus Ovares 2008-02-22 19:44:46 +00:00
parent ddffcb4673
commit 582964800c
7 changed files with 40 additions and 19 deletions

View File

@ -475,6 +475,7 @@ namespace OpenSim.Region.Capabilities
public class AssetUploader
{
public event UpLoadedAsset OnUpLoad;
private UpLoadedAsset handler001 = null;
private string uploaderPath = String.Empty;
private LLUUID newAssetID;
@ -528,10 +529,10 @@ namespace OpenSim.Region.Capabilities
{
SaveAssetToFile(m_assetName + ".jp2", data);
}
if (OnUpLoad != null)
handler001 = OnUpLoad;
if (handler001 != null)
{
OnUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType);
handler001(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType);
}
return res;
@ -568,6 +569,8 @@ namespace OpenSim.Region.Capabilities
{
public event UpdateItem OnUpLoad;
private UpdateItem handler001 = null;
private string uploaderPath = String.Empty;
private LLUUID inventoryItemID;
private BaseHttpServer httpListener;
@ -595,10 +598,10 @@ namespace OpenSim.Region.Capabilities
string res = String.Empty;
LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
LLUUID assetID = LLUUID.Zero;
if (OnUpLoad != null)
handler001 = OnUpLoad;
if (handler001 != null)
{
assetID = OnUpLoad(inv, data);
assetID = handler001(inv, data);
}
uploadComplete.new_asset = assetID.ToString();
@ -648,6 +651,8 @@ namespace OpenSim.Region.Capabilities
{
public event UpdateTaskScript OnUpLoad;
private UpdateTaskScript handler001 = null;
private string uploaderPath = String.Empty;
private LLUUID inventoryItemID;
private LLUUID primID;
@ -688,9 +693,10 @@ namespace OpenSim.Region.Capabilities
string res = String.Empty;
LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete();
if (OnUpLoad != null)
handler001 = OnUpLoad;
if (handler001 != null)
{
OnUpLoad(inventoryItemID, primID, isScriptRunning, data);
handler001(inventoryItemID, primID, isScriptRunning, data);
}
uploadComplete.item_id = inventoryItemID;

View File

@ -52,6 +52,8 @@ namespace OpenSim.Grid.UserServer
public event UserLoggedInAtLocation OnUserLoggedInAtLocation;
private UserLoggedInAtLocation handler001 = null;
public UserConfig m_config;
public UserLoginService(
@ -214,9 +216,10 @@ namespace OpenSim.Grid.UserServer
// Send
XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000);
if (OnUserLoggedInAtLocation != null)
handler001 = OnUserLoggedInAtLocation;
if (handler001 != null)
{
OnUserLoggedInAtLocation(theUser.UUID, theUser.currentAgent.sessionID, theUser.currentAgent.currentRegion, theUser.currentAgent.currentHandle, theUser.currentAgent.currentPos);
handler001(theUser.UUID, theUser.currentAgent.sessionID, theUser.currentAgent.currentRegion, theUser.currentAgent.currentHandle, theUser.currentAgent.currentPos);
}
}

View File

@ -47,6 +47,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Events
public event PhysicsCrash UnRecoverableError;
private PhysicsCrash handler001 = null;
#endregion
@ -715,9 +716,10 @@ namespace OpenSim.Region.Environment.Scenes
public void physicsBasedCrash()
{
if (UnRecoverableError != null)
handler001 = UnRecoverableError;
if (handler001 != null)
{
UnRecoverableError();
handler001();
}
}

View File

@ -160,7 +160,9 @@ namespace OpenSim.Region.Environment.Scenes
public virtual void Restart(int seconds)
{
m_log.Error("[REGION]: passing Restart Message up the namespace");
OnRestart(RegionInfo);
restart handler001 = OnRestart;
if (handler001 != null)
handler001(RegionInfo);
}
public virtual bool PresenceChildStatus(LLUUID avatarID)

View File

@ -54,6 +54,7 @@ namespace OpenSim.Region.Environment.Scenes
protected ulong m_regionHandle;
public event PrimCountTaintedDelegate OnPrimCountTainted;
private PrimCountTaintedDelegate handler001 = null;
/// <summary>
/// Signal whether the non-inventory attributes of any prims in the group have changed
@ -1525,9 +1526,10 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void TriggerTainted()
{
if (OnPrimCountTainted != null)
handler001 = OnPrimCountTainted;
if (handler001 != null)
{
OnPrimCountTainted();
handler001();
}
}

View File

@ -116,6 +116,8 @@ namespace OpenSim.Region.Environment.Scenes
private readonly List<ulong> m_knownChildRegions = new List<ulong>();
//neighbouring regions we have enabled a child agent in
private SignificantClientMovement handler001 = null; //OnSignificantClientMovement;
/// <summary>
/// Implemented Control Flags
@ -1482,9 +1484,10 @@ namespace OpenSim.Region.Environment.Scenes
if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.5)
{
posLastSignificantMove = AbsolutePosition;
if (OnSignificantClientMovement != null)
if (handler001 != null)
{
OnSignificantClientMovement(m_controllingClient);
handler001(m_controllingClient);
m_scene.NotifyMyCoarseLocationChange();
}
}

View File

@ -39,6 +39,8 @@ namespace OpenSim.Region.Environment.Scenes
public event SendStatResult OnSendStatsResult;
private SendStatResult handler001 = null;
private enum Stats : uint
{
TimeDilation = 0,
@ -245,9 +247,10 @@ namespace OpenSim.Region.Environment.Scenes
statpack.Stat = sb;
if (OnSendStatsResult != null)
handler001 = OnSendStatsResult;
if (handler001 != null)
{
OnSendStatsResult(statpack);
handler001(statpack);
}
resetvalues();
m_report.Enabled = true;