diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 86 |
1 files changed, 60 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 20c0622..d8874b2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -253,6 +253,49 @@ namespace OpenSim.Region.Framework.Scenes | |||
253 | } | 253 | } |
254 | } | 254 | } |
255 | 255 | ||
256 | protected ISimulationService m_simulationService; | ||
257 | public ISimulationService SimulationService | ||
258 | { | ||
259 | get | ||
260 | { | ||
261 | if (m_simulationService == null) | ||
262 | m_simulationService = RequestModuleInterface<ISimulationService>(); | ||
263 | return m_simulationService; | ||
264 | } | ||
265 | } | ||
266 | |||
267 | protected IAuthenticationService m_AuthenticationService; | ||
268 | public IAuthenticationService AuthenticationService | ||
269 | { | ||
270 | get | ||
271 | { | ||
272 | if (m_AuthenticationService == null) | ||
273 | m_AuthenticationService = RequestModuleInterface<IAuthenticationService>(); | ||
274 | return m_AuthenticationService; | ||
275 | } | ||
276 | } | ||
277 | |||
278 | protected IPresenceService m_PresenceService; | ||
279 | public IPresenceService PresenceService | ||
280 | { | ||
281 | get | ||
282 | { | ||
283 | if (m_PresenceService == null) | ||
284 | m_PresenceService = RequestModuleInterface<IPresenceService>(); | ||
285 | return m_PresenceService; | ||
286 | } | ||
287 | } | ||
288 | protected IUserAccountService m_UserAccountService; | ||
289 | public IUserAccountService UserAccountService | ||
290 | { | ||
291 | get | ||
292 | { | ||
293 | if (m_UserAccountService == null) | ||
294 | m_UserAccountService = RequestModuleInterface<IUserAccountService>(); | ||
295 | return m_UserAccountService; | ||
296 | } | ||
297 | } | ||
298 | |||
256 | protected IXMLRPC m_xmlrpcModule; | 299 | protected IXMLRPC m_xmlrpcModule; |
257 | protected IWorldComm m_worldCommModule; | 300 | protected IWorldComm m_worldCommModule; |
258 | protected IAvatarFactory m_AvatarFactory; | 301 | protected IAvatarFactory m_AvatarFactory; |
@@ -262,8 +305,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
262 | } | 305 | } |
263 | protected IConfigSource m_config; | 306 | protected IConfigSource m_config; |
264 | protected IRegionSerialiserModule m_serialiser; | 307 | protected IRegionSerialiserModule m_serialiser; |
265 | protected IInterregionCommsOut m_interregionCommsOut; | ||
266 | protected IInterregionCommsIn m_interregionCommsIn; | ||
267 | protected IDialogModule m_dialogModule; | 308 | protected IDialogModule m_dialogModule; |
268 | protected ITeleportModule m_teleportModule; | 309 | protected ITeleportModule m_teleportModule; |
269 | 310 | ||
@@ -1136,8 +1177,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1136 | XferManager = RequestModuleInterface<IXfer>(); | 1177 | XferManager = RequestModuleInterface<IXfer>(); |
1137 | m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); | 1178 | m_AvatarFactory = RequestModuleInterface<IAvatarFactory>(); |
1138 | m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); | 1179 | m_serialiser = RequestModuleInterface<IRegionSerialiserModule>(); |
1139 | m_interregionCommsOut = RequestModuleInterface<IInterregionCommsOut>(); | ||
1140 | m_interregionCommsIn = RequestModuleInterface<IInterregionCommsIn>(); | ||
1141 | m_dialogModule = RequestModuleInterface<IDialogModule>(); | 1180 | m_dialogModule = RequestModuleInterface<IDialogModule>(); |
1142 | m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); | 1181 | m_capsModule = RequestModuleInterface<ICapabilitiesModule>(); |
1143 | m_teleportModule = RequestModuleInterface<ITeleportModule>(); | 1182 | m_teleportModule = RequestModuleInterface<ITeleportModule>(); |
@@ -2155,7 +2194,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2155 | grp.OffsetForNewRegion(pos); | 2194 | grp.OffsetForNewRegion(pos); |
2156 | 2195 | ||
2157 | // If we fail to cross the border, then reset the position of the scene object on that border. | 2196 | // If we fail to cross the border, then reset the position of the scene object on that border. |
2158 | if (!CrossPrimGroupIntoNewRegion(newRegionHandle, grp, silent)) | 2197 | uint x = 0, y = 0; |
2198 | Utils.LongToUInts(newRegionHandle, out x, out y); | ||
2199 | GridRegion destination = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); | ||
2200 | if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) | ||
2159 | { | 2201 | { |
2160 | grp.OffsetForNewRegion(oldGroupPosition); | 2202 | grp.OffsetForNewRegion(oldGroupPosition); |
2161 | grp.ScheduleGroupForFullUpdate(); | 2203 | grp.ScheduleGroupForFullUpdate(); |
@@ -2351,7 +2393,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2351 | /// true if the crossing itself was successful, false on failure | 2393 | /// true if the crossing itself was successful, false on failure |
2352 | /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region | 2394 | /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region |
2353 | /// </returns> | 2395 | /// </returns> |
2354 | public bool CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp, bool silent) | 2396 | public bool CrossPrimGroupIntoNewRegion(GridRegion destination, SceneObjectGroup grp, bool silent) |
2355 | { | 2397 | { |
2356 | //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); | 2398 | //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); |
2357 | 2399 | ||
@@ -2359,7 +2401,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2359 | grp.RootPart.UpdateFlag = 0; | 2401 | grp.RootPart.UpdateFlag = 0; |
2360 | //int primcrossingXMLmethod = 0; | 2402 | //int primcrossingXMLmethod = 0; |
2361 | 2403 | ||
2362 | if (newRegionHandle != 0) | 2404 | if (destination != null) |
2363 | { | 2405 | { |
2364 | //string objectState = grp.GetStateSnapshot(); | 2406 | //string objectState = grp.GetStateSnapshot(); |
2365 | 2407 | ||
@@ -2372,9 +2414,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2372 | // newRegionHandle, grp.UUID, objectState, 100); | 2414 | // newRegionHandle, grp.UUID, objectState, 100); |
2373 | //} | 2415 | //} |
2374 | 2416 | ||
2375 | // And the new channel... | 2417 | //// And the new channel... |
2376 | if (m_interregionCommsOut != null) | 2418 | //if (m_interregionCommsOut != null) |
2377 | successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); | 2419 | // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); |
2420 | if (m_simulationService != null) | ||
2421 | successYN = m_simulationService.CreateObject(destination, grp, true); | ||
2378 | 2422 | ||
2379 | if (successYN) | 2423 | if (successYN) |
2380 | { | 2424 | { |
@@ -2405,7 +2449,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2405 | } | 2449 | } |
2406 | else | 2450 | else |
2407 | { | 2451 | { |
2408 | m_log.Error("[INTERREGION]: region handle was unexpectedly 0 in Scene.CrossPrimGroupIntoNewRegion()"); | 2452 | m_log.Error("[INTERREGION]: destination was unexpectedly null in Scene.CrossPrimGroupIntoNewRegion()"); |
2409 | } | 2453 | } |
2410 | 2454 | ||
2411 | return successYN; | 2455 | return successYN; |
@@ -2598,10 +2642,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2598 | m_log.Debug(logMsg); | 2642 | m_log.Debug(logMsg); |
2599 | */ | 2643 | */ |
2600 | 2644 | ||
2601 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | 2645 | //CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); |
2602 | 2646 | ||
2603 | ScenePresence sp = CreateAndAddScenePresence(client); | 2647 | ScenePresence sp = CreateAndAddScenePresence(client); |
2604 | |||
2605 | // HERE!!! Do the initial attachments right here | 2648 | // HERE!!! Do the initial attachments right here |
2606 | // first agent upon login is a root agent by design. | 2649 | // first agent upon login is a root agent by design. |
2607 | // All other AddNewClient calls find aCircuit.child to be true | 2650 | // All other AddNewClient calls find aCircuit.child to be true |
@@ -2614,6 +2657,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2614 | 2657 | ||
2615 | m_LastLogin = Util.EnvironmentTickCount(); | 2658 | m_LastLogin = Util.EnvironmentTickCount(); |
2616 | EventManager.TriggerOnNewClient(client); | 2659 | EventManager.TriggerOnNewClient(client); |
2660 | |||
2617 | } | 2661 | } |
2618 | 2662 | ||
2619 | 2663 | ||
@@ -3289,14 +3333,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3289 | m_sceneGridService.KiPrimitive += SendKillObject; | 3333 | m_sceneGridService.KiPrimitive += SendKillObject; |
3290 | m_sceneGridService.OnGetLandData += GetLandData; | 3334 | m_sceneGridService.OnGetLandData += GetLandData; |
3291 | 3335 | ||
3292 | if (m_interregionCommsIn != null) | ||
3293 | { | ||
3294 | m_log.Debug("[SCENE]: Registering with InterregionCommsIn"); | ||
3295 | m_interregionCommsIn.OnChildAgentUpdate += IncomingChildAgentDataUpdate; | ||
3296 | } | ||
3297 | else | ||
3298 | m_log.Debug("[SCENE]: Unable to register with InterregionCommsIn"); | ||
3299 | |||
3300 | } | 3336 | } |
3301 | 3337 | ||
3302 | /// <summary> | 3338 | /// <summary> |
@@ -3314,9 +3350,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3314 | m_sceneGridService.OnCloseAgentConnection -= IncomingCloseAgent; | 3350 | m_sceneGridService.OnCloseAgentConnection -= IncomingCloseAgent; |
3315 | m_sceneGridService.OnGetLandData -= GetLandData; | 3351 | m_sceneGridService.OnGetLandData -= GetLandData; |
3316 | 3352 | ||
3317 | if (m_interregionCommsIn != null) | ||
3318 | m_interregionCommsIn.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; | ||
3319 | |||
3320 | // this does nothing; should be removed | 3353 | // this does nothing; should be removed |
3321 | m_sceneGridService.Close(); | 3354 | m_sceneGridService.Close(); |
3322 | 3355 | ||
@@ -3758,9 +3791,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3758 | return m_sceneGridService.ReleaseAgent(id); | 3791 | return m_sceneGridService.ReleaseAgent(id); |
3759 | } | 3792 | } |
3760 | 3793 | ||
3761 | public void SendReleaseAgent(ulong regionHandle, UUID id, string uri) | 3794 | public void SendReleaseAgent(UUID origin, UUID id, string uri) |
3762 | { | 3795 | { |
3763 | m_interregionCommsOut.SendReleaseAgent(regionHandle, id, uri); | 3796 | //m_interregionCommsOut.SendReleaseAgent(regionHandle, id, uri); |
3797 | m_simulationService.ReleaseAgent(origin, id, uri); | ||
3764 | } | 3798 | } |
3765 | 3799 | ||
3766 | /// <summary> | 3800 | /// <summary> |