aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorTeravus Ovares2008-02-22 21:18:08 +0000
committerTeravus Ovares2008-02-22 21:18:08 +0000
commit9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf (patch)
tree6ab39fbdad1f04de5316afb5b80dda6f8b37a366 /OpenSim/Framework
parent* Downgrade texture exception to a warning. (diff)
downloadopensim-SC_OLD-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.zip
opensim-SC_OLD-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.tar.gz
opensim-SC_OLD-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.tar.bz2
opensim-SC_OLD-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.tar.xz
* Converted the last of the events to the private delegate instance method to avoid race conditions.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/RegionCommsListener.cs72
1 files changed, 47 insertions, 25 deletions
diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs
index 41577c6..35e2f26 100644
--- a/OpenSim/Framework/RegionCommsListener.cs
+++ b/OpenSim/Framework/RegionCommsListener.cs
@@ -45,8 +45,18 @@ namespace OpenSim.Framework
45 public event CloseAgentConnection OnCloseAgentConnection; 45 public event CloseAgentConnection OnCloseAgentConnection;
46 public event RegionUp OnRegionUp; 46 public event RegionUp OnRegionUp;
47 public event ChildAgentUpdate OnChildAgentUpdate; 47 public event ChildAgentUpdate OnChildAgentUpdate;
48
49 48
49 private ExpectUserDelegate handler001 = null; // OnExpectUser
50 private ExpectPrimDelegate handler002 = null; // OnExpectPrim;
51 private GenericCall2 handler003 = null; // OnExpectChildAgent;
52 private AgentCrossing handler004 = null; // OnAvatarCrossingIntoRegion;
53 private PrimCrossing handler005 = null; // OnPrimCrossingIntoRegion;
54 private UpdateNeighbours handler006 = null; // OnNeighboursUpdate;
55 private AcknowledgeAgentCross handler007 = null; // OnAcknowledgeAgentCrossed;
56 private AcknowledgePrimCross handler008 = null; // OnAcknowledgePrimCrossed;
57 private CloseAgentConnection handler009 = null; // OnCloseAgentConnection;
58 private RegionUp handler010 = null; // OnRegionUp;
59 private ChildAgentUpdate handler011 = null; // OnChildAgentUpdate;
50 60
51 public string debugRegionName = String.Empty; 61 public string debugRegionName = String.Empty;
52 62
@@ -58,9 +68,10 @@ namespace OpenSim.Framework
58 /// <returns></returns> 68 /// <returns></returns>
59 public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) 69 public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
60 { 70 {
61 if (OnExpectUser != null) 71 handler001 = OnExpectUser;
72 if (handler001 != null)
62 { 73 {
63 OnExpectUser(regionHandle, agent); 74 handler001(regionHandle, agent);
64 return true; 75 return true;
65 } 76 }
66 77
@@ -70,9 +81,10 @@ namespace OpenSim.Framework
70 81
71 public virtual bool TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData) 82 public virtual bool TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData)
72 { 83 {
73 if (OnExpectPrim != null) 84 handler002 = OnExpectPrim;
85 if (handler002 != null)
74 { 86 {
75 OnExpectPrim(regionHandle, primID, objData); 87 handler002(regionHandle, primID, objData);
76 return true; 88 return true;
77 } 89 }
78 return false; 90 return false;
@@ -80,9 +92,10 @@ namespace OpenSim.Framework
80 92
81 public virtual bool TriggerRegionUp(RegionInfo region) 93 public virtual bool TriggerRegionUp(RegionInfo region)
82 { 94 {
83 if (OnRegionUp != null) 95 handler010 = OnRegionUp;
96 if (handler010 != null)
84 { 97 {
85 OnRegionUp(region); 98 handler010(region);
86 return true; 99 return true;
87 } 100 }
88 return false; 101 return false;
@@ -90,9 +103,10 @@ namespace OpenSim.Framework
90 103
91 public virtual bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) 104 public virtual bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData)
92 { 105 {
93 if (OnChildAgentUpdate != null) 106 handler011 = OnChildAgentUpdate;
107 if (handler011 != null)
94 { 108 {
95 OnChildAgentUpdate(regionHandle, cAgentData); 109 handler011(regionHandle, cAgentData);
96 return true; 110 return true;
97 } 111 }
98 return false; 112 return false;
@@ -101,9 +115,10 @@ namespace OpenSim.Framework
101 public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, 115 public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position,
102 bool isFlying) 116 bool isFlying)
103 { 117 {
104 if (OnAvatarCrossingIntoRegion != null) 118 handler004 = OnAvatarCrossingIntoRegion;
119 if (handler004 != null)
105 { 120 {
106 OnAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying); 121 handler004(regionHandle, agentID, position, isFlying);
107 return true; 122 return true;
108 } 123 }
109 return false; 124 return false;
@@ -112,9 +127,10 @@ namespace OpenSim.Framework
112 public virtual bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, 127 public virtual bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position,
113 bool isPhysical) 128 bool isPhysical)
114 { 129 {
115 if (OnPrimCrossingIntoRegion != null) 130 handler005 = OnPrimCrossingIntoRegion;
131 if (handler005 != null)
116 { 132 {
117 OnPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical); 133 handler005(regionHandle, primID, position, isPhysical);
118 return true; 134 return true;
119 } 135 }
120 return false; 136 return false;
@@ -122,9 +138,10 @@ namespace OpenSim.Framework
122 138
123 public virtual bool TriggerAcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID) 139 public virtual bool TriggerAcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID)
124 { 140 {
125 if (OnAcknowledgeAgentCrossed != null) 141 handler007 = OnAcknowledgeAgentCrossed;
142 if (handler007 != null)
126 { 143 {
127 OnAcknowledgeAgentCrossed(regionHandle, agentID); 144 handler007(regionHandle, agentID);
128 return true; 145 return true;
129 } 146 }
130 return false; 147 return false;
@@ -132,9 +149,10 @@ namespace OpenSim.Framework
132 149
133 public virtual bool TriggerAcknowledgePrimCrossed(ulong regionHandle, LLUUID primID) 150 public virtual bool TriggerAcknowledgePrimCrossed(ulong regionHandle, LLUUID primID)
134 { 151 {
135 if (OnAcknowledgePrimCrossed != null) 152 handler008 = OnAcknowledgePrimCrossed;
153 if (handler008 != null)
136 { 154 {
137 OnAcknowledgePrimCrossed(regionHandle, primID); 155 handler008(regionHandle, primID);
138 return true; 156 return true;
139 } 157 }
140 return false; 158 return false;
@@ -142,9 +160,10 @@ namespace OpenSim.Framework
142 160
143 public virtual bool TriggerCloseAgentConnection(ulong regionHandle, LLUUID agentID) 161 public virtual bool TriggerCloseAgentConnection(ulong regionHandle, LLUUID agentID)
144 { 162 {
145 if (OnCloseAgentConnection != null) 163 handler009 = OnCloseAgentConnection;
164 if (handler009 != null)
146 { 165 {
147 OnCloseAgentConnection(regionHandle, agentID); 166 handler009(regionHandle, agentID);
148 return true; 167 return true;
149 168
150 } 169 }
@@ -158,9 +177,10 @@ namespace OpenSim.Framework
158 /// <returns></returns> 177 /// <returns></returns>
159 public virtual bool TriggerExpectChildAgent() 178 public virtual bool TriggerExpectChildAgent()
160 { 179 {
161 if (OnExpectChildAgent != null) 180 handler003 = OnExpectChildAgent;
181 if (handler003 != null)
162 { 182 {
163 OnExpectChildAgent(); 183 handler003();
164 return true; 184 return true;
165 } 185 }
166 186
@@ -175,9 +195,10 @@ namespace OpenSim.Framework
175 /// <returns></returns> 195 /// <returns></returns>
176 public virtual bool TriggerOnNeighboursUpdate(List<RegionInfo> neighbours) 196 public virtual bool TriggerOnNeighboursUpdate(List<RegionInfo> neighbours)
177 { 197 {
178 if (OnNeighboursUpdate != null) 198 handler006 = OnNeighboursUpdate;
199 if (handler006 != null)
179 { 200 {
180 OnNeighboursUpdate(neighbours); 201 handler006(neighbours);
181 return true; 202 return true;
182 } 203 }
183 204
@@ -186,8 +207,9 @@ namespace OpenSim.Framework
186 207
187 public bool TriggerTellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) 208 public bool TriggerTellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID)
188 { 209 {
189 if (OnCloseAgentConnection != null) 210 handler009 = OnCloseAgentConnection;
190 return OnCloseAgentConnection(regionHandle, agentID); 211 if (handler009 != null)
212 return handler009(regionHandle, agentID);
191 213
192 return false; 214 return false;
193 } 215 }