diff options
Diffstat (limited to 'OpenSim')
10 files changed, 287 insertions, 104 deletions
diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs index e5a8ebd..1ccabcc 100644 --- a/OpenSim/Data/IPresenceData.cs +++ b/OpenSim/Data/IPresenceData.cs | |||
@@ -32,10 +32,12 @@ using OpenSim.Framework; | |||
32 | 32 | ||
33 | namespace OpenSim.Data | 33 | namespace OpenSim.Data |
34 | { | 34 | { |
35 | public struct PresenceData | 35 | // This MUST be a ref type! |
36 | public class PresenceData | ||
36 | { | 37 | { |
37 | public UUID UUID; | 38 | public UUID PrincipalID; |
38 | public UUID currentRegion; | 39 | public UUID RegionID; |
40 | public UUID SessionID; | ||
39 | public Dictionary<string, string> Data; | 41 | public Dictionary<string, string> Data; |
40 | } | 42 | } |
41 | 43 | ||
@@ -46,11 +48,9 @@ namespace OpenSim.Data | |||
46 | { | 48 | { |
47 | bool Store(PresenceData data); | 49 | bool Store(PresenceData data); |
48 | 50 | ||
49 | PresenceData Get(UUID principalID); | 51 | PresenceData Get(UUID sessionID); |
50 | 52 | void LogoutRegionAgents(UUID regionID); | |
51 | bool SetUserDataItem(UUID principalID, string item, string value); | 53 | bool ReportAgent(UUID sessionID, UUID regionID, string position, string lookAt); |
52 | bool SetRegionDataItem(UUID principalID, string item, string value); | 54 | PresenceData[] Get(string field, string data); |
53 | |||
54 | bool Delete(UUID regionID); | ||
55 | } | 55 | } |
56 | } | 56 | } |
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs new file mode 100644 index 0000000..95619a5 --- /dev/null +++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs | |||
@@ -0,0 +1,93 @@ | |||
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.Data; | ||
31 | using System.Reflection; | ||
32 | using System.Threading; | ||
33 | using log4net; | ||
34 | using OpenMetaverse; | ||
35 | using OpenSim.Framework; | ||
36 | using MySql.Data.MySqlClient; | ||
37 | |||
38 | namespace OpenSim.Data.MySQL | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// A MySQL Interface for the Grid Server | ||
42 | /// </summary> | ||
43 | public class MySQLPresenceData : MySQLGenericTableHandler<PresenceData>, | ||
44 | IPresenceData | ||
45 | { | ||
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | |||
48 | public MySQLPresenceData(string connectionString, string realm) : | ||
49 | base(connectionString, realm, "Presence") | ||
50 | { | ||
51 | } | ||
52 | |||
53 | public PresenceData Get(UUID sessionID) | ||
54 | { | ||
55 | PresenceData[] ret = Get("SessionID", | ||
56 | sessionID.ToString()); | ||
57 | |||
58 | if (ret.Length == 0) | ||
59 | return null; | ||
60 | |||
61 | return ret[0]; | ||
62 | } | ||
63 | |||
64 | public void LogoutRegionAgents(UUID regionID) | ||
65 | { | ||
66 | MySqlCommand cmd = new MySqlCommand(); | ||
67 | |||
68 | cmd.CommandText = String.Format("update {0} set Online='false' where `RegionID`=?RegionID", m_Realm); | ||
69 | |||
70 | cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); | ||
71 | |||
72 | ExecuteNonQuery(cmd); | ||
73 | } | ||
74 | |||
75 | public bool ReportAgent(UUID sessionID, UUID regionID, string position, | ||
76 | string lookAt) | ||
77 | { | ||
78 | MySqlCommand cmd = new MySqlCommand(); | ||
79 | |||
80 | cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, Position=?Position, LookAt=?LookAt', Online='true' where `SessionID`=?SessionID", m_Realm); | ||
81 | |||
82 | cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString()); | ||
83 | cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); | ||
84 | cmd.Parameters.AddWithValue("?Position", position); | ||
85 | cmd.Parameters.AddWithValue("?LookAt", lookAt); | ||
86 | |||
87 | if (ExecuteNonQuery(cmd) == 0) | ||
88 | return false; | ||
89 | |||
90 | return true; | ||
91 | } | ||
92 | } | ||
93 | } | ||
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index 0964caa..413a078 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs | |||
@@ -160,9 +160,9 @@ namespace OpenSim.Server.Base | |||
160 | } | 160 | } |
161 | } | 161 | } |
162 | 162 | ||
163 | public static Dictionary<string, string> ParseQueryString(string query) | 163 | public static Dictionary<string, object> ParseQueryString(string query) |
164 | { | 164 | { |
165 | Dictionary<string, string> result = new Dictionary<string, string>(); | 165 | Dictionary<string, object> result = new Dictionary<string, object>(); |
166 | string[] terms = query.Split(new char[] {'&'}); | 166 | string[] terms = query.Split(new char[] {'&'}); |
167 | 167 | ||
168 | if (terms.Length == 0) | 168 | if (terms.Length == 0) |
@@ -186,17 +186,17 @@ namespace OpenSim.Server.Base | |||
186 | return result; | 186 | return result; |
187 | } | 187 | } |
188 | 188 | ||
189 | public static string BuildQueryString(Dictionary<string, string> data) | 189 | public static string BuildQueryString(Dictionary<string, object> data) |
190 | { | 190 | { |
191 | string qstring = String.Empty; | 191 | string qstring = String.Empty; |
192 | 192 | ||
193 | foreach (KeyValuePair<string, string> kvp in data) | 193 | foreach (KeyValuePair<string, object> kvp in data) |
194 | { | 194 | { |
195 | string part; | 195 | string part; |
196 | if (kvp.Value != String.Empty) | 196 | if (kvp.Value.ToString() != String.Empty) |
197 | { | 197 | { |
198 | part = System.Web.HttpUtility.UrlEncode(kvp.Key) + | 198 | part = System.Web.HttpUtility.UrlEncode(kvp.Key) + |
199 | "=" + System.Web.HttpUtility.UrlEncode(kvp.Value); | 199 | "=" + System.Web.HttpUtility.UrlEncode(kvp.Value.ToString()); |
200 | } | 200 | } |
201 | else | 201 | else |
202 | { | 202 | { |
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs index 490a13a..47bc860 100644 --- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs | |||
@@ -86,14 +86,14 @@ namespace OpenSim.Server.Handlers.Authentication | |||
86 | 86 | ||
87 | private byte[] DoPlainMethods(string body) | 87 | private byte[] DoPlainMethods(string body) |
88 | { | 88 | { |
89 | Dictionary<string, string> request = | 89 | Dictionary<string, object> request = |
90 | ServerUtils.ParseQueryString(body); | 90 | ServerUtils.ParseQueryString(body); |
91 | 91 | ||
92 | int lifetime = 30; | 92 | int lifetime = 30; |
93 | 93 | ||
94 | if (request.ContainsKey("LIFETIME")) | 94 | if (request.ContainsKey("LIFETIME")) |
95 | { | 95 | { |
96 | lifetime = Convert.ToInt32(request["LIFETIME"]); | 96 | lifetime = Convert.ToInt32(request["LIFETIME"].ToString()); |
97 | if (lifetime > 30) | 97 | if (lifetime > 30) |
98 | lifetime = 30; | 98 | lifetime = 30; |
99 | } | 99 | } |
@@ -103,12 +103,12 @@ namespace OpenSim.Server.Handlers.Authentication | |||
103 | if (!request.ContainsKey("PRINCIPAL")) | 103 | if (!request.ContainsKey("PRINCIPAL")) |
104 | return FailureResult(); | 104 | return FailureResult(); |
105 | 105 | ||
106 | string method = request["METHOD"]; | 106 | string method = request["METHOD"].ToString(); |
107 | 107 | ||
108 | UUID principalID; | 108 | UUID principalID; |
109 | string token; | 109 | string token; |
110 | 110 | ||
111 | if (!UUID.TryParse(request["PRINCIPAL"], out principalID)) | 111 | if (!UUID.TryParse(request["PRINCIPAL"].ToString(), out principalID)) |
112 | return FailureResult(); | 112 | return FailureResult(); |
113 | 113 | ||
114 | switch (method) | 114 | switch (method) |
@@ -117,7 +117,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
117 | if (!request.ContainsKey("PASSWORD")) | 117 | if (!request.ContainsKey("PASSWORD")) |
118 | return FailureResult(); | 118 | return FailureResult(); |
119 | 119 | ||
120 | token = m_AuthenticationService.Authenticate(principalID, request["PASSWORD"], lifetime); | 120 | token = m_AuthenticationService.Authenticate(principalID, request["PASSWORD"].ToString(), lifetime); |
121 | 121 | ||
122 | if (token != String.Empty) | 122 | if (token != String.Empty) |
123 | return SuccessResult(token); | 123 | return SuccessResult(token); |
@@ -126,7 +126,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
126 | if (!request.ContainsKey("TOKEN")) | 126 | if (!request.ContainsKey("TOKEN")) |
127 | return FailureResult(); | 127 | return FailureResult(); |
128 | 128 | ||
129 | if (m_AuthenticationService.Verify(principalID, request["TOKEN"], lifetime)) | 129 | if (m_AuthenticationService.Verify(principalID, request["TOKEN"].ToString(), lifetime)) |
130 | return SuccessResult(); | 130 | return SuccessResult(); |
131 | 131 | ||
132 | return FailureResult(); | 132 | return FailureResult(); |
@@ -134,7 +134,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
134 | if (!request.ContainsKey("TOKEN")) | 134 | if (!request.ContainsKey("TOKEN")) |
135 | return FailureResult(); | 135 | return FailureResult(); |
136 | 136 | ||
137 | if (m_AuthenticationService.Release(principalID, request["TOKEN"])) | 137 | if (m_AuthenticationService.Release(principalID, request["TOKEN"].ToString())) |
138 | return SuccessResult(); | 138 | return SuccessResult(); |
139 | 139 | ||
140 | return FailureResult(); | 140 | return FailureResult(); |
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index 433ed0b..d99b791 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | |||
@@ -69,13 +69,13 @@ namespace OpenSim.Server.Handlers.Grid | |||
69 | 69 | ||
70 | try | 70 | try |
71 | { | 71 | { |
72 | Dictionary<string, string> request = | 72 | Dictionary<string, object> request = |
73 | ServerUtils.ParseQueryString(body); | 73 | ServerUtils.ParseQueryString(body); |
74 | 74 | ||
75 | if (!request.ContainsKey("METHOD")) | 75 | if (!request.ContainsKey("METHOD")) |
76 | return FailureResult(); | 76 | return FailureResult(); |
77 | 77 | ||
78 | string method = request["METHOD"]; | 78 | string method = request["METHOD"].ToString(); |
79 | 79 | ||
80 | switch (method) | 80 | switch (method) |
81 | { | 81 | { |
@@ -117,22 +117,22 @@ namespace OpenSim.Server.Handlers.Grid | |||
117 | 117 | ||
118 | #region Method-specific handlers | 118 | #region Method-specific handlers |
119 | 119 | ||
120 | byte[] Register(Dictionary<string, string> request) | 120 | byte[] Register(Dictionary<string, object> request) |
121 | { | 121 | { |
122 | UUID scopeID = UUID.Zero; | 122 | UUID scopeID = UUID.Zero; |
123 | if (request.ContainsKey("SCOPEID")) | 123 | if (request.ContainsKey("SCOPEID")) |
124 | UUID.TryParse(request["SCOPEID"], out scopeID); | 124 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
125 | else | 125 | else |
126 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region"); | 126 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region"); |
127 | 127 | ||
128 | int versionNumberMin = 0, versionNumberMax = 0; | 128 | int versionNumberMin = 0, versionNumberMax = 0; |
129 | if (request.ContainsKey("VERSIONMIN")) | 129 | if (request.ContainsKey("VERSIONMIN")) |
130 | Int32.TryParse(request["VERSIONMIN"], out versionNumberMin); | 130 | Int32.TryParse(request["VERSIONMIN"].ToString(), out versionNumberMin); |
131 | else | 131 | else |
132 | m_log.WarnFormat("[GRID HANDLER]: no minimum protocol version in request to register region"); | 132 | m_log.WarnFormat("[GRID HANDLER]: no minimum protocol version in request to register region"); |
133 | 133 | ||
134 | if (request.ContainsKey("VERSIONMAX")) | 134 | if (request.ContainsKey("VERSIONMAX")) |
135 | Int32.TryParse(request["VERSIONMAX"], out versionNumberMax); | 135 | Int32.TryParse(request["VERSIONMAX"].ToString(), out versionNumberMax); |
136 | else | 136 | else |
137 | m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region"); | 137 | m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region"); |
138 | 138 | ||
@@ -147,8 +147,8 @@ namespace OpenSim.Server.Handlers.Grid | |||
147 | GridRegion rinfo = null; | 147 | GridRegion rinfo = null; |
148 | try | 148 | try |
149 | { | 149 | { |
150 | foreach (KeyValuePair<string, string> kvp in request) | 150 | foreach (KeyValuePair<string, object> kvp in request) |
151 | rinfoData[kvp.Key] = kvp.Value; | 151 | rinfoData[kvp.Key] = kvp.Value.ToString(); |
152 | rinfo = new GridRegion(rinfoData); | 152 | rinfo = new GridRegion(rinfoData); |
153 | } | 153 | } |
154 | catch (Exception e) | 154 | catch (Exception e) |
@@ -166,11 +166,11 @@ namespace OpenSim.Server.Handlers.Grid | |||
166 | return FailureResult(); | 166 | return FailureResult(); |
167 | } | 167 | } |
168 | 168 | ||
169 | byte[] Deregister(Dictionary<string, string> request) | 169 | byte[] Deregister(Dictionary<string, object> request) |
170 | { | 170 | { |
171 | UUID regionID = UUID.Zero; | 171 | UUID regionID = UUID.Zero; |
172 | if (request["REGIONID"] != null) | 172 | if (request.ContainsKey("REGIONID")) |
173 | UUID.TryParse(request["REGIONID"], out regionID); | 173 | UUID.TryParse(request["REGIONID"].ToString(), out regionID); |
174 | else | 174 | else |
175 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to deregister region"); | 175 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to deregister region"); |
176 | 176 | ||
@@ -183,17 +183,17 @@ namespace OpenSim.Server.Handlers.Grid | |||
183 | 183 | ||
184 | } | 184 | } |
185 | 185 | ||
186 | byte[] GetNeighbours(Dictionary<string, string> request) | 186 | byte[] GetNeighbours(Dictionary<string, object> request) |
187 | { | 187 | { |
188 | UUID scopeID = UUID.Zero; | 188 | UUID scopeID = UUID.Zero; |
189 | if (request["SCOPEID"] != null) | 189 | if (request.ContainsKey("SCOPEID")) |
190 | UUID.TryParse(request["SCOPEID"], out scopeID); | 190 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
191 | else | 191 | else |
192 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); | 192 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); |
193 | 193 | ||
194 | UUID regionID = UUID.Zero; | 194 | UUID regionID = UUID.Zero; |
195 | if (request["REGIONID"] != null) | 195 | if (request.ContainsKey("REGIONID")) |
196 | UUID.TryParse(request["REGIONID"], out regionID); | 196 | UUID.TryParse(request["REGIONID"].ToString(), out regionID); |
197 | else | 197 | else |
198 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); | 198 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); |
199 | 199 | ||
@@ -221,17 +221,17 @@ namespace OpenSim.Server.Handlers.Grid | |||
221 | 221 | ||
222 | } | 222 | } |
223 | 223 | ||
224 | byte[] GetRegionByUUID(Dictionary<string, string> request) | 224 | byte[] GetRegionByUUID(Dictionary<string, object> request) |
225 | { | 225 | { |
226 | UUID scopeID = UUID.Zero; | 226 | UUID scopeID = UUID.Zero; |
227 | if (request["SCOPEID"] != null) | 227 | if (request.ContainsKey("SCOPEID")) |
228 | UUID.TryParse(request["SCOPEID"], out scopeID); | 228 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
229 | else | 229 | else |
230 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); | 230 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); |
231 | 231 | ||
232 | UUID regionID = UUID.Zero; | 232 | UUID regionID = UUID.Zero; |
233 | if (request["REGIONID"] != null) | 233 | if (request.ContainsKey("REGIONID")) |
234 | UUID.TryParse(request["REGIONID"], out regionID); | 234 | UUID.TryParse(request["REGIONID"].ToString(), out regionID); |
235 | else | 235 | else |
236 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); | 236 | m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); |
237 | 237 | ||
@@ -250,21 +250,21 @@ namespace OpenSim.Server.Handlers.Grid | |||
250 | return encoding.GetBytes(xmlString); | 250 | return encoding.GetBytes(xmlString); |
251 | } | 251 | } |
252 | 252 | ||
253 | byte[] GetRegionByPosition(Dictionary<string, string> request) | 253 | byte[] GetRegionByPosition(Dictionary<string, object> request) |
254 | { | 254 | { |
255 | UUID scopeID = UUID.Zero; | 255 | UUID scopeID = UUID.Zero; |
256 | if (request["SCOPEID"] != null) | 256 | if (request.ContainsKey("SCOPEID")) |
257 | UUID.TryParse(request["SCOPEID"], out scopeID); | 257 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
258 | else | 258 | else |
259 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by position"); | 259 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by position"); |
260 | 260 | ||
261 | int x = 0, y = 0; | 261 | int x = 0, y = 0; |
262 | if (request["X"] != null) | 262 | if (request.ContainsKey("X")) |
263 | Int32.TryParse(request["X"], out x); | 263 | Int32.TryParse(request["X"].ToString(), out x); |
264 | else | 264 | else |
265 | m_log.WarnFormat("[GRID HANDLER]: no X in request to get region by position"); | 265 | m_log.WarnFormat("[GRID HANDLER]: no X in request to get region by position"); |
266 | if (request["Y"] != null) | 266 | if (request.ContainsKey("Y")) |
267 | Int32.TryParse(request["Y"], out y); | 267 | Int32.TryParse(request["Y"].ToString(), out y); |
268 | else | 268 | else |
269 | m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position"); | 269 | m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position"); |
270 | 270 | ||
@@ -283,17 +283,17 @@ namespace OpenSim.Server.Handlers.Grid | |||
283 | return encoding.GetBytes(xmlString); | 283 | return encoding.GetBytes(xmlString); |
284 | } | 284 | } |
285 | 285 | ||
286 | byte[] GetRegionByName(Dictionary<string, string> request) | 286 | byte[] GetRegionByName(Dictionary<string, object> request) |
287 | { | 287 | { |
288 | UUID scopeID = UUID.Zero; | 288 | UUID scopeID = UUID.Zero; |
289 | if (request["SCOPEID"] != null) | 289 | if (request.ContainsKey("SCOPEID")) |
290 | UUID.TryParse(request["SCOPEID"], out scopeID); | 290 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
291 | else | 291 | else |
292 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by name"); | 292 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by name"); |
293 | 293 | ||
294 | string regionName = string.Empty; | 294 | string regionName = string.Empty; |
295 | if (request["NAME"] != null) | 295 | if (request.ContainsKey("NAME")) |
296 | regionName = request["NAME"]; | 296 | regionName = request["NAME"].ToString(); |
297 | else | 297 | else |
298 | m_log.WarnFormat("[GRID HANDLER]: no name in request to get region by name"); | 298 | m_log.WarnFormat("[GRID HANDLER]: no name in request to get region by name"); |
299 | 299 | ||
@@ -312,23 +312,23 @@ namespace OpenSim.Server.Handlers.Grid | |||
312 | return encoding.GetBytes(xmlString); | 312 | return encoding.GetBytes(xmlString); |
313 | } | 313 | } |
314 | 314 | ||
315 | byte[] GetRegionsByName(Dictionary<string, string> request) | 315 | byte[] GetRegionsByName(Dictionary<string, object> request) |
316 | { | 316 | { |
317 | UUID scopeID = UUID.Zero; | 317 | UUID scopeID = UUID.Zero; |
318 | if (request["SCOPEID"] != null) | 318 | if (request.ContainsKey("SCOPEID")) |
319 | UUID.TryParse(request["SCOPEID"], out scopeID); | 319 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
320 | else | 320 | else |
321 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get regions by name"); | 321 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get regions by name"); |
322 | 322 | ||
323 | string regionName = string.Empty; | 323 | string regionName = string.Empty; |
324 | if (request["NAME"] != null) | 324 | if (request.ContainsKey("NAME")) |
325 | regionName = request["NAME"]; | 325 | regionName = request["NAME"].ToString(); |
326 | else | 326 | else |
327 | m_log.WarnFormat("[GRID HANDLER]: no NAME in request to get regions by name"); | 327 | m_log.WarnFormat("[GRID HANDLER]: no NAME in request to get regions by name"); |
328 | 328 | ||
329 | int max = 0; | 329 | int max = 0; |
330 | if (request["MAX"] != null) | 330 | if (request.ContainsKey("MAX")) |
331 | Int32.TryParse(request["MAX"], out max); | 331 | Int32.TryParse(request["MAX"].ToString(), out max); |
332 | else | 332 | else |
333 | m_log.WarnFormat("[GRID HANDLER]: no MAX in request to get regions by name"); | 333 | m_log.WarnFormat("[GRID HANDLER]: no MAX in request to get regions by name"); |
334 | 334 | ||
@@ -355,30 +355,30 @@ namespace OpenSim.Server.Handlers.Grid | |||
355 | return encoding.GetBytes(xmlString); | 355 | return encoding.GetBytes(xmlString); |
356 | } | 356 | } |
357 | 357 | ||
358 | byte[] GetRegionRange(Dictionary<string, string> request) | 358 | byte[] GetRegionRange(Dictionary<string, object> request) |
359 | { | 359 | { |
360 | //m_log.DebugFormat("[GRID HANDLER]: GetRegionRange"); | 360 | //m_log.DebugFormat("[GRID HANDLER]: GetRegionRange"); |
361 | UUID scopeID = UUID.Zero; | 361 | UUID scopeID = UUID.Zero; |
362 | if (request.ContainsKey("SCOPEID")) | 362 | if (request.ContainsKey("SCOPEID")) |
363 | UUID.TryParse(request["SCOPEID"], out scopeID); | 363 | UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); |
364 | else | 364 | else |
365 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range"); | 365 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range"); |
366 | 366 | ||
367 | int xmin = 0, xmax = 0, ymin = 0, ymax = 0; | 367 | int xmin = 0, xmax = 0, ymin = 0, ymax = 0; |
368 | if (request.ContainsKey("XMIN")) | 368 | if (request.ContainsKey("XMIN")) |
369 | Int32.TryParse(request["XMIN"], out xmin); | 369 | Int32.TryParse(request["XMIN"].ToString(), out xmin); |
370 | else | 370 | else |
371 | m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range"); | 371 | m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range"); |
372 | if (request.ContainsKey("XMAX")) | 372 | if (request.ContainsKey("XMAX")) |
373 | Int32.TryParse(request["XMAX"], out xmax); | 373 | Int32.TryParse(request["XMAX"].ToString(), out xmax); |
374 | else | 374 | else |
375 | m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range"); | 375 | m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range"); |
376 | if (request.ContainsKey("YMIN")) | 376 | if (request.ContainsKey("YMIN")) |
377 | Int32.TryParse(request["YMIN"], out ymin); | 377 | Int32.TryParse(request["YMIN"].ToString(), out ymin); |
378 | else | 378 | else |
379 | m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range"); | 379 | m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range"); |
380 | if (request.ContainsKey("YMAX")) | 380 | if (request.ContainsKey("YMAX")) |
381 | Int32.TryParse(request["YMAX"], out ymax); | 381 | Int32.TryParse(request["YMAX"].ToString(), out ymax); |
382 | else | 382 | else |
383 | m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range"); | 383 | m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range"); |
384 | 384 | ||
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs index 2558fa0..d914d32 100644 --- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs | |||
@@ -68,13 +68,13 @@ namespace OpenSim.Server.Handlers.Presence | |||
68 | 68 | ||
69 | try | 69 | try |
70 | { | 70 | { |
71 | Dictionary<string, string> request = | 71 | Dictionary<string, object> request = |
72 | ServerUtils.ParseQueryString(body); | 72 | ServerUtils.ParseQueryString(body); |
73 | 73 | ||
74 | if (!request.ContainsKey("METHOD")) | 74 | if (!request.ContainsKey("METHOD")) |
75 | return FailureResult(); | 75 | return FailureResult(); |
76 | 76 | ||
77 | string method = request["METHOD"]; | 77 | string method = request["METHOD"].ToString(); |
78 | 78 | ||
79 | switch (method) | 79 | switch (method) |
80 | { | 80 | { |
@@ -92,12 +92,11 @@ namespace OpenSim.Server.Handlers.Presence | |||
92 | 92 | ||
93 | } | 93 | } |
94 | 94 | ||
95 | byte[] Report(Dictionary<string, string> request) | 95 | byte[] Report(Dictionary<string, object> request) |
96 | { | 96 | { |
97 | PresenceInfo info = new PresenceInfo(); | 97 | PresenceInfo info = new PresenceInfo(); |
98 | info.Data = new Dictionary<string, string>(); | ||
99 | 98 | ||
100 | if (request["PrincipalID"] == null || request["RegionID"] == null) | 99 | if (!request.ContainsKey("PrincipalID") || !request.ContainsKey("RegionID")) |
101 | return FailureResult(); | 100 | return FailureResult(); |
102 | 101 | ||
103 | if (!UUID.TryParse(request["PrincipalID"].ToString(), | 102 | if (!UUID.TryParse(request["PrincipalID"].ToString(), |
@@ -108,18 +107,9 @@ namespace OpenSim.Server.Handlers.Presence | |||
108 | out info.RegionID)) | 107 | out info.RegionID)) |
109 | return FailureResult(); | 108 | return FailureResult(); |
110 | 109 | ||
111 | foreach (KeyValuePair<string, string> kvp in request) | ||
112 | { | ||
113 | if (kvp.Key == "METHOD" || | ||
114 | kvp.Key == "PrincipalID" || | ||
115 | kvp.Key == "RegionID") | ||
116 | continue; | ||
117 | |||
118 | info.Data[kvp.Key] = kvp.Value; | ||
119 | } | ||
120 | 110 | ||
121 | if (m_PresenceService.Report(info)) | 111 | // if (m_PresenceService.ReportAgent(info)) |
122 | return SuccessResult(); | 112 | // return SuccessResult(); |
123 | 113 | ||
124 | return FailureResult(); | 114 | return FailureResult(); |
125 | } | 115 | } |
diff --git a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs index 50e817e..19bb3e2 100644 --- a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs | |||
@@ -84,7 +84,7 @@ namespace OpenSim.Services.Connectors | |||
84 | 84 | ||
85 | public string Authenticate(UUID principalID, string password, int lifetime) | 85 | public string Authenticate(UUID principalID, string password, int lifetime) |
86 | { | 86 | { |
87 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 87 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
88 | sendData["LIFETIME"] = lifetime.ToString(); | 88 | sendData["LIFETIME"] = lifetime.ToString(); |
89 | sendData["PRINCIPAL"] = principalID.ToString(); | 89 | sendData["PRINCIPAL"] = principalID.ToString(); |
90 | sendData["PASSWORD"] = password; | 90 | sendData["PASSWORD"] = password; |
@@ -106,7 +106,7 @@ namespace OpenSim.Services.Connectors | |||
106 | 106 | ||
107 | public bool Verify(UUID principalID, string token, int lifetime) | 107 | public bool Verify(UUID principalID, string token, int lifetime) |
108 | { | 108 | { |
109 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 109 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
110 | sendData["LIFETIME"] = lifetime.ToString(); | 110 | sendData["LIFETIME"] = lifetime.ToString(); |
111 | sendData["PRINCIPAL"] = principalID.ToString(); | 111 | sendData["PRINCIPAL"] = principalID.ToString(); |
112 | sendData["TOKEN"] = token; | 112 | sendData["TOKEN"] = token; |
@@ -128,7 +128,7 @@ namespace OpenSim.Services.Connectors | |||
128 | 128 | ||
129 | public bool Release(UUID principalID, string token) | 129 | public bool Release(UUID principalID, string token) |
130 | { | 130 | { |
131 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 131 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
132 | sendData["PRINCIPAL"] = principalID.ToString(); | 132 | sendData["PRINCIPAL"] = principalID.ToString(); |
133 | sendData["TOKEN"] = token; | 133 | sendData["TOKEN"] = token; |
134 | 134 | ||
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs index 02f2b79..99aa3fb 100644 --- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs | |||
@@ -89,7 +89,7 @@ namespace OpenSim.Services.Connectors | |||
89 | public virtual bool RegisterRegion(UUID scopeID, GridRegion regionInfo) | 89 | public virtual bool RegisterRegion(UUID scopeID, GridRegion regionInfo) |
90 | { | 90 | { |
91 | Dictionary<string, object> rinfo = regionInfo.ToKeyValuePairs(); | 91 | Dictionary<string, object> rinfo = regionInfo.ToKeyValuePairs(); |
92 | Dictionary<string, string> sendData = new Dictionary<string,string>(); | 92 | Dictionary<string, object> sendData = new Dictionary<string,object>(); |
93 | foreach (KeyValuePair<string, object> kvp in rinfo) | 93 | foreach (KeyValuePair<string, object> kvp in rinfo) |
94 | sendData[kvp.Key] = (string)kvp.Value; | 94 | sendData[kvp.Key] = (string)kvp.Value; |
95 | 95 | ||
@@ -130,7 +130,7 @@ namespace OpenSim.Services.Connectors | |||
130 | 130 | ||
131 | public virtual bool DeregisterRegion(UUID regionID) | 131 | public virtual bool DeregisterRegion(UUID regionID) |
132 | { | 132 | { |
133 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 133 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
134 | 134 | ||
135 | sendData["REGIONID"] = regionID.ToString(); | 135 | sendData["REGIONID"] = regionID.ToString(); |
136 | 136 | ||
@@ -162,7 +162,7 @@ namespace OpenSim.Services.Connectors | |||
162 | 162 | ||
163 | public virtual List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) | 163 | public virtual List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) |
164 | { | 164 | { |
165 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 165 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
166 | 166 | ||
167 | sendData["SCOPEID"] = scopeID.ToString(); | 167 | sendData["SCOPEID"] = scopeID.ToString(); |
168 | sendData["REGIONID"] = regionID.ToString(); | 168 | sendData["REGIONID"] = regionID.ToString(); |
@@ -212,7 +212,7 @@ namespace OpenSim.Services.Connectors | |||
212 | 212 | ||
213 | public virtual GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) | 213 | public virtual GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) |
214 | { | 214 | { |
215 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 215 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
216 | 216 | ||
217 | sendData["SCOPEID"] = scopeID.ToString(); | 217 | sendData["SCOPEID"] = scopeID.ToString(); |
218 | sendData["REGIONID"] = regionID.ToString(); | 218 | sendData["REGIONID"] = regionID.ToString(); |
@@ -258,7 +258,7 @@ namespace OpenSim.Services.Connectors | |||
258 | 258 | ||
259 | public virtual GridRegion GetRegionByPosition(UUID scopeID, int x, int y) | 259 | public virtual GridRegion GetRegionByPosition(UUID scopeID, int x, int y) |
260 | { | 260 | { |
261 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 261 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
262 | 262 | ||
263 | sendData["SCOPEID"] = scopeID.ToString(); | 263 | sendData["SCOPEID"] = scopeID.ToString(); |
264 | sendData["X"] = x.ToString(); | 264 | sendData["X"] = x.ToString(); |
@@ -303,7 +303,7 @@ namespace OpenSim.Services.Connectors | |||
303 | 303 | ||
304 | public virtual GridRegion GetRegionByName(UUID scopeID, string regionName) | 304 | public virtual GridRegion GetRegionByName(UUID scopeID, string regionName) |
305 | { | 305 | { |
306 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 306 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
307 | 307 | ||
308 | sendData["SCOPEID"] = scopeID.ToString(); | 308 | sendData["SCOPEID"] = scopeID.ToString(); |
309 | sendData["NAME"] = regionName; | 309 | sendData["NAME"] = regionName; |
@@ -344,7 +344,7 @@ namespace OpenSim.Services.Connectors | |||
344 | 344 | ||
345 | public virtual List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) | 345 | public virtual List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) |
346 | { | 346 | { |
347 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 347 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
348 | 348 | ||
349 | sendData["SCOPEID"] = scopeID.ToString(); | 349 | sendData["SCOPEID"] = scopeID.ToString(); |
350 | sendData["NAME"] = name; | 350 | sendData["NAME"] = name; |
@@ -396,7 +396,7 @@ namespace OpenSim.Services.Connectors | |||
396 | 396 | ||
397 | public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) | 397 | public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) |
398 | { | 398 | { |
399 | Dictionary<string, string> sendData = new Dictionary<string, string>(); | 399 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
400 | 400 | ||
401 | sendData["SCOPEID"] = scopeID.ToString(); | 401 | sendData["SCOPEID"] = scopeID.ToString(); |
402 | sendData["XMIN"] = xmin.ToString(); | 402 | sendData["XMIN"] = xmin.ToString(); |
diff --git a/OpenSim/Services/Interfaces/IPresenceService.cs b/OpenSim/Services/Interfaces/IPresenceService.cs index aa1c5bf..d86e50c 100644 --- a/OpenSim/Services/Interfaces/IPresenceService.cs +++ b/OpenSim/Services/Interfaces/IPresenceService.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
28 | using OpenSim.Framework; | 29 | using OpenSim.Framework; |
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
@@ -35,11 +36,24 @@ namespace OpenSim.Services.Interfaces | |||
35 | { | 36 | { |
36 | public UUID PrincipalID; | 37 | public UUID PrincipalID; |
37 | public UUID RegionID; | 38 | public UUID RegionID; |
38 | public Dictionary<string, string> Data; | 39 | public UUID SessionID; |
40 | public UUID SecureSessionID; | ||
41 | public bool Online; | ||
42 | public DateTime Login; | ||
43 | public DateTime Logout; | ||
44 | public Vector3 Position; | ||
45 | public Vector3 LookAt; | ||
39 | } | 46 | } |
40 | 47 | ||
41 | public interface IPresenceService | 48 | public interface IPresenceService |
42 | { | 49 | { |
43 | bool Report(PresenceInfo presence); | 50 | bool LoginAgent(UUID principalID, UUID sessionID, UUID secureSessionID); |
51 | bool LogoutAgent(UUID sessionID); | ||
52 | bool LogoutRegionAgents(UUID regionID); | ||
53 | |||
54 | bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt); | ||
55 | |||
56 | PresenceInfo GetAgent(UUID sessionID); | ||
57 | PresenceInfo[] GetAgents(UUID[] PrincipalIDs); | ||
44 | } | 58 | } |
45 | } | 59 | } |
diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 2157462..56ec504 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs | |||
@@ -50,18 +50,104 @@ namespace OpenSim.Services.PresenceService | |||
50 | { | 50 | { |
51 | } | 51 | } |
52 | 52 | ||
53 | public bool Report(PresenceInfo presence) | 53 | public bool LoginAgent(UUID principalID, UUID sessionID, |
54 | UUID secureSessionID) | ||
54 | { | 55 | { |
55 | PresenceData p = new PresenceData(); | 56 | // We have just logged in. If there is any info in the table |
56 | p.Data = new Dictionary<string, string>(); | 57 | // it's OK to overwrite. So we won't bother reading it first |
58 | // | ||
59 | PresenceData data = new PresenceData(); | ||
57 | 60 | ||
58 | p.UUID = presence.PrincipalID; | 61 | data.PrincipalID = principalID; |
59 | p.currentRegion = presence.RegionID; | 62 | data.RegionID = UUID.Zero; |
63 | data.SessionID = sessionID; | ||
64 | data.Data["SecureSessionID"] = secureSessionID.ToString(); | ||
65 | data.Data["Login"] = Util.UnixTimeSinceEpoch().ToString(); | ||
66 | |||
67 | m_Database.Store(data); | ||
60 | 68 | ||
61 | foreach (KeyValuePair<string, string> kvp in presence.Data) | 69 | return true; |
62 | p.Data[kvp.Key] = kvp.Value; | 70 | } |
71 | |||
72 | public bool LogoutAgent(UUID sessionID) | ||
73 | { | ||
74 | PresenceData data = m_Database.Get(sessionID); | ||
75 | if (data == null) | ||
76 | return false; | ||
77 | |||
78 | data.Data["Online"] = "false"; | ||
79 | data.Data["Logout"] = Util.UnixTimeSinceEpoch().ToString(); | ||
80 | |||
81 | m_Database.Store(data); | ||
63 | 82 | ||
64 | return false; | 83 | return false; |
65 | } | 84 | } |
85 | |||
86 | public bool LogoutRegionAgents(UUID regionID) | ||
87 | { | ||
88 | m_Database.LogoutRegionAgents(regionID); | ||
89 | |||
90 | return true; | ||
91 | } | ||
92 | |||
93 | |||
94 | public bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) | ||
95 | { | ||
96 | return m_Database.ReportAgent(sessionID, regionID, | ||
97 | position.ToString(), lookAt.ToString()); | ||
98 | } | ||
99 | |||
100 | public PresenceInfo GetAgent(UUID sessionID) | ||
101 | { | ||
102 | PresenceInfo ret = new PresenceInfo(); | ||
103 | |||
104 | PresenceData data = m_Database.Get(sessionID); | ||
105 | if (data == null) | ||
106 | return null; | ||
107 | |||
108 | ret.PrincipalID = data.PrincipalID; | ||
109 | ret.RegionID = data.RegionID; | ||
110 | ret.SessionID = data.SessionID; | ||
111 | ret.SecureSessionID = new UUID(data.Data["SecureSessionID"]); | ||
112 | ret.Online = bool.Parse(data.Data["Online"]); | ||
113 | ret.Login = Util.ToDateTime(Convert.ToInt32(data.Data["Login"])); | ||
114 | ret.Logout = Util.ToDateTime(Convert.ToInt32(data.Data["Logout"])); | ||
115 | ret.Position = Vector3.Parse(data.Data["Position"]); | ||
116 | ret.LookAt = Vector3.Parse(data.Data["LookAt"]); | ||
117 | |||
118 | return ret; | ||
119 | } | ||
120 | |||
121 | public PresenceInfo[] GetAgents(UUID[] PrincipalIDs) | ||
122 | { | ||
123 | List<PresenceInfo> info = new List<PresenceInfo>(); | ||
124 | |||
125 | foreach (UUID principalID in PrincipalIDs) | ||
126 | { | ||
127 | PresenceData[] data = m_Database.Get("PrincipalID", | ||
128 | principalID.ToString()); | ||
129 | |||
130 | foreach (PresenceData d in data) | ||
131 | { | ||
132 | PresenceInfo ret = new PresenceInfo(); | ||
133 | |||
134 | ret.PrincipalID = d.PrincipalID; | ||
135 | ret.RegionID = d.RegionID; | ||
136 | ret.SessionID = d.SessionID; | ||
137 | ret.SecureSessionID = new UUID(d.Data["SecureSessionID"]); | ||
138 | ret.Online = bool.Parse(d.Data["Online"]); | ||
139 | ret.Login = Util.ToDateTime(Convert.ToInt32( | ||
140 | d.Data["Login"])); | ||
141 | ret.Logout = Util.ToDateTime(Convert.ToInt32( | ||
142 | d.Data["Logout"])); | ||
143 | ret.Position = Vector3.Parse(d.Data["Position"]); | ||
144 | ret.LookAt = Vector3.Parse(d.Data["LookAt"]); | ||
145 | |||
146 | info.Add(ret); | ||
147 | } | ||
148 | } | ||
149 | |||
150 | return info.ToArray(); | ||
151 | } | ||
66 | } | 152 | } |
67 | } | 153 | } |