diff options
author | Diva Canto | 2009-12-30 14:17:18 -0800 |
---|---|---|
committer | Diva Canto | 2009-12-30 14:17:18 -0800 |
commit | 1d2a332b96794e2011b0527cf590c3ceedcd8af4 (patch) | |
tree | ba5f0c01661ef6a60247e35fb15d6d48e12e2fa0 | |
parent | Merge branch 'presence-refactor' of ssh://diva@opensimulator.org/var/git/open... (diff) | |
download | opensim-SC_OLD-1d2a332b96794e2011b0527cf590c3ceedcd8af4.zip opensim-SC_OLD-1d2a332b96794e2011b0527cf590c3ceedcd8af4.tar.gz opensim-SC_OLD-1d2a332b96794e2011b0527cf590c3ceedcd8af4.tar.bz2 opensim-SC_OLD-1d2a332b96794e2011b0527cf590c3ceedcd8af4.tar.xz |
Unit tests for presence. They helped fix a couple of wrongnesses.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/IPresenceData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/Null/NullPresenceData.cs | 223 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs | 104 | ||||
-rw-r--r-- | OpenSim/Services/PresenceService/PresenceService.cs | 32 | ||||
-rw-r--r-- | prebuild.xml | 1 |
6 files changed, 363 insertions, 12 deletions
diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs index 20eb7f6..71d0e31 100644 --- a/OpenSim/Data/IPresenceData.cs +++ b/OpenSim/Data/IPresenceData.cs | |||
@@ -42,7 +42,7 @@ namespace OpenSim.Data | |||
42 | } | 42 | } |
43 | 43 | ||
44 | /// <summary> | 44 | /// <summary> |
45 | /// An interface for connecting to the authentication datastore | 45 | /// An interface for connecting to the presence datastore |
46 | /// </summary> | 46 | /// </summary> |
47 | public interface IPresenceData | 47 | public interface IPresenceData |
48 | { | 48 | { |
diff --git a/OpenSim/Data/Null/NullPresenceData.cs b/OpenSim/Data/Null/NullPresenceData.cs new file mode 100644 index 0000000..52fdc6f --- /dev/null +++ b/OpenSim/Data/Null/NullPresenceData.cs | |||
@@ -0,0 +1,223 @@ | |||
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 | |||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using OpenMetaverse; | ||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Data; | ||
34 | |||
35 | namespace OpenSim.Data.Null | ||
36 | { | ||
37 | public class NullPresenceData : IPresenceData | ||
38 | { | ||
39 | Dictionary<UUID, PresenceData> m_presenceData = new Dictionary<UUID, PresenceData>(); | ||
40 | |||
41 | public NullPresenceData(string connectionString, string realm) | ||
42 | { | ||
43 | //Console.WriteLine("[XXX] NullRegionData constructor"); | ||
44 | // Let's stick in a test presence | ||
45 | PresenceData p = new PresenceData(); | ||
46 | p.SessionID = UUID.Zero; | ||
47 | p.UserID = UUID.Zero.ToString(); | ||
48 | p.Data = new Dictionary<string, string>(); | ||
49 | p.Data["Online"] = "true"; | ||
50 | m_presenceData.Add(UUID.Zero, p); | ||
51 | } | ||
52 | |||
53 | public bool Store(PresenceData data) | ||
54 | { | ||
55 | m_presenceData[data.SessionID] = data; | ||
56 | return true; | ||
57 | } | ||
58 | |||
59 | public PresenceData Get(UUID sessionID) | ||
60 | { | ||
61 | if (m_presenceData.ContainsKey(sessionID)) | ||
62 | return m_presenceData[sessionID]; | ||
63 | |||
64 | return null; | ||
65 | } | ||
66 | |||
67 | public void LogoutRegionAgents(UUID regionID) | ||
68 | { | ||
69 | List<UUID> toBeDeleted = new List<UUID>(); | ||
70 | foreach (KeyValuePair<UUID, PresenceData> kvp in m_presenceData) | ||
71 | if (kvp.Value.RegionID == regionID) | ||
72 | toBeDeleted.Add(kvp.Key); | ||
73 | |||
74 | foreach (UUID u in toBeDeleted) | ||
75 | m_presenceData.Remove(u); | ||
76 | } | ||
77 | |||
78 | public bool ReportAgent(UUID sessionID, UUID regionID, string position, string lookAt) | ||
79 | { | ||
80 | if (m_presenceData.ContainsKey(sessionID)) | ||
81 | { | ||
82 | m_presenceData[sessionID].RegionID = regionID; | ||
83 | m_presenceData[sessionID].Data["Position"] = position; | ||
84 | m_presenceData[sessionID].Data["LookAt"] = lookAt; | ||
85 | return true; | ||
86 | } | ||
87 | |||
88 | return false; | ||
89 | } | ||
90 | |||
91 | public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt) | ||
92 | { | ||
93 | bool foundone = false; | ||
94 | foreach (PresenceData p in m_presenceData.Values) | ||
95 | { | ||
96 | if (p.UserID == userID) | ||
97 | { | ||
98 | p.Data["HomeRegionID"] = regionID.ToString(); | ||
99 | p.Data["HomePosition"] = position.ToString(); | ||
100 | p.Data["HomeLookAt"] = lookAt.ToString(); | ||
101 | foundone = true; | ||
102 | } | ||
103 | } | ||
104 | |||
105 | return foundone; | ||
106 | } | ||
107 | |||
108 | public PresenceData[] Get(string field, string data) | ||
109 | { | ||
110 | List<PresenceData> presences = new List<PresenceData>(); | ||
111 | if (field == "UserID") | ||
112 | { | ||
113 | foreach (PresenceData p in m_presenceData.Values) | ||
114 | if (p.UserID == data) | ||
115 | presences.Add(p); | ||
116 | return presences.ToArray(); | ||
117 | } | ||
118 | else if (field == "SessionID") | ||
119 | { | ||
120 | UUID session = UUID.Zero; | ||
121 | if (!UUID.TryParse(data, out session)) | ||
122 | return presences.ToArray(); | ||
123 | |||
124 | if (m_presenceData.ContainsKey(session)) | ||
125 | { | ||
126 | presences.Add(m_presenceData[session]); | ||
127 | return presences.ToArray(); | ||
128 | } | ||
129 | } | ||
130 | else if (field == "RegionID") | ||
131 | { | ||
132 | UUID region = UUID.Zero; | ||
133 | if (!UUID.TryParse(data, out region)) | ||
134 | return presences.ToArray(); | ||
135 | foreach (PresenceData p in m_presenceData.Values) | ||
136 | if (p.RegionID == region) | ||
137 | presences.Add(p); | ||
138 | return presences.ToArray(); | ||
139 | } | ||
140 | else | ||
141 | { | ||
142 | foreach (PresenceData p in m_presenceData.Values) | ||
143 | { | ||
144 | if (p.Data.ContainsKey(field) && p.Data[field] == data) | ||
145 | presences.Add(p); | ||
146 | } | ||
147 | return presences.ToArray(); | ||
148 | } | ||
149 | |||
150 | return presences.ToArray(); | ||
151 | } | ||
152 | |||
153 | public void Prune(string userID) | ||
154 | { | ||
155 | List<UUID> deleteSessions = new List<UUID>(); | ||
156 | int online = 0; | ||
157 | |||
158 | foreach (KeyValuePair<UUID, PresenceData> kvp in m_presenceData) | ||
159 | { | ||
160 | bool on = false; | ||
161 | if (bool.TryParse(kvp.Value.Data["Online"], out on) && on) | ||
162 | online++; | ||
163 | else | ||
164 | deleteSessions.Add(kvp.Key); | ||
165 | } | ||
166 | if (online == 0 && deleteSessions.Count > 0) | ||
167 | deleteSessions.RemoveAt(0); | ||
168 | |||
169 | foreach (UUID s in deleteSessions) | ||
170 | m_presenceData.Remove(s); | ||
171 | |||
172 | } | ||
173 | |||
174 | public bool Delete(string field, string data) | ||
175 | { | ||
176 | List<UUID> presences = new List<UUID>(); | ||
177 | if (field == "UserID") | ||
178 | { | ||
179 | foreach (KeyValuePair<UUID, PresenceData> p in m_presenceData) | ||
180 | if (p.Value.UserID == data) | ||
181 | presences.Add(p.Key); | ||
182 | } | ||
183 | else if (field == "SessionID") | ||
184 | { | ||
185 | UUID session = UUID.Zero; | ||
186 | if (UUID.TryParse(data, out session)) | ||
187 | { | ||
188 | if (m_presenceData.ContainsKey(session)) | ||
189 | { | ||
190 | presences.Add(session); | ||
191 | } | ||
192 | } | ||
193 | } | ||
194 | else if (field == "RegionID") | ||
195 | { | ||
196 | UUID region = UUID.Zero; | ||
197 | if (UUID.TryParse(data, out region)) | ||
198 | { | ||
199 | foreach (KeyValuePair<UUID, PresenceData> p in m_presenceData) | ||
200 | if (p.Value.RegionID == region) | ||
201 | presences.Add(p.Key); | ||
202 | } | ||
203 | } | ||
204 | else | ||
205 | { | ||
206 | foreach (KeyValuePair<UUID, PresenceData> p in m_presenceData) | ||
207 | { | ||
208 | if (p.Value.Data.ContainsKey(field) && p.Value.Data[field] == data) | ||
209 | presences.Add(p.Key); | ||
210 | } | ||
211 | } | ||
212 | |||
213 | foreach (UUID u in presences) | ||
214 | m_presenceData.Remove(u); | ||
215 | |||
216 | if (presences.Count == 0) | ||
217 | return false; | ||
218 | |||
219 | return true; | ||
220 | } | ||
221 | |||
222 | } | ||
223 | } | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs index 644d755..2cb18c7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs | |||
@@ -44,13 +44,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | #region ISharedRegionModule | ||
48 | |||
49 | private bool m_Enabled = false; | 47 | private bool m_Enabled = false; |
50 | 48 | ||
51 | private PresenceDetector m_PresenceDetector; | 49 | private PresenceDetector m_PresenceDetector; |
52 | private IPresenceService m_PresenceService; | 50 | private IPresenceService m_PresenceService; |
53 | 51 | ||
52 | public LocalPresenceServicesConnector() | ||
53 | { | ||
54 | } | ||
55 | |||
56 | public LocalPresenceServicesConnector(IConfigSource source) | ||
57 | { | ||
58 | Initialise(source); | ||
59 | } | ||
60 | |||
61 | #region ISharedRegionModule | ||
62 | |||
54 | public Type ReplaceableInterface | 63 | public Type ReplaceableInterface |
55 | { | 64 | { |
56 | get { return null; } | 65 | get { return null; } |
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..ebb2c3e --- /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 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.IO; | ||
31 | using System.Reflection; | ||
32 | using System.Threading; | ||
33 | using log4net.Config; | ||
34 | using NUnit.Framework; | ||
35 | using NUnit.Framework.SyntaxHelpers; | ||
36 | using OpenMetaverse; | ||
37 | using OpenSim.Framework; | ||
38 | using Nini.Config; | ||
39 | |||
40 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence; | ||
41 | using OpenSim.Region.Framework.Scenes; | ||
42 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | ||
43 | using OpenSim.Tests.Common; | ||
44 | using OpenSim.Tests.Common.Setup; | ||
45 | |||
46 | namespace 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); | ||
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 | } | ||
diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index b3d8194..fc6a6e1 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs | |||
@@ -64,6 +64,7 @@ namespace OpenSim.Services.PresenceService | |||
64 | data.RegionID = UUID.Zero; | 64 | data.RegionID = UUID.Zero; |
65 | data.SessionID = sessionID; | 65 | data.SessionID = sessionID; |
66 | data.Data["SecureSessionID"] = secureSessionID.ToString(); | 66 | data.Data["SecureSessionID"] = secureSessionID.ToString(); |
67 | data.Data["Online"] = "true"; | ||
67 | data.Data["Login"] = Util.UnixTimeSinceEpoch().ToString(); | 68 | data.Data["Login"] = Util.UnixTimeSinceEpoch().ToString(); |
68 | if (d.Length > 0) | 69 | if (d.Length > 0) |
69 | { | 70 | { |
@@ -88,7 +89,6 @@ namespace OpenSim.Services.PresenceService | |||
88 | if (d.Length > 1) | 89 | if (d.Length > 1) |
89 | { | 90 | { |
90 | m_Database.Delete("SessionID", sessionID.ToString()); | 91 | m_Database.Delete("SessionID", sessionID.ToString()); |
91 | return true; | ||
92 | } | 92 | } |
93 | 93 | ||
94 | data.Data["Online"] = "false"; | 94 | data.Data["Online"] = "false"; |
@@ -110,6 +110,12 @@ namespace OpenSim.Services.PresenceService | |||
110 | public bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) | 110 | public bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) |
111 | { | 111 | { |
112 | m_log.DebugFormat("[PRESENCE SERVICE]: ReportAgent with session {0} in region {1}", sessionID, regionID); | 112 | m_log.DebugFormat("[PRESENCE SERVICE]: ReportAgent with session {0} in region {1}", sessionID, regionID); |
113 | PresenceData pdata = m_Database.Get(sessionID); | ||
114 | if (pdata == null) | ||
115 | return false; | ||
116 | if (pdata.Data["Online"] == "false") | ||
117 | return false; | ||
118 | |||
113 | return m_Database.ReportAgent(sessionID, regionID, | 119 | return m_Database.ReportAgent(sessionID, regionID, |
114 | position.ToString(), lookAt.ToString()); | 120 | position.ToString(), lookAt.ToString()); |
115 | } | 121 | } |
@@ -124,14 +130,22 @@ namespace OpenSim.Services.PresenceService | |||
124 | 130 | ||
125 | ret.UserID = data.UserID; | 131 | ret.UserID = data.UserID; |
126 | ret.RegionID = data.RegionID; | 132 | ret.RegionID = data.RegionID; |
127 | ret.Online = bool.Parse(data.Data["Online"]); | 133 | if (data.Data.ContainsKey("Online")) |
128 | ret.Login = Util.ToDateTime(Convert.ToInt32(data.Data["Login"])); | 134 | ret.Online = bool.Parse(data.Data["Online"]); |
129 | ret.Logout = Util.ToDateTime(Convert.ToInt32(data.Data["Logout"])); | 135 | if (data.Data.ContainsKey("Login")) |
130 | ret.Position = Vector3.Parse(data.Data["Position"]); | 136 | ret.Login = Util.ToDateTime(Convert.ToInt32(data.Data["Login"])); |
131 | ret.LookAt = Vector3.Parse(data.Data["LookAt"]); | 137 | if (data.Data.ContainsKey("Logout")) |
132 | ret.HomeRegionID = new UUID(data.Data["HomeRegionID"]); | 138 | ret.Logout = Util.ToDateTime(Convert.ToInt32(data.Data["Logout"])); |
133 | ret.HomePosition = Vector3.Parse(data.Data["HomePosition"]); | 139 | if (data.Data.ContainsKey("Position")) |
134 | ret.HomeLookAt = Vector3.Parse(data.Data["HomeLookAt"]); | 140 | ret.Position = Vector3.Parse(data.Data["Position"]); |
141 | if (data.Data.ContainsKey("LookAt")) | ||
142 | ret.LookAt = Vector3.Parse(data.Data["LookAt"]); | ||
143 | if (data.Data.ContainsKey("HomeRegionID")) | ||
144 | ret.HomeRegionID = new UUID(data.Data["HomeRegionID"]); | ||
145 | if (data.Data.ContainsKey("HomePosition")) | ||
146 | ret.HomePosition = Vector3.Parse(data.Data["HomePosition"]); | ||
147 | if (data.Data.ContainsKey("HomeLookAt")) | ||
148 | ret.HomeLookAt = Vector3.Parse(data.Data["HomeLookAt"]); | ||
135 | 149 | ||
136 | return ret; | 150 | return ret; |
137 | } | 151 | } |
diff --git a/prebuild.xml b/prebuild.xml index 863064a..7e7ce28 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -3274,6 +3274,7 @@ | |||
3274 | <Match path="World/Serialiser/Tests" pattern="*.cs" recurse="true" /> | 3274 | <Match path="World/Serialiser/Tests" pattern="*.cs" recurse="true" /> |
3275 | <Match path="World/Terrain/Tests" pattern="*.cs" recurse="true" /> | 3275 | <Match path="World/Terrain/Tests" pattern="*.cs" recurse="true" /> |
3276 | <Match path="ServiceConnectorsOut/Grid/Tests" pattern="*.cs" recurse="true" /> | 3276 | <Match path="ServiceConnectorsOut/Grid/Tests" pattern="*.cs" recurse="true" /> |
3277 | <Match path="ServiceConnectorsOut/Presence/Tests" pattern="*.cs" recurse="true" /> | ||
3277 | </Files> | 3278 | </Files> |
3278 | </Project> | 3279 | </Project> |
3279 | 3280 | ||