diff options
Diffstat (limited to '')
14 files changed, 145 insertions, 118 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index f63089d..d3d6f25 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -373,7 +373,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
373 | // Save avatar attachment information | 373 | // Save avatar attachment information |
374 | if (m_scene.AvatarFactory != null) | 374 | if (m_scene.AvatarFactory != null) |
375 | { | 375 | { |
376 | m_log.Debug("[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", ItemID: " + itemID); | 376 | m_log.Debug("[ATTACHMENTS MODULE]: Dettaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); |
377 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 377 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); |
378 | } | 378 | } |
379 | } | 379 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 22c8937..7e5a8ec 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -198,7 +198,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
198 | 198 | ||
199 | public void UpdateDatabase(UUID user, AvatarAppearance appearance) | 199 | public void UpdateDatabase(UUID user, AvatarAppearance appearance) |
200 | { | 200 | { |
201 | //m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); | 201 | m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); |
202 | AvatarData adata = new AvatarData(appearance); | 202 | AvatarData adata = new AvatarData(appearance); |
203 | m_scene.AvatarService.SetAvatar(user, adata); | 203 | m_scene.AvatarService.SetAvatar(user, adata); |
204 | } | 204 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index b5c3176..4e36c5d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | |||
@@ -55,6 +55,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
55 | 55 | ||
56 | m_scene.AddCommand( | 56 | m_scene.AddCommand( |
57 | this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand); | 57 | this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand); |
58 | |||
59 | m_scene.AddCommand( | ||
60 | this, "alert dialog", "alert dialog <message>", "Send a dialog alert to everyone", HandleAlertConsoleCommand); | ||
61 | |||
62 | |||
58 | } | 63 | } |
59 | 64 | ||
60 | public void PostInitialise() {} | 65 | public void PostInitialise() {} |
@@ -181,6 +186,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog | |||
181 | "[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message); | 186 | "[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message); |
182 | SendGeneralAlert(message); | 187 | SendGeneralAlert(message); |
183 | } | 188 | } |
189 | else if (cmdparams[1] == "dialog") | ||
190 | { | ||
191 | string message = CombineParams(cmdparams, 2); | ||
192 | |||
193 | m_log.InfoFormat( | ||
194 | "[DIALOG]: Sending dialog alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message); | ||
195 | SendNotificationToUsersInRegion(UUID.Zero, "System", message); | ||
196 | } | ||
184 | else | 197 | else |
185 | { | 198 | { |
186 | string firstName = cmdparams[1]; | 199 | string firstName = cmdparams[1]; |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 3fcc0e8..927eeab 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -396,7 +396,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
396 | agent.Position = position; | 396 | agent.Position = position; |
397 | SetCallbackURL(agent, sp.Scene.RegionInfo); | 397 | SetCallbackURL(agent, sp.Scene.RegionInfo); |
398 | 398 | ||
399 | UpdateAgent(reg, finalDestination, agent); | 399 | if (!UpdateAgent(reg, finalDestination, agent)) |
400 | { | ||
401 | // Region doesn't take it | ||
402 | Fail(sp, finalDestination); | ||
403 | return; | ||
404 | } | ||
400 | 405 | ||
401 | m_log.DebugFormat( | 406 | m_log.DebugFormat( |
402 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); | 407 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); |
@@ -421,21 +426,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
421 | // that the client contacted the destination before we send the attachments and close things here. | 426 | // that the client contacted the destination before we send the attachments and close things here. |
422 | if (!WaitForCallback(sp.UUID)) | 427 | if (!WaitForCallback(sp.UUID)) |
423 | { | 428 | { |
424 | // Client never contacted destination. Let's restore everything back | 429 | Fail(sp, finalDestination); |
425 | sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); | ||
426 | |||
427 | // Fail. Reset it back | ||
428 | sp.IsChildAgent = false; | ||
429 | |||
430 | ResetFromTransit(sp.UUID); | ||
431 | |||
432 | // Yikes! We should just have a ref to scene here. | ||
433 | //sp.Scene.InformClientOfNeighbours(sp); | ||
434 | EnableChildAgents(sp); | ||
435 | |||
436 | // Finally, kill the agent we just created at the destination. | ||
437 | m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID); | ||
438 | |||
439 | return; | 430 | return; |
440 | } | 431 | } |
441 | 432 | ||
@@ -475,6 +466,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
475 | } | 466 | } |
476 | } | 467 | } |
477 | 468 | ||
469 | private void Fail(ScenePresence sp, GridRegion finalDestination) | ||
470 | { | ||
471 | // Client never contacted destination. Let's restore everything back | ||
472 | sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); | ||
473 | |||
474 | // Fail. Reset it back | ||
475 | sp.IsChildAgent = false; | ||
476 | |||
477 | ResetFromTransit(sp.UUID); | ||
478 | |||
479 | EnableChildAgents(sp); | ||
480 | |||
481 | // Finally, kill the agent we just created at the destination. | ||
482 | m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID); | ||
483 | |||
484 | } | ||
478 | 485 | ||
479 | protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) | 486 | protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) |
480 | { | 487 | { |
@@ -813,7 +820,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
813 | cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + | 820 | cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + |
814 | "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; | 821 | "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; |
815 | 822 | ||
816 | m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent); | 823 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) |
824 | { | ||
825 | // region doesn't take it | ||
826 | ResetFromTransit(agent.UUID); | ||
827 | return agent; | ||
828 | } | ||
817 | 829 | ||
818 | // Next, let's close the child agent connections that are too far away. | 830 | // Next, let's close the child agent connections that are too far away. |
819 | agent.CloseChildAgents(neighbourx, neighboury); | 831 | agent.CloseChildAgents(neighbourx, neighboury); |
@@ -914,12 +926,40 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
914 | /// </summary> | 926 | /// </summary> |
915 | public void EnableChildAgent(ScenePresence sp, GridRegion region) | 927 | public void EnableChildAgent(ScenePresence sp, GridRegion region) |
916 | { | 928 | { |
929 | m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighour {0}", region.RegionName); | ||
930 | |||
931 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | ||
917 | AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); | 932 | AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); |
918 | agent.BaseFolder = UUID.Zero; | 933 | agent.BaseFolder = UUID.Zero; |
919 | agent.InventoryFolder = UUID.Zero; | 934 | agent.InventoryFolder = UUID.Zero; |
920 | agent.startpos = new Vector3(128, 128, 70); | 935 | agent.startpos = new Vector3(128, 128, 70); |
921 | agent.child = true; | 936 | agent.child = true; |
922 | agent.Appearance = sp.Appearance; | 937 | agent.Appearance = sp.Appearance; |
938 | agent.CapsPath = CapsUtil.GetRandomCapsObjectPath(); | ||
939 | |||
940 | agent.ChildrenCapSeeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID)); | ||
941 | m_log.DebugFormat("[XXX] Seeds 1 {0}", agent.ChildrenCapSeeds.Count); | ||
942 | |||
943 | if (!agent.ChildrenCapSeeds.ContainsKey(sp.Scene.RegionInfo.RegionHandle)) | ||
944 | agent.ChildrenCapSeeds.Add(sp.Scene.RegionInfo.RegionHandle, sp.ControllingClient.RequestClientInfo().CapsPath); | ||
945 | m_log.DebugFormat("[XXX] Seeds 2 {0}", agent.ChildrenCapSeeds.Count); | ||
946 | |||
947 | sp.AddNeighbourRegion(region.RegionHandle, agent.CapsPath); | ||
948 | foreach (ulong h in agent.ChildrenCapSeeds.Keys) | ||
949 | m_log.DebugFormat("[XXX] --> {0}", h); | ||
950 | m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle); | ||
951 | agent.ChildrenCapSeeds.Add(region.RegionHandle, agent.CapsPath); | ||
952 | |||
953 | if (sp.Scene.CapsModule != null) | ||
954 | { | ||
955 | sp.Scene.CapsModule.SetChildrenSeed(sp.UUID, agent.ChildrenCapSeeds); | ||
956 | } | ||
957 | |||
958 | if (currentAgentCircuit != null) | ||
959 | { | ||
960 | agent.ServiceURLs = currentAgentCircuit.ServiceURLs; | ||
961 | agent.Viewer = currentAgentCircuit.Viewer; | ||
962 | } | ||
923 | 963 | ||
924 | IPEndPoint external = region.ExternalEndPoint; | 964 | IPEndPoint external = region.ExternalEndPoint; |
925 | if (external != null) | 965 | if (external != null) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs index 8a90370..35518d5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs | |||
@@ -123,17 +123,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour | |||
123 | 123 | ||
124 | public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) | 124 | public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) |
125 | { | 125 | { |
126 | m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}", | ||
127 | thisRegion.RegionName, regionHandle, m_Scenes.Count); | ||
128 | foreach (Scene s in m_Scenes) | 126 | foreach (Scene s in m_Scenes) |
129 | { | 127 | { |
130 | if (s.RegionInfo.RegionHandle == regionHandle) | 128 | if (s.RegionInfo.RegionHandle == regionHandle) |
131 | { | 129 | { |
132 | m_log.Debug("[NEIGHBOUR IN CONNECTOR]: Found region to SendHelloNeighbour"); | 130 | //m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: HelloNeighbour from {0} to {1}", thisRegion.RegionName, s.RegionInfo.RegionName); |
133 | return s.IncomingHelloNeighbour(thisRegion); | 131 | return s.IncomingHelloNeighbour(thisRegion); |
134 | } | 132 | } |
135 | } | 133 | } |
136 | m_log.DebugFormat("[NEIGHBOUR IN CONNECTOR]: region handle {0} not found", regionHandle); | ||
137 | return null; | 134 | return null; |
138 | } | 135 | } |
139 | 136 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 1b00c8a..b2e3f4f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -181,22 +181,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
181 | 181 | ||
182 | public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) | 182 | public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) |
183 | { | 183 | { |
184 | if (m_LocalCache.ContainsKey(regionID)) | 184 | return m_GridService.GetNeighbours(scopeID, regionID); |
185 | { | ||
186 | List<GridRegion> neighbours = m_LocalCache[regionID].GetNeighbours(); | ||
187 | if (neighbours.Count == 0) | ||
188 | // try the DB | ||
189 | neighbours = m_GridService.GetNeighbours(scopeID, regionID); | ||
190 | return neighbours; | ||
191 | } | ||
192 | else | ||
193 | { | ||
194 | m_log.WarnFormat("[LOCAL GRID CONNECTOR]: GetNeighbours: Requested region {0} is not on this sim", regionID); | ||
195 | return new List<GridRegion>(); | ||
196 | } | ||
197 | |||
198 | // Don't go to the DB | ||
199 | //return m_GridService.GetNeighbours(scopeID, regionID); | ||
200 | } | 185 | } |
201 | 186 | ||
202 | public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) | 187 | public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 46741a5..16e25e6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -153,12 +153,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
153 | return false; | 153 | return false; |
154 | } | 154 | } |
155 | 155 | ||
156 | // Let's override GetNeighbours completely -- never go to the grid server | ||
157 | // Neighbours are/should be cached locally | ||
158 | // For retrieval from the DB, caller should call GetRegionByPosition | ||
159 | public override List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) | 156 | public override List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) |
160 | { | 157 | { |
161 | return m_LocalGridService.GetNeighbours(scopeID, regionID); | 158 | return base.GetNeighbours(scopeID, regionID); |
162 | } | 159 | } |
163 | 160 | ||
164 | public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) | 161 | public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs index daba0b3..f71bf46 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs | |||
@@ -121,17 +121,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | |||
121 | 121 | ||
122 | public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) | 122 | public GridRegion HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) |
123 | { | 123 | { |
124 | m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}. Count = {2}", | 124 | m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: HelloNeighbour from {0}, to {1}.", |
125 | thisRegion.RegionName, regionHandle, m_Scenes.Count); | 125 | thisRegion.RegionName, regionHandle); |
126 | foreach (Scene s in m_Scenes) | 126 | foreach (Scene s in m_Scenes) |
127 | { | 127 | { |
128 | if (s.RegionInfo.RegionHandle == regionHandle) | 128 | if (s.RegionInfo.RegionHandle == regionHandle) |
129 | { | 129 | { |
130 | m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour"); | 130 | //m_log.Debug("[NEIGHBOUR CONNECTOR]: Found region to SendHelloNeighbour"); |
131 | return s.IncomingHelloNeighbour(thisRegion); | 131 | return s.IncomingHelloNeighbour(thisRegion); |
132 | } | 132 | } |
133 | } | 133 | } |
134 | m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle); | 134 | //m_log.DebugFormat("[NEIGHBOUR CONNECTOR]: region handle {0} not found", regionHandle); |
135 | return null; | 135 | return null; |
136 | } | 136 | } |
137 | 137 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 377c868..e16e273 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -181,7 +181,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
181 | // else do the remote thing | 181 | // else do the remote thing |
182 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) | 182 | if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) |
183 | { | 183 | { |
184 | //m_regionClient.SendUserInformation(regInfo, aCircuit); | ||
185 | return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason); | 184 | return m_remoteConnector.CreateAgent(destination, aCircuit, teleportFlags, out reason); |
186 | } | 185 | } |
187 | return false; | 186 | return false; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a88b87f..97de147 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -964,12 +964,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
964 | // Let the grid service module know, so this can be cached | 964 | // Let the grid service module know, so this can be cached |
965 | m_eventManager.TriggerOnRegionUp(otherRegion); | 965 | m_eventManager.TriggerOnRegionUp(otherRegion); |
966 | 966 | ||
967 | RegionInfo regInfo = new RegionInfo(xcell, ycell, otherRegion.InternalEndPoint, otherRegion.ExternalHostName); | ||
968 | regInfo.RegionID = otherRegion.RegionID; | ||
969 | regInfo.RegionName = otherRegion.RegionName; | ||
970 | regInfo.ScopeID = otherRegion.ScopeID; | ||
971 | regInfo.ExternalHostName = otherRegion.ExternalHostName; | ||
972 | GridRegion r = new GridRegion(regInfo); | ||
973 | try | 967 | try |
974 | { | 968 | { |
975 | ForEachScenePresence(delegate(ScenePresence agent) | 969 | ForEachScenePresence(delegate(ScenePresence agent) |
@@ -984,7 +978,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
984 | old.Add(otherRegion.RegionHandle); | 978 | old.Add(otherRegion.RegionHandle); |
985 | agent.DropOldNeighbours(old); | 979 | agent.DropOldNeighbours(old); |
986 | if (m_teleportModule != null) | 980 | if (m_teleportModule != null) |
987 | m_teleportModule.EnableChildAgent(agent, r); | 981 | m_teleportModule.EnableChildAgent(agent, otherRegion); |
988 | } | 982 | } |
989 | } | 983 | } |
990 | ); | 984 | ); |
@@ -1368,6 +1362,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1368 | m_regInfo.EstateSettings.EstateOwner = account.PrincipalID; | 1362 | m_regInfo.EstateSettings.EstateOwner = account.PrincipalID; |
1369 | m_regInfo.EstateSettings.Save(); | 1363 | m_regInfo.EstateSettings.Save(); |
1370 | } | 1364 | } |
1365 | else | ||
1366 | m_log.ErrorFormat("[SCENE]: Unable to store account. If this simulator is connected to a grid,\n you must create the estate owner account first."); | ||
1371 | } | 1367 | } |
1372 | else | 1368 | else |
1373 | { | 1369 | { |
@@ -1546,6 +1542,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1546 | { | 1542 | { |
1547 | m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); | 1543 | m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); |
1548 | LoginsDisabled = false; | 1544 | LoginsDisabled = false; |
1545 | m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); | ||
1549 | } | 1546 | } |
1550 | } | 1547 | } |
1551 | } | 1548 | } |
@@ -1830,6 +1827,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1830 | { | 1827 | { |
1831 | RegisterCommsEvents(); | 1828 | RegisterCommsEvents(); |
1832 | 1829 | ||
1830 | m_sceneGridService.SetScene(this); | ||
1831 | |||
1833 | // These two 'commands' *must be* next to each other or sim rebooting fails. | 1832 | // These two 'commands' *must be* next to each other or sim rebooting fails. |
1834 | //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); | 1833 | //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); |
1835 | 1834 | ||
@@ -1840,24 +1839,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1840 | throw new Exception(error); | 1839 | throw new Exception(error); |
1841 | } | 1840 | } |
1842 | 1841 | ||
1843 | m_sceneGridService.SetScene(this); | ||
1844 | m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); | ||
1845 | |||
1846 | //Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings(); | ||
1847 | |||
1848 | //if (dGridSettings.ContainsKey("allow_forceful_banlines")) | ||
1849 | //{ | ||
1850 | // if (dGridSettings["allow_forceful_banlines"] != "TRUE") | ||
1851 | // { | ||
1852 | // m_log.Info("[GRID]: Grid is disabling forceful parcel banlists"); | ||
1853 | // EventManager.TriggerSetAllowForcefulBan(false); | ||
1854 | // } | ||
1855 | // else | ||
1856 | // { | ||
1857 | // m_log.Info("[GRID]: Grid is allowing forceful parcel banlists"); | ||
1858 | // EventManager.TriggerSetAllowForcefulBan(true); | ||
1859 | // } | ||
1860 | //} | ||
1861 | } | 1842 | } |
1862 | 1843 | ||
1863 | /// <summary> | 1844 | /// <summary> |
@@ -3944,6 +3925,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3944 | m_log.DebugFormat( | 3925 | m_log.DebugFormat( |
3945 | "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); | 3926 | "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); |
3946 | 3927 | ||
3928 | // XPTO: if this agent is not allowed here as root, always return false | ||
3929 | |||
3947 | // We have to wait until the viewer contacts this region after receiving EAC. | 3930 | // We have to wait until the viewer contacts this region after receiving EAC. |
3948 | // That calls AddNewClient, which finally creates the ScenePresence | 3931 | // That calls AddNewClient, which finally creates the ScenePresence |
3949 | ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); | 3932 | ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 6309cd9..a9ecde8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -182,24 +182,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
182 | { | 182 | { |
183 | //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); | 183 | //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); |
184 | 184 | ||
185 | for (int x = (int)region.RegionLocX - 1; x <= region.RegionLocX + 1; x++) | 185 | List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); |
186 | m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count); | ||
187 | foreach (GridRegion n in neighbours) | ||
186 | { | 188 | { |
187 | for (int y = (int)region.RegionLocY - 1; y <= region.RegionLocY + 1; y++) | 189 | InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; |
188 | { | 190 | d.BeginInvoke(neighbourService, region, n.RegionHandle, |
189 | if (!((x == region.RegionLocX) && (y == region.RegionLocY))) // skip this region | 191 | InformNeighborsThatRegionisUpCompleted, |
190 | { | 192 | d); |
191 | ulong handle = Utils.UIntsToLong((uint)x * Constants.RegionSize, (uint)y * Constants.RegionSize); | ||
192 | InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; | ||
193 | |||
194 | d.BeginInvoke(neighbourService, region, handle, | ||
195 | InformNeighborsThatRegionisUpCompleted, | ||
196 | d); | ||
197 | } | ||
198 | } | ||
199 | } | 193 | } |
200 | } | 194 | } |
201 | 195 | ||
202 | |||
203 | public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle); | 196 | public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle); |
204 | 197 | ||
205 | /// <summary> | 198 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6d2cd88..d4fc6cd 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3390,6 +3390,7 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); | |||
3390 | { | 3390 | { |
3391 | if (cAgent.Attachments != null) | 3391 | if (cAgent.Attachments != null) |
3392 | { | 3392 | { |
3393 | m_appearance.ClearAttachments(); | ||
3393 | foreach (AttachmentData att in cAgent.Attachments) | 3394 | foreach (AttachmentData att in cAgent.Attachments) |
3394 | { | 3395 | { |
3395 | m_appearance.SetAttachment(att.AttachPoint, att.ItemID, att.AssetID); | 3396 | m_appearance.SetAttachment(att.AttachPoint, att.ItemID, att.AssetID); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 9f3e354..fe8c70e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -502,25 +502,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
502 | return remainder; | 502 | return remainder; |
503 | } | 503 | } |
504 | 504 | ||
505 | // Old implementation of llRot2Euler, now normalized | 505 | public LSL_Vector llRot2Euler(LSL_Rotation q1) |
506 | 506 | { | |
507 | public LSL_Vector llRot2Euler(LSL_Rotation r) | 507 | m_host.AddScriptLPS(1); |
508 | { | 508 | LSL_Vector eul = new LSL_Vector(); |
509 | m_host.AddScriptLPS(1); | 509 | |
510 | //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke | 510 | double sqw = q1.s*q1.s; |
511 | LSL_Rotation t = new LSL_Rotation(r.x * r.x, r.y * r.y, r.z * r.z, r.s * r.s); | 511 | double sqx = q1.x*q1.x; |
512 | double m = (t.x + t.y + t.z + t.s); | 512 | double sqy = q1.z*q1.z; |
513 | if (m == 0) return new LSL_Vector(); | 513 | double sqz = q1.y*q1.y; |
514 | double n = 2 * (r.y * r.s + r.x * r.z); | 514 | double unit = sqx + sqy + sqz + sqw; // if normalised is one, otherwise is correction factor |
515 | double p = m * m - n * n; | 515 | double test = q1.x*q1.z + q1.y*q1.s; |
516 | if (p > 0) | 516 | if (test > 0.4999*unit) { // singularity at north pole |
517 | return new LSL_Vector(NormalizeAngle(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s))), | 517 | eul.z = 2 * Math.Atan2(q1.x,q1.s); |
518 | NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))), | 518 | eul.y = Math.PI/2; |
519 | NormalizeAngle(Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)))); | 519 | eul.x = 0; |
520 | else if (n > 0) | 520 | return eul; |
521 | return new LSL_Vector(0.0, Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); | 521 | } |
522 | else | 522 | if (test < -0.4999*unit) { // singularity at south pole |
523 | return new LSL_Vector(0.0, -Math.PI * 0.5, NormalizeAngle(Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z))); | 523 | eul.z = -2 * Math.Atan2(q1.x,q1.s); |
524 | eul.y = -Math.PI/2; | ||
525 | eul.x = 0; | ||
526 | return eul; | ||
527 | } | ||
528 | eul.z = Math.Atan2(2*q1.z*q1.s-2*q1.x*q1.y , sqx - sqy - sqz + sqw); | ||
529 | eul.y = Math.Asin(2*test/unit); | ||
530 | eul.x = Math.Atan2(2*q1.x*q1.s-2*q1.z*q1.y , -sqx + sqy - sqz + sqw); | ||
531 | return eul; | ||
524 | } | 532 | } |
525 | 533 | ||
526 | /* From wiki: | 534 | /* From wiki: |
@@ -3065,9 +3073,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3065 | { | 3073 | { |
3066 | m_host.AddScriptLPS(1); | 3074 | m_host.AddScriptLPS(1); |
3067 | 3075 | ||
3068 | if (m_host.ParentGroup.RootPart.AttachmentPoint == 0) | ||
3069 | return; | ||
3070 | |||
3071 | TaskInventoryItem item; | 3076 | TaskInventoryItem item; |
3072 | 3077 | ||
3073 | m_host.TaskInventory.LockItemsForRead(true); | 3078 | m_host.TaskInventory.LockItemsForRead(true); |
@@ -3093,11 +3098,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3093 | 3098 | ||
3094 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); | 3099 | ScenePresence presence = World.GetScenePresence(m_host.OwnerID); |
3095 | 3100 | ||
3101 | /* | ||
3096 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | 3102 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; |
3097 | if (attachmentsModule != null) | 3103 | if (attachmentsModule != null) |
3104 | { | ||
3098 | attachmentsModule.AttachObject( | 3105 | attachmentsModule.AttachObject( |
3099 | presence.ControllingClient, grp.LocalId, | 3106 | presence.ControllingClient, grp.LocalId, |
3100 | (uint)attachment, Quaternion.Identity, Vector3.Zero, false); | 3107 | (uint)attachment, Quaternion.Identity, Vector3.Zero, false); |
3108 | } | ||
3109 | */ | ||
3110 | grp.AttachToAgent(m_host.OwnerID, (uint)attachment, Vector3.Zero, false); | ||
3101 | } | 3111 | } |
3102 | } | 3112 | } |
3103 | 3113 | ||
@@ -9470,8 +9480,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9470 | { | 9480 | { |
9471 | m_host.AddScriptLPS(1); | 9481 | m_host.AddScriptLPS(1); |
9472 | DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, 0); | 9482 | DetectParams detectedParams = m_ScriptEngine.GetDetectParams(m_itemID, 0); |
9473 | if (detectedParams == null) return; // only works on the first detected avatar | 9483 | if (detectedParams == null) |
9474 | 9484 | { | |
9485 | if (m_host.IsAttachment == true) | ||
9486 | { | ||
9487 | detectedParams = new DetectParams(); | ||
9488 | detectedParams.Key = m_host.OwnerID; | ||
9489 | } | ||
9490 | else | ||
9491 | { | ||
9492 | return; | ||
9493 | } | ||
9494 | } | ||
9495 | |||
9475 | ScenePresence avatar = World.GetScenePresence(detectedParams.Key); | 9496 | ScenePresence avatar = World.GetScenePresence(detectedParams.Key); |
9476 | if (avatar != null) | 9497 | if (avatar != null) |
9477 | { | 9498 | { |
@@ -9479,6 +9500,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9479 | new Vector3((float)pos.x, (float)pos.y, (float)pos.z), | 9500 | new Vector3((float)pos.x, (float)pos.y, (float)pos.z), |
9480 | new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z)); | 9501 | new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z)); |
9481 | } | 9502 | } |
9503 | |||
9482 | ScriptSleep(1000); | 9504 | ScriptSleep(1000); |
9483 | } | 9505 | } |
9484 | 9506 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 0e86c86..db43902 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2222,12 +2222,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2222 | { | 2222 | { |
2223 | if (avatar.IsChildAgent == false) | 2223 | if (avatar.IsChildAgent == false) |
2224 | { | 2224 | { |
2225 | if (avatar.PhysicsActor != null && avatar.PhysicsActor.Position != null) | 2225 | result.Add(avatar.UUID); |
2226 | { | 2226 | result.Add(avatar.AbsolutePosition); |
2227 | result.Add(avatar.UUID); | 2227 | result.Add(avatar.Name); |
2228 | result.Add(avatar.PhysicsActor.Position); | ||
2229 | result.Add(avatar.Name); | ||
2230 | } | ||
2231 | } | 2228 | } |
2232 | } | 2229 | } |
2233 | }); | 2230 | }); |