diff options
author | Melanie | 2009-12-30 22:23:58 +0000 |
---|---|---|
committer | Melanie | 2009-12-30 22:23:58 +0000 |
commit | bda18c33fdb803b20d4edc648f54125f325f941c (patch) | |
tree | b99f2f0464abc09f32cbd8d1d46cfbda4e61311d /OpenSim/Services | |
parent | Some modifications to user service. Query by name is implemented now (diff) | |
parent | Unit tests for presence. They helped fix a couple of wrongnesses. (diff) | |
download | opensim-SC-bda18c33fdb803b20d4edc648f54125f325f941c.zip opensim-SC-bda18c33fdb803b20d4edc648f54125f325f941c.tar.gz opensim-SC-bda18c33fdb803b20d4edc648f54125f325f941c.tar.bz2 opensim-SC-bda18c33fdb803b20d4edc648f54125f325f941c.tar.xz |
Merge branch 'presence-refactor' of melanie@opensimulator.org:/var/git/opensim into presence-refactor
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/PresenceService/PresenceService.cs | 32 |
1 files changed, 23 insertions, 9 deletions
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 | } |