aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-11-12 19:12:33 +0000
committerJustin Clarke Casey2008-11-12 19:12:33 +0000
commitb636bb0f9ec50252164da6e94f2f7b71af8afe6b (patch)
tree64487d9680429e3ffc708e03dd33f8d5522cf802
parentChange HTTP server backlog/acceptors to 64, per Adam Z (diff)
downloadopensim-SC-b636bb0f9ec50252164da6e94f2f7b71af8afe6b.zip
opensim-SC-b636bb0f9ec50252164da6e94f2f7b71af8afe6b.tar.gz
opensim-SC-b636bb0f9ec50252164da6e94f2f7b71af8afe6b.tar.bz2
opensim-SC-b636bb0f9ec50252164da6e94f2f7b71af8afe6b.tar.xz
* Stop the pointless passing of a scene's own region handler back to it in region comms
* Some scene methods ignored it, others did nothing if the region handler given did not match their own (which would never be triggered)
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IRegionCommsListener.cs18
-rw-r--r--OpenSim/Framework/RegionCommsListener.cs45
-rw-r--r--OpenSim/Region/Application/OpenSim.cs2
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs49
-rw-r--r--OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs178
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs39
7 files changed, 167 insertions, 166 deletions
diff --git a/OpenSim/Framework/IRegionCommsListener.cs b/OpenSim/Framework/IRegionCommsListener.cs
index 2f0c113..5b5e456 100644
--- a/OpenSim/Framework/IRegionCommsListener.cs
+++ b/OpenSim/Framework/IRegionCommsListener.cs
@@ -30,27 +30,27 @@ using OpenMetaverse;
30 30
31namespace OpenSim.Framework 31namespace OpenSim.Framework
32{ 32{
33 public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); 33 public delegate void ExpectUserDelegate(AgentCircuitData agent);
34 34
35 public delegate bool ExpectPrimDelegate(ulong regionHandle, UUID primID, string objData, int XMLMethod); 35 public delegate bool ExpectPrimDelegate(UUID primID, string objData, int XMLMethod);
36 36
37 public delegate void UpdateNeighbours(List<RegionInfo> neighbours); 37 public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
38 38
39 public delegate void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying); 39 public delegate void AgentCrossing(UUID agentID, Vector3 position, bool isFlying);
40 40
41 public delegate void PrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isPhysical); 41 public delegate void PrimCrossing(UUID primID, Vector3 position, bool isPhysical);
42 42
43 public delegate void AcknowledgeAgentCross(ulong regionHandle, UUID agentID); 43 public delegate void AcknowledgeAgentCross(UUID agentID);
44 44
45 public delegate void AcknowledgePrimCross(ulong regionHandle, UUID PrimID); 45 public delegate void AcknowledgePrimCross(UUID PrimID);
46 46
47 public delegate bool CloseAgentConnection(ulong regionHandle, UUID agentID); 47 public delegate bool CloseAgentConnection(UUID agentID);
48 48
49 public delegate bool RegionUp(RegionInfo region); 49 public delegate bool RegionUp(RegionInfo region);
50 50
51 public delegate bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData); 51 public delegate bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData);
52 52
53 public delegate void LogOffUser(ulong regionHandle, UUID agentID, UUID regionSecret, string message); 53 public delegate void LogOffUser(UUID agentID, UUID regionSecret, string message);
54 54
55 public delegate LandData GetLandData(uint x, uint y); 55 public delegate LandData GetLandData(uint x, uint y);
56 56
diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs
index 5d3c2fe..b45d7b9 100644
--- a/OpenSim/Framework/RegionCommsListener.cs
+++ b/OpenSim/Framework/RegionCommsListener.cs
@@ -31,6 +31,9 @@ using OpenMetaverse;
31 31
32namespace OpenSim.Framework 32namespace OpenSim.Framework
33{ 33{
34 /// <summary>
35 /// Sandbox mode region comms listener. There is one of these per region
36 /// </summary>
34 public class RegionCommsListener : IRegionCommsListener 37 public class RegionCommsListener : IRegionCommsListener
35 { 38 {
36 public string debugRegionName = String.Empty; 39 public string debugRegionName = String.Empty;
@@ -71,12 +74,12 @@ namespace OpenSim.Framework
71 /// </summary> 74 /// </summary>
72 /// <param name="agent"></param> 75 /// <param name="agent"></param>
73 /// <returns></returns> 76 /// <returns></returns>
74 public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) 77 public virtual bool TriggerExpectUser(AgentCircuitData agent)
75 { 78 {
76 handlerExpectUser = OnExpectUser; 79 handlerExpectUser = OnExpectUser;
77 if (handlerExpectUser != null) 80 if (handlerExpectUser != null)
78 { 81 {
79 handlerExpectUser(regionHandle, agent); 82 handlerExpectUser(agent);
80 return true; 83 return true;
81 } 84 }
82 85
@@ -84,23 +87,22 @@ namespace OpenSim.Framework
84 } 87 }
85 88
86 // From User Server 89 // From User Server
87 public virtual void TriggerLogOffUser(ulong regionHandle, UUID agentID, UUID RegionSecret, string message) 90 public virtual void TriggerLogOffUser(UUID agentID, UUID RegionSecret, string message)
88 { 91 {
89 handlerLogOffUser = OnLogOffUser; 92 handlerLogOffUser = OnLogOffUser;
90 if (handlerLogOffUser != null) 93 if (handlerLogOffUser != null)
91 { 94 {
92 handlerLogOffUser(regionHandle, agentID, RegionSecret, message); 95 handlerLogOffUser(agentID, RegionSecret, message);
93 } 96 }
94 97
95 } 98 }
96 99
97 100 public virtual bool TriggerExpectPrim(UUID primID, string objData, int XMLMethod)
98 public virtual bool TriggerExpectPrim(ulong regionHandle, UUID primID, string objData, int XMLMethod)
99 { 101 {
100 handlerExpectPrim = OnExpectPrim; 102 handlerExpectPrim = OnExpectPrim;
101 if (handlerExpectPrim != null) 103 if (handlerExpectPrim != null)
102 { 104 {
103 handlerExpectPrim(regionHandle, primID, objData, XMLMethod); 105 handlerExpectPrim(primID, objData, XMLMethod);
104 return true; 106 return true;
105 } 107 }
106 return false; 108 return false;
@@ -117,69 +119,68 @@ namespace OpenSim.Framework
117 return false; 119 return false;
118 } 120 }
119 121
120 public virtual bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) 122 public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData)
121 { 123 {
122 handlerChildAgentUpdate = OnChildAgentUpdate; 124 handlerChildAgentUpdate = OnChildAgentUpdate;
123 if (handlerChildAgentUpdate != null) 125 if (handlerChildAgentUpdate != null)
124 { 126 {
125 handlerChildAgentUpdate(regionHandle, cAgentData); 127 handlerChildAgentUpdate(cAgentData);
126 return true; 128 return true;
127 } 129 }
128 return false; 130 return false;
129 } 131 }
130 132
131 public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, UUID agentID, Vector3 position, 133 public virtual bool TriggerExpectAvatarCrossing(UUID agentID, Vector3 position, bool isFlying)
132 bool isFlying)
133 { 134 {
134 handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; 135 handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion;
135 if (handlerAvatarCrossingIntoRegion != null) 136 if (handlerAvatarCrossingIntoRegion != null)
136 { 137 {
137 handlerAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying); 138 handlerAvatarCrossingIntoRegion(agentID, position, isFlying);
138 return true; 139 return true;
139 } 140 }
140 return false; 141 return false;
141 } 142 }
142 143
143 public virtual bool TriggerExpectPrimCrossing(ulong regionHandle, UUID primID, Vector3 position, 144 public virtual bool TriggerExpectPrimCrossing(UUID primID, Vector3 position,
144 bool isPhysical) 145 bool isPhysical)
145 { 146 {
146 handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; 147 handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
147 if (handlerPrimCrossingIntoRegion != null) 148 if (handlerPrimCrossingIntoRegion != null)
148 { 149 {
149 handlerPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical); 150 handlerPrimCrossingIntoRegion(primID, position, isPhysical);
150 return true; 151 return true;
151 } 152 }
152 return false; 153 return false;
153 } 154 }
154 155
155 public virtual bool TriggerAcknowledgeAgentCrossed(ulong regionHandle, UUID agentID) 156 public virtual bool TriggerAcknowledgeAgentCrossed(UUID agentID)
156 { 157 {
157 handlerAcknowledgeAgentCrossed = OnAcknowledgeAgentCrossed; 158 handlerAcknowledgeAgentCrossed = OnAcknowledgeAgentCrossed;
158 if (handlerAcknowledgeAgentCrossed != null) 159 if (handlerAcknowledgeAgentCrossed != null)
159 { 160 {
160 handlerAcknowledgeAgentCrossed(regionHandle, agentID); 161 handlerAcknowledgeAgentCrossed(agentID);
161 return true; 162 return true;
162 } 163 }
163 return false; 164 return false;
164 } 165 }
165 166
166 public virtual bool TriggerAcknowledgePrimCrossed(ulong regionHandle, UUID primID) 167 public virtual bool TriggerAcknowledgePrimCrossed(UUID primID)
167 { 168 {
168 handlerAcknowledgePrimCrossed = OnAcknowledgePrimCrossed; 169 handlerAcknowledgePrimCrossed = OnAcknowledgePrimCrossed;
169 if (handlerAcknowledgePrimCrossed != null) 170 if (handlerAcknowledgePrimCrossed != null)
170 { 171 {
171 handlerAcknowledgePrimCrossed(regionHandle, primID); 172 handlerAcknowledgePrimCrossed(primID);
172 return true; 173 return true;
173 } 174 }
174 return false; 175 return false;
175 } 176 }
176 177
177 public virtual bool TriggerCloseAgentConnection(ulong regionHandle, UUID agentID) 178 public virtual bool TriggerCloseAgentConnection(UUID agentID)
178 { 179 {
179 handlerCloseAgentConnection = OnCloseAgentConnection; 180 handlerCloseAgentConnection = OnCloseAgentConnection;
180 if (handlerCloseAgentConnection != null) 181 if (handlerCloseAgentConnection != null)
181 { 182 {
182 handlerCloseAgentConnection(regionHandle, agentID); 183 handlerCloseAgentConnection(agentID);
183 return true; 184 return true;
184 } 185 }
185 return false; 186 return false;
@@ -220,11 +221,11 @@ namespace OpenSim.Framework
220 return false; 221 return false;
221 } 222 }
222 223
223 public bool TriggerTellRegionToCloseChildConnection(ulong regionHandle, UUID agentID) 224 public bool TriggerTellRegionToCloseChildConnection(UUID agentID)
224 { 225 {
225 handlerCloseAgentConnection = OnCloseAgentConnection; 226 handlerCloseAgentConnection = OnCloseAgentConnection;
226 if (handlerCloseAgentConnection != null) 227 if (handlerCloseAgentConnection != null)
227 return handlerCloseAgentConnection(regionHandle, agentID); 228 return handlerCloseAgentConnection(agentID);
228 229
229 return false; 230 return false;
230 } 231 }
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 884b081..e3aee9d 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -163,7 +163,7 @@ namespace OpenSim
163 presence.UUID, 163 presence.UUID,
164 regionInfo.RegionName)); 164 regionInfo.RegionName));
165 165
166 presence.Scene.CloseConnection(regionInfo.RegionHandle, presence.UUID); 166 presence.Scene.CloseConnection(presence.UUID);
167 } 167 }
168 } 168 }
169 m_console.Notice(""); 169 m_console.Notice("");
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 4980378..ddba124 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Communications.Local
167 } 167 }
168 168
169 /// <summary> 169 /// <summary>
170 /// 170 /// Get information about a neighbouring region
171 /// </summary> 171 /// </summary>
172 /// <param name="regionHandle"></param> 172 /// <param name="regionHandle"></param>
173 /// <returns></returns> 173 /// <returns></returns>
@@ -177,9 +177,15 @@ namespace OpenSim.Region.Communications.Local
177 { 177 {
178 return m_regions[regionHandle]; 178 return m_regions[regionHandle];
179 } 179 }
180
180 return null; 181 return null;
181 } 182 }
182 183
184 /// <summary>
185 /// Get information about a neighbouring region
186 /// </summary>
187 /// <param name="regionHandle"></param>
188 /// <returns></returns>
183 public RegionInfo RequestNeighbourInfo(UUID regionID) 189 public RegionInfo RequestNeighbourInfo(UUID regionID)
184 { 190 {
185 // TODO add a dictionary for faster lookup 191 // TODO add a dictionary for faster lookup
@@ -188,9 +194,15 @@ namespace OpenSim.Region.Communications.Local
188 if (info.RegionID == regionID) 194 if (info.RegionID == regionID)
189 return info; 195 return info;
190 } 196 }
197
191 return null; 198 return null;
192 } 199 }
193 200
201 /// <summary>
202 /// Get information about the closet region given a region name.
203 /// </summary>
204 /// <param name="regionName"></param>
205 /// <returns></returns>
194 public RegionInfo RequestClosestRegion(string regionName) 206 public RegionInfo RequestClosestRegion(string regionName)
195 { 207 {
196 foreach (RegionInfo regInfo in m_regions.Values) 208 foreach (RegionInfo regInfo in m_regions.Values)
@@ -236,7 +248,7 @@ namespace OpenSim.Region.Communications.Local
236 { 248 {
237 if (m_regionListeners.ContainsKey(regionHandle)) 249 if (m_regionListeners.ContainsKey(regionHandle))
238 { 250 {
239 return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(regionHandle, agentID); 251 return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(agentID);
240 } 252 }
241 return false; 253 return false;
242 } 254 }
@@ -263,7 +275,7 @@ namespace OpenSim.Region.Communications.Local
263 if (m_regionListeners.ContainsKey(regionHandle)) 275 if (m_regionListeners.ContainsKey(regionHandle))
264 { 276 {
265 // Console.WriteLine("CommsManager- Informing a region to expect child agent"); 277 // Console.WriteLine("CommsManager- Informing a region to expect child agent");
266 m_regionListeners[regionHandle].TriggerChildAgentUpdate(regionHandle, cAgentData); 278 m_regionListeners[regionHandle].TriggerChildAgentUpdate(cAgentData);
267 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname); 279 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
268 280
269 return true; 281 return true;
@@ -285,7 +297,7 @@ namespace OpenSim.Region.Communications.Local
285 return returnGridSettings; 297 return returnGridSettings;
286 } 298 }
287 299
288 public virtual void SetForcefulBanlistsDisallowed(ulong regionHandle) 300 public virtual void SetForcefulBanlistsDisallowed()
289 { 301 {
290 m_queuedGridSettings.Add("allow_forceful_banlines", "FALSE"); 302 m_queuedGridSettings.Add("allow_forceful_banlines", "FALSE");
291 } 303 }
@@ -304,8 +316,9 @@ namespace OpenSim.Region.Communications.Local
304 { 316 {
305 if (m_regionListeners.ContainsKey(regionHandle)) 317 if (m_regionListeners.ContainsKey(regionHandle))
306 { 318 {
307 return m_regionListeners[regionHandle].TriggerChildAgentUpdate(regionHandle, cAgentData); 319 return m_regionListeners[regionHandle].TriggerChildAgentUpdate(cAgentData);
308 } 320 }
321
309 return false; 322 return false;
310 } 323 }
311 324
@@ -313,8 +326,9 @@ namespace OpenSim.Region.Communications.Local
313 { 326 {
314 if (m_regionListeners.ContainsKey(regionHandle)) 327 if (m_regionListeners.ContainsKey(regionHandle))
315 { 328 {
316 return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(regionHandle, agentID); 329 return m_regionListeners[regionHandle].TriggerTellRegionToCloseChildConnection(agentID);
317 } 330 }
331
318 return false; 332 return false;
319 } 333 }
320 334
@@ -333,7 +347,7 @@ namespace OpenSim.Region.Communications.Local
333 if (m_regionListeners.ContainsKey(regionHandle)) 347 if (m_regionListeners.ContainsKey(regionHandle))
334 { 348 {
335 // Console.WriteLine("CommsManager- Informing a region to expect child agent"); 349 // Console.WriteLine("CommsManager- Informing a region to expect child agent");
336 m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData); 350 m_regionListeners[regionHandle].TriggerExpectUser(agentData);
337 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname); 351 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
338 352
339 return true; 353 return true;
@@ -345,14 +359,15 @@ namespace OpenSim.Region.Communications.Local
345 { 359 {
346 if (m_regionListeners.ContainsKey(regionHandle)) 360 if (m_regionListeners.ContainsKey(regionHandle))
347 { 361 {
348 m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData, XMLMethod); 362 m_regionListeners[regionHandle].TriggerExpectPrim(primID, objData, XMLMethod);
349 return true; 363 return true;
350 } 364 }
365
351 return false; 366 return false;
352 } 367 }
353 368
354 /// <summary> 369 /// <summary>
355 /// 370 /// Tell a region to get prepare for an avatar to cross into it.
356 /// </summary> 371 /// </summary>
357 /// <param name="regionHandle"></param> 372 /// <param name="regionHandle"></param>
358 /// <param name="agentID"></param> 373 /// <param name="agentID"></param>
@@ -363,7 +378,7 @@ namespace OpenSim.Region.Communications.Local
363 if (m_regionListeners.ContainsKey(regionHandle)) 378 if (m_regionListeners.ContainsKey(regionHandle))
364 { 379 {
365 // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing"); 380 // Console.WriteLine("CommsManager- Informing a region to expect avatar crossing");
366 m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); 381 m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(agentID, position, isFlying);
367 return true; 382 return true;
368 } 383 }
369 return false; 384 return false;
@@ -373,9 +388,10 @@ namespace OpenSim.Region.Communications.Local
373 { 388 {
374 if (m_regionListeners.ContainsKey(regionHandle)) 389 if (m_regionListeners.ContainsKey(regionHandle))
375 { 390 {
376 m_regionListeners[regionHandle].TriggerExpectPrimCrossing(regionHandle, primID, position, isPhysical); 391 m_regionListeners[regionHandle].TriggerExpectPrimCrossing(primID, position, isPhysical);
377 return true; 392 return true;
378 } 393 }
394
379 return false; 395 return false;
380 } 396 }
381 397
@@ -429,7 +445,7 @@ namespace OpenSim.Region.Communications.Local
429 { 445 {
430 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname); 446 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
431 447
432 m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent); 448 m_regionListeners[regionHandle].TriggerExpectUser(agent);
433 } 449 }
434 } 450 }
435 451
@@ -439,7 +455,7 @@ namespace OpenSim.Region.Communications.Local
439 { 455 {
440 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname); 456 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
441 457
442 m_regionListeners[regionHandle].TriggerLogOffUser(regionHandle, agentID, RegionSecret, message); 458 m_regionListeners[regionHandle].TriggerLogOffUser(agentID, RegionSecret, message);
443 } 459 }
444 } 460 }
445 461
@@ -447,7 +463,7 @@ namespace OpenSim.Region.Communications.Local
447 { 463 {
448 if (m_regionListeners.ContainsKey(regionHandle)) 464 if (m_regionListeners.ContainsKey(regionHandle))
449 { 465 {
450 m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData, XMLMethod); 466 m_regionListeners[regionHandle].TriggerExpectPrim(primID, objData, XMLMethod);
451 } 467 }
452 } 468 }
453 469
@@ -468,8 +484,7 @@ namespace OpenSim.Region.Communications.Local
468 { 484 {
469 if (m_regionListeners.ContainsKey(regionHandle)) 485 if (m_regionListeners.ContainsKey(regionHandle))
470 { 486 {
471 return m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position, 487 return m_regionListeners[regionHandle].TriggerExpectAvatarCrossing(agentID, position, isFlying);
472 isFlying);
473 } 488 }
474 489
475 return false; 490 return false;
@@ -480,7 +495,7 @@ namespace OpenSim.Region.Communications.Local
480 if (m_regionListeners.ContainsKey(regionHandle)) 495 if (m_regionListeners.ContainsKey(regionHandle))
481 { 496 {
482 return 497 return
483 m_regionListeners[regionHandle].TriggerExpectPrimCrossing(regionHandle, primID, position, isPhysical); 498 m_regionListeners[regionHandle].TriggerExpectPrimCrossing(primID, position, isPhysical);
484 } 499 }
485 return false; 500 return false;
486 } 501 }
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
index ba40571..5b06408 100644
--- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
@@ -546,7 +546,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
546 homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile); 546 homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile);
547 547
548 // Call 'new user' event handler 548 // Call 'new user' event handler
549 homeScene.NewUserConnection(reg.RegionHandle, agentData); 549 homeScene.NewUserConnection(agentData);
550 550
551 //string raCap = string.Empty; 551 //string raCap = string.Empty;
552 552
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index ceadf7a..0d0823e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2106,9 +2106,10 @@ namespace OpenSim.Region.Environment.Scenes
2106 /// <param name="objXMLData"></param> 2106 /// <param name="objXMLData"></param>
2107 /// <param name="XMLMethod"></param> 2107 /// <param name="XMLMethod"></param>
2108 /// <returns></returns> 2108 /// <returns></returns>
2109 public bool IncomingInterRegionPrimGroup(ulong regionHandle, UUID primID, string objXMLData, int XMLMethod) 2109 public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod)
2110 { 2110 {
2111 m_log.Warn("[INTERREGION]: A new prim arrived from a neighbor"); 2111 m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID);
2112
2112 if (XMLMethod == 0) 2113 if (XMLMethod == 0)
2113 { 2114 {
2114 SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); 2115 SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData);
@@ -2702,51 +2703,42 @@ namespace OpenSim.Region.Environment.Scenes
2702 /// </summary> 2703 /// </summary>
2703 /// <param name="regionHandle"></param> 2704 /// <param name="regionHandle"></param>
2704 /// <param name="agent"></param> 2705 /// <param name="agent"></param>
2705 public void NewUserConnection(ulong regionHandle, AgentCircuitData agent) 2706 public void NewUserConnection(AgentCircuitData agent)
2706 { 2707 {
2707 if (regionHandle == m_regInfo.RegionHandle) 2708 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID))
2708 { 2709 {
2709 if (m_regInfo.EstateSettings.IsBanned(agent.AgentID)) 2710 m_log.WarnFormat(
2710 { 2711 "[CONNECTION DEBUGGING]: Denied access to: {0} at {1} because the user is on the region banlist",
2711 m_log.WarnFormat( 2712 agent.AgentID, RegionInfo.RegionName);
2712 "[CONNECTION DEBUGGING]: Denied access to: {0} [{1}] at {2} because the user is on the region banlist", 2713 }
2713 agent.AgentID, regionHandle, RegionInfo.RegionName);
2714 }
2715 2714
2716 capsPaths[agent.AgentID] = agent.CapsPath; 2715 capsPaths[agent.AgentID] = agent.CapsPath;
2717 2716
2718 if (!agent.child) 2717 if (!agent.child)
2719 { 2718 {
2720 AddCapsHandler(agent.AgentID); 2719 AddCapsHandler(agent.AgentID);
2721 2720
2722 // Honor parcel landing type and position. 2721 // Honor parcel landing type and position.
2723 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); 2722 ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
2724 if (land != null) 2723 if (land != null)
2724 {
2725 if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero)
2725 { 2726 {
2726 if (land.landData.LandingType == (byte)1 && land.landData.UserLocation != Vector3.Zero) 2727 agent.startpos = land.landData.UserLocation;
2727 {
2728 agent.startpos = land.landData.UserLocation;
2729 }
2730 } 2728 }
2731 } 2729 }
2730 }
2732 2731
2733 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 2732 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
2734 // rewrite session_id 2733 // rewrite session_id
2735 CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID); 2734 CachedUserInfo userinfo = CommsManager.UserProfileCacheService.GetUserDetails(agent.AgentID);
2736 if (userinfo != null) 2735 if (userinfo != null)
2737 { 2736 {
2738 userinfo.SessionID = agent.SessionID; 2737 userinfo.SessionID = agent.SessionID;
2739 }
2740 else
2741 {
2742 m_log.WarnFormat("[USERINFO CACHE]: We couldn't find a User Info record for {0}. This is usually an indication that the UUID we're looking up is invalid", agent.AgentID);
2743 }
2744 } 2738 }
2745 else 2739 else
2746 { 2740 {
2747 m_log.WarnFormat( 2741 m_log.WarnFormat("[USERINFO CACHE]: We couldn't find a User Info record for {0}. This is usually an indication that the UUID we're looking up is invalid", agent.AgentID);
2748 "[CONNECTION DEBUGGING]: Skipping this region for welcoming avatar {0} [{1}] at {2}",
2749 agent.AgentID, regionHandle, RegionInfo.RegionName);
2750 } 2742 }
2751 } 2743 }
2752 2744
@@ -2760,31 +2752,28 @@ namespace OpenSim.Region.Environment.Scenes
2760 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); 2752 return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc);
2761 } 2753 }
2762 2754
2763 protected void HandleLogOffUserFromGrid(ulong regionHandle, UUID AvatarID, UUID RegionSecret, string message) 2755 protected void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
2764 { 2756 {
2765 if (RegionInfo.RegionHandle == regionHandle) 2757 ScenePresence loggingOffUser = null;
2758 loggingOffUser = GetScenePresence(AvatarID);
2759 if (loggingOffUser != null)
2766 { 2760 {
2767 ScenePresence loggingOffUser = null; 2761 if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId)
2768 loggingOffUser = GetScenePresence(AvatarID);
2769 if (loggingOffUser != null)
2770 { 2762 {
2771 if (RegionSecret == loggingOffUser.ControllingClient.SecureSessionId) 2763 loggingOffUser.ControllingClient.Kick(message);
2772 { 2764 // Give them a second to receive the message!
2773 loggingOffUser.ControllingClient.Kick(message); 2765 System.Threading.Thread.Sleep(1000);
2774 // Give them a second to receive the message! 2766 loggingOffUser.ControllingClient.Close(true);
2775 System.Threading.Thread.Sleep(1000);
2776 loggingOffUser.ControllingClient.Close(true);
2777 }
2778 else
2779 {
2780 m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
2781 }
2782 } 2767 }
2783 else 2768 else
2784 { 2769 {
2785 m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString()); 2770 m_log.Info("[USERLOGOFF]: System sending the LogOff user message failed to sucessfully authenticate");
2786 } 2771 }
2787 } 2772 }
2773 else
2774 {
2775 m_log.InfoFormat("[USERLOGOFF]: Got a logoff request for {0} but the user isn't here. The user might already have been logged out", AvatarID.ToString());
2776 }
2788 } 2777 }
2789 2778
2790 /// <summary> 2779 /// <summary>
@@ -2865,42 +2854,38 @@ namespace OpenSim.Region.Environment.Scenes
2865 /// <summary> 2854 /// <summary>
2866 /// Triggered when an agent crosses into this sim. Also happens on initial login. 2855 /// Triggered when an agent crosses into this sim. Also happens on initial login.
2867 /// </summary> 2856 /// </summary>
2868 /// <param name="regionHandle"></param>
2869 /// <param name="agentID"></param> 2857 /// <param name="agentID"></param>
2870 /// <param name="position"></param> 2858 /// <param name="position"></param>
2871 /// <param name="isFlying"></param> 2859 /// <param name="isFlying"></param>
2872 public virtual void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) 2860 public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
2873 { 2861 {
2874 if (regionHandle == m_regInfo.RegionHandle) 2862 ScenePresence presence;
2863
2864 lock (m_scenePresences)
2875 { 2865 {
2876 ScenePresence presence; 2866 m_scenePresences.TryGetValue(agentID, out presence);
2877 2867 }
2878 lock (m_scenePresences) 2868
2869 if (presence != null)
2870 {
2871 try
2879 { 2872 {
2880 m_scenePresences.TryGetValue(agentID, out presence); 2873 presence.MakeRootAgent(position, isFlying);
2881 } 2874 }
2882 2875 catch (Exception e)
2883 if (presence != null)
2884 {
2885 try
2886 {
2887 presence.MakeRootAgent(position, isFlying);
2888 }
2889 catch (Exception e)
2890 {
2891 m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}", e);
2892 }
2893 }
2894 else
2895 { 2876 {
2896 m_log.ErrorFormat( 2877 m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}", e);
2897 "[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
2898 agentID, RegionInfo.RegionName);
2899 } 2878 }
2900 } 2879 }
2880 else
2881 {
2882 m_log.ErrorFormat(
2883 "[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
2884 agentID, RegionInfo.RegionName);
2885 }
2901 } 2886 }
2902 2887
2903 public virtual bool IncomingChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) 2888 public virtual bool IncomingChildAgentDataUpdate(ChildAgentDataUpdate cAgentData)
2904 { 2889 {
2905 ScenePresence childAgentUpdate = GetScenePresence(new UUID(cAgentData.AgentID)); 2890 ScenePresence childAgentUpdate = GetScenePresence(new UUID(cAgentData.AgentID));
2906 if (childAgentUpdate != null) 2891 if (childAgentUpdate != null)
@@ -2918,8 +2903,10 @@ namespace OpenSim.Region.Environment.Scenes
2918 // Not Implemented: 2903 // Not Implemented:
2919 //TODO: Do we need to pass the message on to one of our neighbors? 2904 //TODO: Do we need to pass the message on to one of our neighbors?
2920 } 2905 }
2906
2921 return true; 2907 return true;
2922 } 2908 }
2909
2923 return false; 2910 return false;
2924 } 2911 }
2925 2912
@@ -2928,29 +2915,28 @@ namespace OpenSim.Region.Environment.Scenes
2928 /// </summary> 2915 /// </summary>
2929 /// <param name="regionHandle"></param> 2916 /// <param name="regionHandle"></param>
2930 /// <param name="agentID"></param> 2917 /// <param name="agentID"></param>
2931 public bool CloseConnection(ulong regionHandle, UUID agentID) 2918 public bool CloseConnection(UUID agentID)
2932 { 2919 {
2933 if (regionHandle == m_regionHandle) 2920 ScenePresence presence = m_innerScene.GetScenePresence(agentID);
2921
2922 if (presence != null)
2934 { 2923 {
2935 ScenePresence presence = m_innerScene.GetScenePresence(agentID); 2924 // Nothing is removed here, so down count it as such
2936 if (presence != null) 2925 // if (presence.IsChildAgent)
2937 { 2926 // {
2938 // Nothing is removed here, so down count it as such 2927 // m_innerScene.removeUserCount(false);
2939 // if (presence.IsChildAgent) 2928 // }
2940 // { 2929 // else
2941 // m_innerScene.removeUserCount(false); 2930 // {
2942 // } 2931 // m_innerScene.removeUserCount(true);
2943 // else 2932 // }
2944 // { 2933
2945 // m_innerScene.removeUserCount(true); 2934 // Tell a single agent to disconnect from the region.
2946 // } 2935 presence.ControllingClient.SendShutdownConnectionNotice();
2947 2936
2948 // Tell a single agent to disconnect from the region. 2937 presence.ControllingClient.Close(true);
2949 presence.ControllingClient.SendShutdownConnectionNotice();
2950
2951 presence.ControllingClient.Close(true);
2952 }
2953 } 2938 }
2939
2954 return true; 2940 return true;
2955 } 2941 }
2956 2942
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 540303a..830a63d 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -155,22 +155,22 @@ namespace OpenSim.Region.Environment.Scenes
155 /// <param name="regionHandle"></param> 155 /// <param name="regionHandle"></param>
156 /// <param name="agent"></param> 156 /// <param name="agent"></param>
157 /// 157 ///
158 protected void NewUserConnection(ulong regionHandle, AgentCircuitData agent) 158 protected void NewUserConnection(AgentCircuitData agent)
159 { 159 {
160 handlerExpectUser = OnExpectUser; 160 handlerExpectUser = OnExpectUser;
161 if (handlerExpectUser != null) 161 if (handlerExpectUser != null)
162 { 162 {
163 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname); 163 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname);
164 handlerExpectUser(regionHandle, agent); 164 handlerExpectUser(agent);
165 } 165 }
166 } 166 }
167 167
168 protected void GridLogOffUser(ulong regionHandle, UUID AgentID, UUID RegionSecret, string message) 168 protected void GridLogOffUser(UUID AgentID, UUID RegionSecret, string message)
169 { 169 {
170 handlerLogOffUser = OnLogOffUser; 170 handlerLogOffUser = OnLogOffUser;
171 if (handlerLogOffUser != null) 171 if (handlerLogOffUser != null)
172 { 172 {
173 handlerLogOffUser(regionHandle, AgentID, RegionSecret, message); 173 handlerLogOffUser(AgentID, RegionSecret, message);
174 } 174 }
175 } 175 }
176 176
@@ -185,31 +185,31 @@ namespace OpenSim.Region.Environment.Scenes
185 return true; 185 return true;
186 } 186 }
187 187
188 protected bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) 188 protected bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData)
189 { 189 {
190 handlerChildAgentUpdate = OnChildAgentUpdate; 190 handlerChildAgentUpdate = OnChildAgentUpdate;
191 if (handlerChildAgentUpdate != null) 191 if (handlerChildAgentUpdate != null)
192 handlerChildAgentUpdate(regionHandle, cAgentData); 192 handlerChildAgentUpdate(cAgentData);
193 193
194 194
195 return true; 195 return true;
196 } 196 }
197 197
198 protected void AgentCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) 198 protected void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
199 { 199 {
200 handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; 200 handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion;
201 if (handlerAvatarCrossingIntoRegion != null) 201 if (handlerAvatarCrossingIntoRegion != null)
202 { 202 {
203 handlerAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying); 203 handlerAvatarCrossingIntoRegion(agentID, position, isFlying);
204 } 204 }
205 } 205 }
206 206
207 protected bool IncomingPrimCrossing(ulong regionHandle, UUID primID, String objXMLData, int XMLMethod) 207 protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod)
208 { 208 {
209 handlerExpectPrim = OnExpectPrim; 209 handlerExpectPrim = OnExpectPrim;
210 if (handlerExpectPrim != null) 210 if (handlerExpectPrim != null)
211 { 211 {
212 return handlerExpectPrim(regionHandle, primID, objXMLData, XMLMethod); 212 return handlerExpectPrim(primID, objXMLData, XMLMethod);
213 } 213 }
214 else 214 else
215 { 215 {
@@ -218,23 +218,25 @@ namespace OpenSim.Region.Environment.Scenes
218 218
219 } 219 }
220 220
221 protected void PrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isPhysical) 221 protected void PrimCrossing(UUID primID, Vector3 position, bool isPhysical)
222 { 222 {
223 handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion; 223 handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
224 if (handlerPrimCrossingIntoRegion != null) 224 if (handlerPrimCrossingIntoRegion != null)
225 { 225 {
226 handlerPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical); 226 handlerPrimCrossingIntoRegion(primID, position, isPhysical);
227 } 227 }
228 } 228 }
229 229
230 protected bool CloseConnection(ulong regionHandle, UUID agentID) 230 protected bool CloseConnection(UUID agentID)
231 { 231 {
232 m_log.Info("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID.ToString()); 232 m_log.Debug("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID);
233
233 handlerCloseAgentConnection = OnCloseAgentConnection; 234 handlerCloseAgentConnection = OnCloseAgentConnection;
234 if (handlerCloseAgentConnection != null) 235 if (handlerCloseAgentConnection != null)
235 { 236 {
236 return handlerCloseAgentConnection(regionHandle, agentID); 237 return handlerCloseAgentConnection(agentID);
237 } 238 }
239
238 return false; 240 return false;
239 } 241 }
240 242
@@ -416,8 +418,6 @@ namespace OpenSim.Region.Environment.Scenes
416 // yes, we're notifying ourselves. 418 // yes, we're notifying ourselves.
417 if (handlerRegionUp != null) 419 if (handlerRegionUp != null)
418 handlerRegionUp(region); 420 handlerRegionUp(region);
419
420
421 } 421 }
422 else 422 else
423 { 423 {
@@ -726,7 +726,7 @@ namespace OpenSim.Region.Environment.Scenes
726 { 726 {
727 SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList()); 727 SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList());
728 SendCloseChildAgentConnections(avatar.UUID, childRegions); 728 SendCloseChildAgentConnections(avatar.UUID, childRegions);
729 CloseConnection(m_regionInfo.RegionHandle, avatar.UUID); 729 CloseConnection(avatar.UUID);
730 } 730 }
731 // if (teleport success) // seems to be always success here 731 // if (teleport success) // seems to be always success here
732 // the user may change their profile information in other region, 732 // the user may change their profile information in other region,
@@ -763,7 +763,7 @@ namespace OpenSim.Region.Environment.Scenes
763 } 763 }
764 764
765 /// <summary> 765 /// <summary>
766 /// 766 /// Inform a neighbouring region that an avatar is about to cross into it.
767 /// </summary> 767 /// </summary>
768 /// <param name="regionhandle"></param> 768 /// <param name="regionhandle"></param>
769 /// <param name="agentID"></param> 769 /// <param name="agentID"></param>
@@ -778,7 +778,6 @@ namespace OpenSim.Region.Environment.Scenes
778 return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData, XMLMethod); 778 return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData, XMLMethod);
779 } 779 }
780 780
781
782 public Dictionary<string, string> GetGridSettings() 781 public Dictionary<string, string> GetGridSettings()
783 { 782 {
784 return m_commsProvider.GridService.GetGridSettings(); 783 return m_commsProvider.GridService.GetGridSettings();