diff options
author | Justin Clarke Casey | 2008-11-28 20:11:17 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-28 20:11:17 +0000 |
commit | dfbec673a4ca24ab683ea403361efa4372cc1e0d (patch) | |
tree | 4a561fa5ce77121f201008e6ea14ff5a0ba48fd4 | |
parent | * Committing a new test, that will fail until someone decides to fix Location... (diff) | |
download | opensim-SC_OLD-dfbec673a4ca24ab683ea403361efa4372cc1e0d.zip opensim-SC_OLD-dfbec673a4ca24ab683ea403361efa4372cc1e0d.tar.gz opensim-SC_OLD-dfbec673a4ca24ab683ea403361efa4372cc1e0d.tar.bz2 opensim-SC_OLD-dfbec673a4ca24ab683ea403361efa4372cc1e0d.tar.xz |
* simplify AddNewClient since making this root without using MakeRootAgent() no longer sets everything up properly
9 files changed, 27 insertions, 20 deletions
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index a852eaf..000a800 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Framework | |||
63 | ClientManager ClientManager { get; } | 63 | ClientManager ClientManager { get; } |
64 | event restart OnRestart; | 64 | event restart OnRestart; |
65 | 65 | ||
66 | void AddNewClient(IClientAPI client, bool child); | 66 | void AddNewClient(IClientAPI client); |
67 | void RemoveClient(UUID agentID); | 67 | void RemoveClient(UUID agentID); |
68 | void CloseAllAgents(uint circuitcode); | 68 | void CloseAllAgents(uint circuitcode); |
69 | 69 | ||
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 7d31c77..1823ccf 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -773,7 +773,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
773 | m_clientPingTimer.Elapsed += CheckClientConnectivity; | 773 | m_clientPingTimer.Elapsed += CheckClientConnectivity; |
774 | m_clientPingTimer.Enabled = true; | 774 | m_clientPingTimer.Enabled = true; |
775 | 775 | ||
776 | m_scene.AddNewClient(this, true); | 776 | m_scene.AddNewClient(this); |
777 | 777 | ||
778 | RefreshGroupMembership(); | 778 | RefreshGroupMembership(); |
779 | } | 779 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs index 4c8ee9c..155b52d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/MockScene.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
51 | public override void Update() {} | 51 | public override void Update() {} |
52 | public override void LoadWorldMap() {} | 52 | public override void LoadWorldMap() {} |
53 | 53 | ||
54 | public override void AddNewClient(IClientAPI client, bool child) | 54 | public override void AddNewClient(IClientAPI client) |
55 | { | 55 | { |
56 | client.OnObjectName += RecordObjectNameCall; | 56 | client.OnObjectName += RecordObjectNameCall; |
57 | } | 57 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index e544703..97442fd 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2229,7 +2229,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2229 | 2229 | ||
2230 | #region Add/Remove Avatar Methods | 2230 | #region Add/Remove Avatar Methods |
2231 | 2231 | ||
2232 | public override void AddNewClient(IClientAPI client, bool child) | 2232 | public override void AddNewClient(IClientAPI client) |
2233 | { | 2233 | { |
2234 | SubscribeToClientEvents(client); | 2234 | SubscribeToClientEvents(client); |
2235 | ScenePresence presence; | 2235 | ScenePresence presence; |
@@ -2261,12 +2261,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
2261 | else | 2261 | else |
2262 | { | 2262 | { |
2263 | m_log.DebugFormat( | 2263 | m_log.DebugFormat( |
2264 | "[SCENE]: Adding new {0} agent {1} {2} in {3}", | 2264 | "[SCENE]: Adding new child agent {0} for new user connection in {1}", |
2265 | (child ? "child" : "root"), client.Name, client.AgentId, RegionInfo.RegionName); | 2265 | client.Name, RegionInfo.RegionName); |
2266 | 2266 | ||
2267 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | 2267 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); |
2268 | 2268 | ||
2269 | CreateAndAddScenePresence(client, child); | 2269 | CreateAndAddScenePresence(client); |
2270 | } | 2270 | } |
2271 | 2271 | ||
2272 | m_LastLogin = System.Environment.TickCount; | 2272 | m_LastLogin = System.Environment.TickCount; |
@@ -2547,17 +2547,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
2547 | } | 2547 | } |
2548 | 2548 | ||
2549 | /// <summary> | 2549 | /// <summary> |
2550 | /// Create a scene presence and add it to this scene. | 2550 | /// Create a child agent scene presence and add it to this scene. |
2551 | /// </summary> | 2551 | /// </summary> |
2552 | /// <param name="client"></param> | 2552 | /// <param name="client"></param> |
2553 | /// <param name="child"></param> | ||
2554 | /// <returns></returns> | 2553 | /// <returns></returns> |
2555 | protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child) | 2554 | protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client) |
2556 | { | 2555 | { |
2557 | AvatarAppearance appearance = null; | 2556 | AvatarAppearance appearance = null; |
2558 | GetAvatarAppearance(client, out appearance); | 2557 | GetAvatarAppearance(client, out appearance); |
2559 | 2558 | ||
2560 | ScenePresence avatar = m_sceneGraph.CreateAndAddScenePresence(client, child, appearance); | 2559 | ScenePresence avatar = m_sceneGraph.CreateAndAddChildScenePresence(client, appearance); |
2561 | 2560 | ||
2562 | return avatar; | 2561 | return avatar; |
2563 | } | 2562 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 7137c2f..6d1e808 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs | |||
@@ -142,14 +142,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
142 | #region Add/Remove Agent/Avatar | 142 | #region Add/Remove Agent/Avatar |
143 | 143 | ||
144 | /// <summary> | 144 | /// <summary> |
145 | /// Register the new client with the scene | 145 | /// Register the new client with the scene. The client starts off as a child agent - the later agent crossing |
146 | /// will promote it to a root agent during login. | ||
146 | /// </summary> | 147 | /// </summary> |
147 | /// <param name="client"></param | 148 | /// <param name="client"></param |
148 | /// <param name="child"></param> | 149 | public abstract void AddNewClient(IClientAPI client); |
149 | public abstract void AddNewClient(IClientAPI client, bool child); | ||
150 | 150 | ||
151 | /// <summary> | 151 | /// <summary> |
152 | /// | 152 | /// Remove a client from the scene |
153 | /// </summary> | 153 | /// </summary> |
154 | /// <param name="agentID"></param> | 154 | /// <param name="agentID"></param> |
155 | public abstract void RemoveClient(UUID agentID); | 155 | public abstract void RemoveClient(UUID agentID); |
diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs index 8c9fdd4..da3be08 100644 --- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs | |||
@@ -574,12 +574,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
574 | } | 574 | } |
575 | } | 575 | } |
576 | 576 | ||
577 | protected internal ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child, AvatarAppearance appearance) | 577 | protected internal ScenePresence CreateAndAddChildScenePresence(IClientAPI client, AvatarAppearance appearance) |
578 | { | 578 | { |
579 | ScenePresence newAvatar = null; | 579 | ScenePresence newAvatar = null; |
580 | 580 | ||
581 | newAvatar = new ScenePresence(client, m_parentScene, m_regInfo, appearance); | 581 | newAvatar = new ScenePresence(client, m_parentScene, m_regInfo, appearance); |
582 | newAvatar.IsChildAgent = child; | 582 | newAvatar.IsChildAgent = true; |
583 | 583 | ||
584 | AddScenePresence(newAvatar); | 584 | AddScenePresence(newAvatar); |
585 | 585 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs index a16c26a..a19dbf7 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
62 | agent.CapsPath = "http://wibble.com"; | 62 | agent.CapsPath = "http://wibble.com"; |
63 | 63 | ||
64 | scene.NewUserConnection(agent); | 64 | scene.NewUserConnection(agent); |
65 | scene.AddNewClient(new TestClient(agent), false); | 65 | scene.AddNewClient(new TestClient(agent)); |
66 | 66 | ||
67 | ScenePresence presence = scene.GetScenePresence(agentId); | 67 | ScenePresence presence = scene.GetScenePresence(agentId); |
68 | 68 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs index 468a4ad..b169d9a 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneTestUtils.cs | |||
@@ -97,9 +97,16 @@ namespace OpenSim.Region.Environment.Scenes.Tests | |||
97 | agent.startpos = Vector3.Zero; | 97 | agent.startpos = Vector3.Zero; |
98 | agent.CapsPath = "http://wibble.com"; | 98 | agent.CapsPath = "http://wibble.com"; |
99 | 99 | ||
100 | // We emulate the proper login sequence here by doing things in three stages | ||
101 | // Stage 1: simulate login by telling the scene to expect a new user connection | ||
100 | scene.NewUserConnection(agent); | 102 | scene.NewUserConnection(agent); |
103 | |||
104 | // Stage 2: add the new client as a child agent to the scene | ||
101 | IClientAPI client = new TestClient(agent); | 105 | IClientAPI client = new TestClient(agent); |
102 | scene.AddNewClient(client, true); | 106 | scene.AddNewClient(client); |
107 | |||
108 | // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance, | ||
109 | // inventory, etc.) | ||
103 | scene.AgentCrossing(agent.AgentID, new Vector3(90, 90, 90), false); | 110 | scene.AgentCrossing(agent.AgentID, new Vector3(90, 90, 90), false); |
104 | 111 | ||
105 | return client; | 112 | return client; |
diff --git a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs index 1bb6cae..0d7919d 100644 --- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs +++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs | |||
@@ -85,7 +85,8 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
85 | for (int i = 0; i < 1; i++) | 85 | for (int i = 0; i < 1; i++) |
86 | { | 86 | { |
87 | MyNpcCharacter m_character = new MyNpcCharacter(m_scene); | 87 | MyNpcCharacter m_character = new MyNpcCharacter(m_scene); |
88 | m_scene.AddNewClient(m_character, false); | 88 | m_scene.AddNewClient(m_character); |
89 | m_scene.AgentCrossing(m_character.AgentId, Vector3.Zero, false); | ||
89 | } | 90 | } |
90 | 91 | ||
91 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 92 | List<ScenePresence> avatars = m_scene.GetAvatars(); |