aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs200
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs100
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs164
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs104
4 files changed, 568 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
new file mode 100644
index 0000000..d78daf9
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
@@ -0,0 +1,200 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27using System;
28using System.Collections.Generic;
29using System.Reflection;
30
31using OpenSim.Region.Framework.Interfaces;
32using OpenSim.Region.Framework.Scenes;
33using OpenSim.Server.Base;
34using OpenSim.Services.Interfaces;
35using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
36
37using OpenMetaverse;
38using log4net;
39using Nini.Config;
40
41namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
42{
43 public class LocalPresenceServicesConnector : ISharedRegionModule, IPresenceService
44 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46
47 private bool m_Enabled = false;
48
49 private PresenceDetector m_PresenceDetector;
50 private IPresenceService m_PresenceService;
51
52 public LocalPresenceServicesConnector()
53 {
54 }
55
56 public LocalPresenceServicesConnector(IConfigSource source)
57 {
58 Initialise(source);
59 }
60
61 #region ISharedRegionModule
62
63 public Type ReplaceableInterface
64 {
65 get { return null; }
66 }
67
68 public string Name
69 {
70 get { return "LocalPresenceServicesConnector"; }
71 }
72
73 public void Initialise(IConfigSource source)
74 {
75 IConfig moduleConfig = source.Configs["Modules"];
76 if (moduleConfig != null)
77 {
78 string name = moduleConfig.GetString("PresenceServices", "");
79 if (name == Name)
80 {
81 IConfig inventoryConfig = source.Configs["PresenceService"];
82 if (inventoryConfig == null)
83 {
84 m_log.Error("[LOCAL PRESENCE CONNECTOR]: PresenceService missing from OpenSim.ini");
85 return;
86 }
87
88 string serviceDll = inventoryConfig.GetString("LocalServiceModule", String.Empty);
89
90 if (serviceDll == String.Empty)
91 {
92 m_log.Error("[LOCAL PRESENCE CONNECTOR]: No LocalServiceModule named in section PresenceService");
93 return;
94 }
95
96 Object[] args = new Object[] { source };
97 m_log.DebugFormat("[LOCAL PRESENCE CONNECTOR]: Service dll = {0}", serviceDll);
98
99 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(serviceDll, args);
100
101 if (m_PresenceService == null)
102 {
103 m_log.Error("[LOCAL PRESENCE CONNECTOR]: Can't load presence service");
104 //return;
105 throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's");
106 }
107
108 //Init(source);
109
110 m_PresenceDetector = new PresenceDetector(this);
111
112 m_Enabled = true;
113 m_log.Info("[LOCAL PRESENCE CONNECTOR]: Local presence connector enabled");
114 }
115 }
116 }
117
118 public void PostInitialise()
119 {
120 }
121
122 public void Close()
123 {
124 }
125
126 public void AddRegion(Scene scene)
127 {
128 if (!m_Enabled)
129 return;
130
131 // m_log.DebugFormat(
132 // "[LOCAL PRESENCE CONNECTOR]: Registering IPresenceService to scene {0}", scene.RegionInfo.RegionName);
133
134 scene.RegisterModuleInterface<IPresenceService>(this);
135 m_PresenceDetector.AddRegion(scene);
136
137 m_log.InfoFormat("[LOCAL PRESENCE CONNECTOR]: Enabled local presence for region {0}", scene.RegionInfo.RegionName);
138
139 }
140
141 public void RemoveRegion(Scene scene)
142 {
143 if (!m_Enabled)
144 return;
145
146 m_PresenceDetector.RemoveRegion(scene);
147 }
148
149 public void RegionLoaded(Scene scene)
150 {
151 if (!m_Enabled)
152 return;
153
154 }
155
156 #endregion
157
158 #region IPresenceService
159
160 public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
161 {
162 m_log.Warn("[LOCAL PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators");
163 return false;
164 }
165
166 public bool LogoutAgent(UUID sessionID, Vector3 position, Vector3 lookat)
167 {
168 return m_PresenceService.LogoutAgent(sessionID, position, lookat);
169 }
170
171
172 public bool LogoutRegionAgents(UUID regionID)
173 {
174 return m_PresenceService.LogoutRegionAgents(regionID);
175 }
176
177 public bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt)
178 {
179 return m_PresenceService.ReportAgent(sessionID, regionID, position, lookAt);
180 }
181
182 public PresenceInfo GetAgent(UUID sessionID)
183 {
184 return m_PresenceService.GetAgent(sessionID);
185 }
186
187 public PresenceInfo[] GetAgents(string[] userIDs)
188 {
189 return m_PresenceService.GetAgents(userIDs);
190 }
191
192 public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt)
193 {
194 return m_PresenceService.SetHomeLocation(userID, regionID, position, lookAt);
195 }
196
197 #endregion
198
199 }
200}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
new file mode 100644
index 0000000..891fc14
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
@@ -0,0 +1,100 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27using System;
28using System.Collections.Generic;
29using System.Reflection;
30
31using OpenSim.Framework;
32using OpenSim.Region.Framework.Scenes;
33using OpenSim.Services.Interfaces;
34
35using OpenMetaverse;
36using log4net;
37
38namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
39{
40 public class PresenceDetector
41 {
42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
43
44 private IPresenceService m_PresenceService;
45 private Scene m_aScene;
46
47 public PresenceDetector(IPresenceService presenceservice)
48 {
49 m_PresenceService = presenceservice;
50 }
51
52 public void AddRegion(Scene scene)
53 {
54 scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
55 scene.EventManager.OnNewClient += OnNewClient;
56
57 m_PresenceService.LogoutRegionAgents(scene.RegionInfo.RegionID);
58
59 if (m_aScene == null)
60 m_aScene = scene;
61 }
62
63 public void RemoveRegion(Scene scene)
64 {
65 scene.EventManager.OnMakeRootAgent -= OnMakeRootAgent;
66 scene.EventManager.OnNewClient -= OnNewClient;
67
68 m_PresenceService.LogoutRegionAgents(scene.RegionInfo.RegionID);
69
70 }
71
72 public void OnMakeRootAgent(ScenePresence sp)
73 {
74 m_log.DebugFormat("[PRESENCE DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName);
75 m_PresenceService.ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat);
76 }
77
78 public void OnNewClient(IClientAPI client)
79 {
80 client.OnLogout += OnLogout;
81 }
82
83 public void OnLogout(IClientAPI client)
84 {
85 client.OnLogout -= OnLogout;
86
87 ScenePresence sp = null;
88 Vector3 position = new Vector3(128, 128, 0);
89 Vector3 lookat = new Vector3(0, 1, 0);
90
91 if (m_aScene.TryGetAvatar(client.AgentId, out sp))
92 {
93 position = sp.AbsolutePosition;
94 lookat = sp.Lookat;
95 }
96 m_PresenceService.LogoutAgent(client.SessionId, position, lookat);
97
98 }
99 }
100}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
new file mode 100644
index 0000000..865f99e
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
@@ -0,0 +1,164 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27using System;
28using System.Collections.Generic;
29using System.Reflection;
30
31using OpenSim.Region.Framework.Interfaces;
32using OpenSim.Region.Framework.Scenes;
33using OpenSim.Server.Base;
34using OpenSim.Services.Interfaces;
35using OpenSim.Services.Connectors;
36using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
37
38using OpenMetaverse;
39using log4net;
40using Nini.Config;
41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
43{
44 public class RemotePresenceServicesConnector : ISharedRegionModule, IPresenceService
45 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47
48 #region ISharedRegionModule
49
50 private bool m_Enabled = false;
51
52 private PresenceDetector m_PresenceDetector;
53 private IPresenceService m_RemoteConnector;
54
55 public Type ReplaceableInterface
56 {
57 get { return null; }
58 }
59
60 public string Name
61 {
62 get { return "RemotePresenceServicesConnector"; }
63 }
64
65 public void Initialise(IConfigSource source)
66 {
67 IConfig moduleConfig = source.Configs["Modules"];
68 if (moduleConfig != null)
69 {
70 string name = moduleConfig.GetString("PresenceServices", "");
71 if (name == Name)
72 {
73 m_RemoteConnector = new PresenceServicesConnector(source);
74
75 m_Enabled = true;
76
77 m_PresenceDetector = new PresenceDetector(this);
78
79 m_log.Info("[INVENTORY CONNECTOR]: Remote presence enabled");
80 }
81 }
82
83 }
84
85 public void PostInitialise()
86 {
87 }
88
89 public void Close()
90 {
91 }
92
93 public void AddRegion(Scene scene)
94 {
95 if (!m_Enabled)
96 return;
97
98 scene.RegisterModuleInterface<IPresenceService>(this);
99 m_PresenceDetector.AddRegion(scene);
100
101 m_log.InfoFormat("[REMOTE PRESENCE CONNECTOR]: Enabled remote presence for region {0}", scene.RegionInfo.RegionName);
102
103 }
104
105 public void RemoveRegion(Scene scene)
106 {
107 if (!m_Enabled)
108 return;
109
110 m_PresenceDetector.RemoveRegion(scene);
111 }
112
113 public void RegionLoaded(Scene scene)
114 {
115 if (!m_Enabled)
116 return;
117
118 }
119
120 #endregion
121
122 #region IPresenceService
123
124 public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
125 {
126 m_log.Warn("[REMOTE PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators");
127 return false;
128 }
129
130 public bool LogoutAgent(UUID sessionID, Vector3 position, Vector3 lookat)
131 {
132 return m_RemoteConnector.LogoutAgent(sessionID, position, lookat);
133 }
134
135
136 public bool LogoutRegionAgents(UUID regionID)
137 {
138 return m_RemoteConnector.LogoutRegionAgents(regionID);
139 }
140
141 public bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt)
142 {
143 return m_RemoteConnector.ReportAgent(sessionID, regionID, position, lookAt);
144 }
145
146 public PresenceInfo GetAgent(UUID sessionID)
147 {
148 return m_RemoteConnector.GetAgent(sessionID);
149 }
150
151 public PresenceInfo[] GetAgents(string[] userIDs)
152 {
153 return m_RemoteConnector.GetAgents(userIDs);
154 }
155
156 public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt)
157 {
158 return m_RemoteConnector.SetHomeLocation(userID, regionID, position, lookAt);
159 }
160
161 #endregion
162
163 }
164}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
new file mode 100644
index 0000000..9ba1bdc
--- /dev/null
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
@@ -0,0 +1,104 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.IO;
31using System.Reflection;
32using System.Threading;
33using log4net.Config;
34using NUnit.Framework;
35using NUnit.Framework.SyntaxHelpers;
36using OpenMetaverse;
37using OpenSim.Framework;
38using Nini.Config;
39
40using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
41using OpenSim.Region.Framework.Scenes;
42using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo;
43using OpenSim.Tests.Common;
44using OpenSim.Tests.Common.Setup;
45
46namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests
47{
48 [TestFixture]
49 public class PresenceConnectorsTests
50 {
51 LocalPresenceServicesConnector m_LocalConnector;
52 private void SetUp()
53 {
54 IConfigSource config = new IniConfigSource();
55 config.AddConfig("Modules");
56 config.AddConfig("PresenceService");
57 config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector");
58 config.Configs["PresenceService"].Set("LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService");
59 config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullPresenceData");
60
61 m_LocalConnector = new LocalPresenceServicesConnector(config);
62 }
63
64 /// <summary>
65 /// Test OpenSim Presence.
66 /// </summary>
67 [Test]
68 public void TestPresenceV0_1()
69 {
70 SetUp();
71
72 string user1 = UUID.Zero.ToString();
73 UUID session1 = UUID.Zero;
74
75 // this is not implemented by this connector
76 //m_LocalConnector.LoginAgent(user1, session1, UUID.Zero);
77 PresenceInfo result = m_LocalConnector.GetAgent(session1);
78 Assert.IsNotNull(result, "Retrieved GetAgent is null");
79 Assert.That(result.UserID, Is.EqualTo(user1), "Retrieved userID does not match");
80 Assert.IsTrue(result.Online, "Agent just logged in but is offline");
81
82 UUID region1 = UUID.Random();
83 bool r = m_LocalConnector.ReportAgent(session1, region1, Vector3.Zero, Vector3.Zero);
84 Assert.IsTrue(r, "First ReportAgent returned false");
85 result = m_LocalConnector.GetAgent(session1);
86 Assert.That(result.RegionID, Is.EqualTo(region1), "Agent is not in the right region (region1)");
87
88 UUID region2 = UUID.Random();
89 r = m_LocalConnector.ReportAgent(session1, region2, Vector3.Zero, Vector3.Zero);
90 Assert.IsTrue(r, "Second ReportAgent returned false");
91 result = m_LocalConnector.GetAgent(session1);
92 Assert.That(result.RegionID, Is.EqualTo(region2), "Agent is not in the right region (region2)");
93
94 r = m_LocalConnector.LogoutAgent(session1, Vector3.Zero, Vector3.UnitY);
95 Assert.IsTrue(r, "LogoutAgent returned false");
96 result = m_LocalConnector.GetAgent(session1);
97 Assert.IsNotNull(result, "Agent session disappeared from storage after logout");
98 Assert.IsFalse(result.Online, "Agent is reported to be Online after logout");
99
100 r = m_LocalConnector.ReportAgent(session1, region1, Vector3.Zero, Vector3.Zero);
101 Assert.IsFalse(r, "ReportAgent of non-logged in user returned true");
102 }
103 }
104}