diff options
author | Melanie | 2009-12-28 17:34:42 +0000 |
---|---|---|
committer | Melanie | 2009-12-28 17:34:42 +0000 |
commit | 92a40129b5dfde0d8ef798941f5efb31ca3a73fd (patch) | |
tree | 92f10121b7eb3d592621af7a74ebb6f06cea0858 /OpenSim/Services/PresenceService | |
parent | * Added the new modules to Resources, making them active. (diff) | |
download | opensim-SC_OLD-92a40129b5dfde0d8ef798941f5efb31ca3a73fd.zip opensim-SC_OLD-92a40129b5dfde0d8ef798941f5efb31ca3a73fd.tar.gz opensim-SC_OLD-92a40129b5dfde0d8ef798941f5efb31ca3a73fd.tar.bz2 opensim-SC_OLD-92a40129b5dfde0d8ef798941f5efb31ca3a73fd.tar.xz |
Database and presence changes. Untested
Diffstat (limited to 'OpenSim/Services/PresenceService')
-rw-r--r-- | OpenSim/Services/PresenceService/PresenceService.cs | 48 | ||||
-rw-r--r-- | OpenSim/Services/PresenceService/PresenceServiceBase.cs | 2 |
2 files changed, 23 insertions, 27 deletions
diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 0529d3d..fe36bd0 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Services.PresenceService | |||
50 | { | 50 | { |
51 | } | 51 | } |
52 | 52 | ||
53 | public bool LoginAgent(UUID principalID, UUID sessionID, | 53 | public bool LoginAgent(string userID, UUID sessionID, |
54 | UUID secureSessionID) | 54 | UUID secureSessionID) |
55 | { | 55 | { |
56 | // We have just logged in. If there is any info in the table | 56 | // We have just logged in. If there is any info in the table |
@@ -58,7 +58,7 @@ namespace OpenSim.Services.PresenceService | |||
58 | // | 58 | // |
59 | PresenceData data = new PresenceData(); | 59 | PresenceData data = new PresenceData(); |
60 | 60 | ||
61 | data.PrincipalID = principalID; | 61 | data.UserID = userID; |
62 | data.RegionID = UUID.Zero; | 62 | data.RegionID = UUID.Zero; |
63 | data.SessionID = sessionID; | 63 | data.SessionID = sessionID; |
64 | data.Data["SecureSessionID"] = secureSessionID.ToString(); | 64 | data.Data["SecureSessionID"] = secureSessionID.ToString(); |
@@ -105,7 +105,7 @@ namespace OpenSim.Services.PresenceService | |||
105 | if (data == null) | 105 | if (data == null) |
106 | return null; | 106 | return null; |
107 | 107 | ||
108 | ret.PrincipalID = data.PrincipalID; | 108 | ret.UserID = data.UserID; |
109 | ret.RegionID = data.RegionID; | 109 | ret.RegionID = data.RegionID; |
110 | ret.Online = bool.Parse(data.Data["Online"]); | 110 | ret.Online = bool.Parse(data.Data["Online"]); |
111 | ret.Login = Util.ToDateTime(Convert.ToInt32(data.Data["Login"])); | 111 | ret.Login = Util.ToDateTime(Convert.ToInt32(data.Data["Login"])); |
@@ -116,34 +116,30 @@ namespace OpenSim.Services.PresenceService | |||
116 | return ret; | 116 | return ret; |
117 | } | 117 | } |
118 | 118 | ||
119 | public PresenceInfo[] GetAgents(string[] principalIDs) | 119 | public PresenceInfo[] GetAgents(string[] userIDs) |
120 | { | 120 | { |
121 | List<PresenceInfo> info = new List<PresenceInfo>(); | 121 | List<PresenceInfo> info = new List<PresenceInfo>(); |
122 | 122 | ||
123 | foreach (string principalIDStr in principalIDs) | 123 | foreach (string userIDStr in userIDs) |
124 | { | 124 | { |
125 | UUID principalID = UUID.Zero; | 125 | PresenceData[] data = m_Database.Get("UserID", |
126 | if (UUID.TryParse(principalIDStr, out principalID)) | 126 | userIDStr); |
127 | |||
128 | foreach (PresenceData d in data) | ||
127 | { | 129 | { |
128 | PresenceData[] data = m_Database.Get("PrincipalID", | 130 | PresenceInfo ret = new PresenceInfo(); |
129 | principalID.ToString()); | 131 | |
130 | 132 | ret.UserID = d.UserID; | |
131 | foreach (PresenceData d in data) | 133 | ret.RegionID = d.RegionID; |
132 | { | 134 | ret.Online = bool.Parse(d.Data["Online"]); |
133 | PresenceInfo ret = new PresenceInfo(); | 135 | ret.Login = Util.ToDateTime(Convert.ToInt32( |
134 | 136 | d.Data["Login"])); | |
135 | ret.PrincipalID = d.PrincipalID; | 137 | ret.Logout = Util.ToDateTime(Convert.ToInt32( |
136 | ret.RegionID = d.RegionID; | 138 | d.Data["Logout"])); |
137 | ret.Online = bool.Parse(d.Data["Online"]); | 139 | ret.Position = Vector3.Parse(d.Data["Position"]); |
138 | ret.Login = Util.ToDateTime(Convert.ToInt32( | 140 | ret.LookAt = Vector3.Parse(d.Data["LookAt"]); |
139 | d.Data["Login"])); | 141 | |
140 | ret.Logout = Util.ToDateTime(Convert.ToInt32( | 142 | info.Add(ret); |
141 | d.Data["Logout"])); | ||
142 | ret.Position = Vector3.Parse(d.Data["Position"]); | ||
143 | ret.LookAt = Vector3.Parse(d.Data["LookAt"]); | ||
144 | |||
145 | info.Add(ret); | ||
146 | } | ||
147 | } | 143 | } |
148 | } | 144 | } |
149 | 145 | ||
diff --git a/OpenSim/Services/PresenceService/PresenceServiceBase.cs b/OpenSim/Services/PresenceService/PresenceServiceBase.cs index 60a246b..41e2d9c 100644 --- a/OpenSim/Services/PresenceService/PresenceServiceBase.cs +++ b/OpenSim/Services/PresenceService/PresenceServiceBase.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Services.PresenceService | |||
44 | { | 44 | { |
45 | string dllName = String.Empty; | 45 | string dllName = String.Empty; |
46 | string connString = String.Empty; | 46 | string connString = String.Empty; |
47 | string realm = "agents"; | 47 | string realm = "Presence"; |
48 | 48 | ||
49 | // | 49 | // |
50 | // Try reading the [DatabaseService] section, if it exists | 50 | // Try reading the [DatabaseService] section, if it exists |