diff options
Diffstat (limited to '')
6 files changed, 69 insertions, 52 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs index 5512642..3780ece 100644 --- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs +++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs | |||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
53 | UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, | 53 | UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, |
54 | uint timeStamp, bool offline, int parentEstateID, Vector3 position, | 54 | uint timeStamp, bool offline, int parentEstateID, Vector3 position, |
55 | uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket); | 55 | uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket); |
56 | void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, | 56 | void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID anotherAgent, bool canVoiceChat, |
57 | bool isModerator, bool textMute); | 57 | bool isModerator, bool textMute); |
58 | void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID); | 58 | void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID); |
59 | void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); | 59 | void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); |
diff --git a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs index 6885327..9ae5e87 100644 --- a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs | |||
@@ -97,5 +97,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
97 | void InviteGroupRequest(IClientAPI remoteClient, UUID GroupID, UUID InviteeID, UUID RoleID); | 97 | void InviteGroupRequest(IClientAPI remoteClient, UUID GroupID, UUID InviteeID, UUID RoleID); |
98 | void InviteGroup(IClientAPI remoteClient, UUID agentID, UUID GroupID, UUID InviteeID, UUID RoleID); | 98 | void InviteGroup(IClientAPI remoteClient, UUID agentID, UUID GroupID, UUID InviteeID, UUID RoleID); |
99 | void NotifyChange(UUID GroupID); | 99 | void NotifyChange(UUID GroupID); |
100 | |||
101 | List<DirGroupsReplyData> FindGroups(IClientAPI remoteClient, string query); | ||
100 | } | 102 | } |
101 | } \ No newline at end of file | 103 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 96e45ed..0d9028c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2955,6 +2955,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2955 | { | 2955 | { |
2956 | ScenePresence sp; | 2956 | ScenePresence sp; |
2957 | bool vialogin; | 2957 | bool vialogin; |
2958 | bool reallyNew = true; | ||
2958 | 2959 | ||
2959 | // Validation occurs in LLUDPServer | 2960 | // Validation occurs in LLUDPServer |
2960 | // | 2961 | // |
@@ -3013,6 +3014,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3013 | m_log.WarnFormat( | 3014 | m_log.WarnFormat( |
3014 | "[SCENE]: Already found {0} scene presence for {1} in {2} when asked to add new scene presence", | 3015 | "[SCENE]: Already found {0} scene presence for {1} in {2} when asked to add new scene presence", |
3015 | sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName); | 3016 | sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName); |
3017 | reallyNew = false; | ||
3016 | } | 3018 | } |
3017 | 3019 | ||
3018 | // We must set this here so that TriggerOnNewClient and TriggerOnClientLogin can determine whether the | 3020 | // We must set this here so that TriggerOnNewClient and TriggerOnClientLogin can determine whether the |
@@ -3024,7 +3026,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3024 | // places. However, we still need to do it here for NPCs. | 3026 | // places. However, we still need to do it here for NPCs. |
3025 | CacheUserName(sp, aCircuit); | 3027 | CacheUserName(sp, aCircuit); |
3026 | 3028 | ||
3027 | EventManager.TriggerOnNewClient(client); | 3029 | if (reallyNew) |
3030 | EventManager.TriggerOnNewClient(client); | ||
3031 | |||
3028 | if (vialogin) | 3032 | if (vialogin) |
3029 | EventManager.TriggerOnClientLogin(client); | 3033 | EventManager.TriggerOnClientLogin(client); |
3030 | } | 3034 | } |
@@ -3583,15 +3587,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3583 | if (closeChildAgents && isChildAgent) | 3587 | if (closeChildAgents && isChildAgent) |
3584 | { | 3588 | { |
3585 | // Tell a single agent to disconnect from the region. | 3589 | // Tell a single agent to disconnect from the region. |
3586 | IEventQueue eq = RequestModuleInterface<IEventQueue>(); | 3590 | // Let's do this via UDP |
3587 | if (eq != null) | 3591 | avatar.ControllingClient.SendShutdownConnectionNotice(); |
3588 | { | ||
3589 | eq.DisableSimulator(RegionInfo.RegionHandle, avatar.UUID); | ||
3590 | } | ||
3591 | else | ||
3592 | { | ||
3593 | avatar.ControllingClient.SendShutdownConnectionNotice(); | ||
3594 | } | ||
3595 | } | 3592 | } |
3596 | 3593 | ||
3597 | // Only applies to root agents. | 3594 | // Only applies to root agents. |
@@ -3834,42 +3831,40 @@ namespace OpenSim.Region.Framework.Scenes | |||
3834 | return false; | 3831 | return false; |
3835 | } | 3832 | } |
3836 | 3833 | ||
3837 | ScenePresence sp = GetScenePresence(agent.AgentID); | 3834 | lock (agent) |
3838 | |||
3839 | // If we have noo presence here or if that presence is a zombie root | ||
3840 | // presence that will be kicled, we need a new CAPS object. | ||
3841 | if (sp == null || (sp != null && !sp.IsChildAgent)) | ||
3842 | { | 3835 | { |
3843 | if (CapsModule != null) | 3836 | ScenePresence sp = GetScenePresence(agent.AgentID); |
3837 | |||
3838 | if (sp != null) | ||
3844 | { | 3839 | { |
3845 | lock (agent) | 3840 | if (!sp.IsChildAgent) |
3846 | { | 3841 | { |
3847 | CapsModule.SetAgentCapsSeeds(agent); | 3842 | // We have a root agent. Is it in transit? |
3848 | CapsModule.CreateCaps(agent.AgentID, agent.circuitcode); | 3843 | if (!EntityTransferModule.IsInTransit(sp.UUID)) |
3849 | } | 3844 | { |
3850 | } | 3845 | // We have a zombie from a crashed session. |
3851 | } | 3846 | // Or the same user is trying to be root twice here, won't work. |
3847 | // Kill it. | ||
3848 | m_log.WarnFormat( | ||
3849 | "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", | ||
3850 | sp.Name, sp.UUID, RegionInfo.RegionName); | ||
3852 | 3851 | ||
3853 | if (sp != null) | 3852 | if (sp.ControllingClient != null) |
3854 | { | 3853 | sp.ControllingClient.Close(true, true); |
3855 | if (!sp.IsChildAgent) | ||
3856 | { | ||
3857 | // We have a zombie from a crashed session. | ||
3858 | // Or the same user is trying to be root twice here, won't work. | ||
3859 | // Kill it. | ||
3860 | m_log.WarnFormat( | ||
3861 | "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", | ||
3862 | sp.Name, sp.UUID, RegionInfo.RegionName); | ||
3863 | |||
3864 | if (sp.ControllingClient != null) | ||
3865 | sp.ControllingClient.Close(true, true); | ||
3866 | 3854 | ||
3867 | sp = null; | 3855 | sp = null; |
3856 | } | ||
3857 | //else | ||
3858 | // m_log.WarnFormat("[SCENE]: Existing root scene presence for {0} {1} in {2}, but agent is in trasit", sp.Name, sp.UUID, RegionInfo.RegionName); | ||
3859 | } | ||
3860 | else | ||
3861 | { | ||
3862 | // We have a child agent here | ||
3863 | sp.DoNotCloseAfterTeleport = true; | ||
3864 | //m_log.WarnFormat("[SCENE]: Existing child scene presence for {0} {1} in {2}", sp.Name, sp.UUID, RegionInfo.RegionName); | ||
3865 | } | ||
3868 | } | 3866 | } |
3869 | } | ||
3870 | 3867 | ||
3871 | lock (agent) | ||
3872 | { | ||
3873 | // Optimistic: add or update the circuit data with the new agent circuit data and teleport flags. | 3868 | // Optimistic: add or update the circuit data with the new agent circuit data and teleport flags. |
3874 | // We need the circuit data here for some of the subsequent checks. (groups, for example) | 3869 | // We need the circuit data here for some of the subsequent checks. (groups, for example) |
3875 | // If the checks fail, we remove the circuit. | 3870 | // If the checks fail, we remove the circuit. |
@@ -3950,7 +3945,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3950 | sp.AdjustKnownSeeds(); | 3945 | sp.AdjustKnownSeeds(); |
3951 | 3946 | ||
3952 | if (CapsModule != null) | 3947 | if (CapsModule != null) |
3948 | { | ||
3953 | CapsModule.SetAgentCapsSeeds(agent); | 3949 | CapsModule.SetAgentCapsSeeds(agent); |
3950 | CapsModule.CreateCaps(agent.AgentID, agent.circuitcode); | ||
3951 | } | ||
3954 | } | 3952 | } |
3955 | } | 3953 | } |
3956 | 3954 | ||
@@ -5829,17 +5827,6 @@ Environment.Exit(1); | |||
5829 | { | 5827 | { |
5830 | reason = "You are banned from the region"; | 5828 | reason = "You are banned from the region"; |
5831 | 5829 | ||
5832 | if (EntityTransferModule.IsInTransit(agentID)) | ||
5833 | { | ||
5834 | reason = "Agent is still in transit from this region"; | ||
5835 | |||
5836 | m_log.WarnFormat( | ||
5837 | "[SCENE]: Denying agent {0} entry into {1} since region still has them registered as in transit", | ||
5838 | agentID, RegionInfo.RegionName); | ||
5839 | |||
5840 | return false; | ||
5841 | } | ||
5842 | |||
5843 | if (Permissions.IsGod(agentID)) | 5830 | if (Permissions.IsGod(agentID)) |
5844 | { | 5831 | { |
5845 | reason = String.Empty; | 5832 | reason = String.Empty; |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c78fe62..c4876b3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -764,6 +764,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
764 | } | 764 | } |
765 | } | 765 | } |
766 | 766 | ||
767 | /// <summary> | ||
768 | /// Used by the entity transfer module to signal when the presence should not be closed because a subsequent | ||
769 | /// teleport is reusing the connection. | ||
770 | /// </summary> | ||
771 | /// <remarks>May be refactored or move somewhere else soon.</remarks> | ||
772 | public bool DoNotCloseAfterTeleport { get; set; } | ||
773 | |||
767 | private float m_speedModifier = 1.0f; | 774 | private float m_speedModifier = 1.0f; |
768 | 775 | ||
769 | public float SpeedModifier | 776 | public float SpeedModifier |
@@ -1541,11 +1548,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1541 | client.Name, Scene.RegionInfo.RegionName, AbsolutePosition); | 1548 | client.Name, Scene.RegionInfo.RegionName, AbsolutePosition); |
1542 | 1549 | ||
1543 | // Make sure it's not a login agent. We don't want to wait for updates during login | 1550 | // Make sure it's not a login agent. We don't want to wait for updates during login |
1544 | if ((m_teleportFlags & TeleportFlags.ViaLogin) == 0) | 1551 | if (PresenceType != PresenceType.Npc && (m_teleportFlags & TeleportFlags.ViaLogin) == 0) |
1552 | { | ||
1545 | // Let's wait until UpdateAgent (called by departing region) is done | 1553 | // Let's wait until UpdateAgent (called by departing region) is done |
1546 | if (!WaitForUpdateAgent(client)) | 1554 | if (!WaitForUpdateAgent(client)) |
1547 | // The sending region never sent the UpdateAgent data, we have to refuse | 1555 | // The sending region never sent the UpdateAgent data, we have to refuse |
1548 | return; | 1556 | return; |
1557 | } | ||
1549 | 1558 | ||
1550 | Vector3 look = Velocity; | 1559 | Vector3 look = Velocity; |
1551 | 1560 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index bbfbbfc..bbe34d2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs | |||
@@ -119,7 +119,20 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
119 | 119 | ||
120 | UUID spUuid = TestHelpers.ParseTail(0x1); | 120 | UUID spUuid = TestHelpers.ParseTail(0x1); |
121 | 121 | ||
122 | // The etm is only invoked by this test to check whether an agent is still in transit if there is a dupe | ||
123 | EntityTransferModule etm = new EntityTransferModule(); | ||
124 | |||
125 | IConfigSource config = new IniConfigSource(); | ||
126 | IConfig modulesConfig = config.AddConfig("Modules"); | ||
127 | modulesConfig.Set("EntityTransferModule", etm.Name); | ||
128 | IConfig entityTransferConfig = config.AddConfig("EntityTransfer"); | ||
129 | |||
130 | // In order to run a single threaded regression test we do not want the entity transfer module waiting | ||
131 | // for a callback from the destination scene before removing its avatar data. | ||
132 | entityTransferConfig.Set("wait_for_callback", false); | ||
133 | |||
122 | TestScene scene = new SceneHelpers().SetupScene(); | 134 | TestScene scene = new SceneHelpers().SetupScene(); |
135 | SceneHelpers.SetupSceneModules(scene, config, etm); | ||
123 | SceneHelpers.AddScenePresence(scene, spUuid); | 136 | SceneHelpers.AddScenePresence(scene, spUuid); |
124 | SceneHelpers.AddScenePresence(scene, spUuid); | 137 | SceneHelpers.AddScenePresence(scene, spUuid); |
125 | 138 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index 297c66b..afd2779 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | |||
@@ -136,6 +136,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
136 | SceneHelpers.SetupSceneModules(sceneB, config, etmB); | 136 | SceneHelpers.SetupSceneModules(sceneB, config, etmB); |
137 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); | 137 | SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); |
138 | 138 | ||
139 | // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour | ||
140 | lscm.ServiceVersion = "SIMULATION/0.1"; | ||
141 | |||
139 | Vector3 teleportPosition = new Vector3(10, 11, 12); | 142 | Vector3 teleportPosition = new Vector3(10, 11, 12); |
140 | Vector3 teleportLookAt = new Vector3(20, 21, 22); | 143 | Vector3 teleportLookAt = new Vector3(20, 21, 22); |
141 | 144 | ||
@@ -454,6 +457,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
454 | SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA); | 457 | SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA); |
455 | SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB); | 458 | SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB); |
456 | 459 | ||
460 | // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour | ||
461 | lscm.ServiceVersion = "SIMULATION/0.1"; | ||
462 | |||
457 | Vector3 teleportPosition = new Vector3(10, 11, 12); | 463 | Vector3 teleportPosition = new Vector3(10, 11, 12); |
458 | Vector3 teleportLookAt = new Vector3(20, 21, 22); | 464 | Vector3 teleportLookAt = new Vector3(20, 21, 22); |
459 | 465 | ||