diff options
author | Teravus Ovares | 2008-02-22 21:18:08 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-22 21:18:08 +0000 |
commit | 9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf (patch) | |
tree | 6ab39fbdad1f04de5316afb5b80dda6f8b37a366 /OpenSim/Region/Environment | |
parent | * Downgrade texture exception to a warning. (diff) | |
download | opensim-SC-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.zip opensim-SC-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.tar.gz opensim-SC-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.tar.bz2 opensim-SC-9b675a6888f3c68dacf8cd3b7310a955c1f3dbaf.tar.xz |
* Converted the last of the events to the private delegate instance method to avoid race conditions.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index e51438d..8678f7a 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -57,8 +57,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
57 | public event RegionUp OnRegionUp; | 57 | public event RegionUp OnRegionUp; |
58 | public event ChildAgentUpdate OnChildAgentUpdate; | 58 | public event ChildAgentUpdate OnChildAgentUpdate; |
59 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; | 59 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; |
60 | |||
61 | 60 | ||
61 | private AgentCrossing handler001 = null; // OnAvatarCrossingIntoRegion; | ||
62 | private ExpectUserDelegate handler002 = null; // OnExpectUser; | ||
63 | private ExpectPrimDelegate handler003 = null; // OnExpectPrim; | ||
64 | private CloseAgentConnection handler004 = null; // OnCloseAgentConnection; | ||
65 | private PrimCrossing handler005 = null; // OnPrimCrossingIntoRegion; | ||
66 | private RegionUp handler006 = null; // OnRegionUp; | ||
67 | private ChildAgentUpdate handler007 = null; // OnChildAgentUpdate; | ||
68 | private RemoveKnownRegionsFromAvatarList handler008 = null; // OnRemoveKnownRegionFromAvatar; | ||
62 | 69 | ||
63 | public KillObjectDelegate KillObject; | 70 | public KillObjectDelegate KillObject; |
64 | public string _debugRegionName = String.Empty; | 71 | public string _debugRegionName = String.Empty; |
@@ -125,27 +132,30 @@ namespace OpenSim.Region.Environment.Scenes | |||
125 | /// | 132 | /// |
126 | protected void NewUserConnection(ulong regionHandle, AgentCircuitData agent) | 133 | protected void NewUserConnection(ulong regionHandle, AgentCircuitData agent) |
127 | { | 134 | { |
128 | if (OnExpectUser != null) | 135 | handler002 = OnExpectUser; |
136 | if (handler002 != null) | ||
129 | { | 137 | { |
130 | //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname); | 138 | //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname); |
131 | OnExpectUser(regionHandle, agent); | 139 | handler002(regionHandle, agent); |
132 | } | 140 | } |
133 | } | 141 | } |
134 | 142 | ||
135 | protected bool newRegionUp(RegionInfo region) | 143 | protected bool newRegionUp(RegionInfo region) |
136 | { | 144 | { |
137 | if (OnRegionUp != null) | 145 | handler006 = OnRegionUp; |
146 | if (handler006 != null) | ||
138 | { | 147 | { |
139 | //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: newRegionUp Fired for User:" + region.RegionName); | 148 | //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: newRegionUp Fired for User:" + region.RegionName); |
140 | OnRegionUp(region); | 149 | handler006(region); |
141 | } | 150 | } |
142 | return true; | 151 | return true; |
143 | } | 152 | } |
144 | 153 | ||
145 | protected bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) | 154 | protected bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) |
146 | { | 155 | { |
147 | if (OnChildAgentUpdate != null) | 156 | handler007 = OnChildAgentUpdate; |
148 | OnChildAgentUpdate(regionHandle, cAgentData); | 157 | if (handler007 != null) |
158 | handler007(regionHandle, cAgentData); | ||
149 | 159 | ||
150 | 160 | ||
151 | return true; | 161 | return true; |
@@ -153,36 +163,39 @@ namespace OpenSim.Region.Environment.Scenes | |||
153 | 163 | ||
154 | protected void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) | 164 | protected void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) |
155 | { | 165 | { |
156 | if (OnAvatarCrossingIntoRegion != null) | 166 | handler001 = OnAvatarCrossingIntoRegion; |
167 | if (handler001 != null) | ||
157 | { | 168 | { |
158 | OnAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying); | 169 | handler001(regionHandle, agentID, position, isFlying); |
159 | } | 170 | } |
160 | } | 171 | } |
161 | 172 | ||
162 | protected void IncomingPrimCrossing(ulong regionHandle, LLUUID primID, String objXMLData) | 173 | protected void IncomingPrimCrossing(ulong regionHandle, LLUUID primID, String objXMLData) |
163 | { | 174 | { |
164 | if (OnExpectPrim != null) | 175 | handler003 = OnExpectPrim; |
176 | if (handler003 != null) | ||
165 | { | 177 | { |
166 | OnExpectPrim(regionHandle, primID, objXMLData); | 178 | handler003(regionHandle, primID, objXMLData); |
167 | } | 179 | } |
168 | 180 | ||
169 | } | 181 | } |
170 | 182 | ||
171 | protected void PrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical) | 183 | protected void PrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical) |
172 | { | 184 | { |
173 | if (OnPrimCrossingIntoRegion != null) | 185 | handler005 = OnPrimCrossingIntoRegion; |
186 | if (handler005 != null) | ||
174 | { | 187 | { |
175 | OnPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical); | 188 | handler005(regionHandle, primID, position, isPhysical); |
176 | } | 189 | } |
177 | } | 190 | } |
178 | 191 | ||
179 | protected bool CloseConnection(ulong regionHandle, LLUUID agentID) | 192 | protected bool CloseConnection(ulong regionHandle, LLUUID agentID) |
180 | { | 193 | { |
181 | m_log.Info("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID.ToString()); | 194 | m_log.Info("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID.ToString()); |
182 | 195 | handler004 = OnCloseAgentConnection; | |
183 | if (OnCloseAgentConnection != null) | 196 | if (handler004 != null) |
184 | { | 197 | { |
185 | return OnCloseAgentConnection(regionHandle, agentID); | 198 | return handler004(regionHandle, agentID); |
186 | } | 199 | } |
187 | return false; | 200 | return false; |
188 | } | 201 | } |
@@ -424,9 +437,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
424 | // We remove the list of known regions from the agent's known region list through an event | 437 | // We remove the list of known regions from the agent's known region list through an event |
425 | // to scene, because, if an agent logged of, it's likely that there will be no scene presence | 438 | // to scene, because, if an agent logged of, it's likely that there will be no scene presence |
426 | // by the time we get to this part of the method. | 439 | // by the time we get to this part of the method. |
427 | if (OnRemoveKnownRegionFromAvatar != null) | 440 | handler008 = OnRemoveKnownRegionFromAvatar; |
441 | if (handler008 != null) | ||
428 | { | 442 | { |
429 | OnRemoveKnownRegionFromAvatar(agentID,regionlst); | 443 | handler008(agentID, regionlst); |
430 | } | 444 | } |
431 | } | 445 | } |
432 | 446 | ||