aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Data/IPresenceData.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs6
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs6
-rw-r--r--OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs9
-rw-r--r--OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs4
-rw-r--r--OpenSim/Services/Interfaces/IPresenceService.cs10
-rw-r--r--OpenSim/Services/PresenceService/PresenceService.cs48
-rw-r--r--OpenSim/Services/PresenceService/PresenceServiceBase.cs2
8 files changed, 41 insertions, 46 deletions
diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs
index 1ccabcc..98353ed 100644
--- a/OpenSim/Data/IPresenceData.cs
+++ b/OpenSim/Data/IPresenceData.cs
@@ -35,7 +35,7 @@ namespace OpenSim.Data
35 // This MUST be a ref type! 35 // This MUST be a ref type!
36 public class PresenceData 36 public class PresenceData
37 { 37 {
38 public UUID PrincipalID; 38 public string UserID;
39 public UUID RegionID; 39 public UUID RegionID;
40 public UUID SessionID; 40 public UUID SessionID;
41 public Dictionary<string, string> Data; 41 public Dictionary<string, string> Data;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
index 8aad7e0..a80a355 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
@@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
148 148
149 #region IPresenceService 149 #region IPresenceService
150 150
151 public bool LoginAgent(UUID principalID, UUID sessionID, UUID secureSessionID) 151 public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
152 { 152 {
153 m_log.Warn("[LOCAL PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators"); 153 m_log.Warn("[LOCAL PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators");
154 return false; 154 return false;
@@ -175,9 +175,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
175 return m_PresenceService.GetAgent(sessionID); 175 return m_PresenceService.GetAgent(sessionID);
176 } 176 }
177 177
178 public PresenceInfo[] GetAgents(string[] principalIDs) 178 public PresenceInfo[] GetAgents(string[] userIDs)
179 { 179 {
180 return m_PresenceService.GetAgents(principalIDs); 180 return m_PresenceService.GetAgents(userIDs);
181 } 181 }
182 182
183 #endregion 183 #endregion
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
index 6a674ce..e652773 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
@@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
121 121
122 #region IPresenceService 122 #region IPresenceService
123 123
124 public bool LoginAgent(UUID principalID, UUID sessionID, UUID secureSessionID) 124 public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
125 { 125 {
126 m_log.Warn("[REMOTE PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators"); 126 m_log.Warn("[REMOTE PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators");
127 return false; 127 return false;
@@ -148,9 +148,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
148 return m_RemoteConnector.GetAgent(sessionID); 148 return m_RemoteConnector.GetAgent(sessionID);
149 } 149 }
150 150
151 public PresenceInfo[] GetAgents(string[] principalIDs) 151 public PresenceInfo[] GetAgents(string[] userIDs)
152 { 152 {
153 return m_RemoteConnector.GetAgents(principalIDs); 153 return m_RemoteConnector.GetAgents(userIDs);
154 } 154 }
155 155
156 #endregion 156 #endregion
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
index b02c2ed..580cb15 100644
--- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
@@ -104,15 +104,14 @@ namespace OpenSim.Server.Handlers.Presence
104 104
105 byte[] LoginAgent(Dictionary<string, object> request) 105 byte[] LoginAgent(Dictionary<string, object> request)
106 { 106 {
107 UUID principal = UUID.Zero; 107 string user = String.Empty;
108 UUID session = UUID.Zero; 108 UUID session = UUID.Zero;
109 UUID ssession = UUID.Zero; 109 UUID ssession = UUID.Zero;
110 110
111 if (!request.ContainsKey("PrincipalID") || !request.ContainsKey("SessionID")) 111 if (!request.ContainsKey("UserID") || !request.ContainsKey("SessionID"))
112 return FailureResult(); 112 return FailureResult();
113 113
114 if (!UUID.TryParse(request["PrincipalID"].ToString(), out principal)) 114 user = request["UserID"].ToString();
115 return FailureResult();
116 115
117 if (!UUID.TryParse(request["SessionID"].ToString(), out session)) 116 if (!UUID.TryParse(request["SessionID"].ToString(), out session))
118 return FailureResult(); 117 return FailureResult();
@@ -121,7 +120,7 @@ namespace OpenSim.Server.Handlers.Presence
121 // If it's malformed, we go on with a Zero on it 120 // If it's malformed, we go on with a Zero on it
122 UUID.TryParse(request["SecureSessionID"].ToString(), out ssession); 121 UUID.TryParse(request["SecureSessionID"].ToString(), out ssession);
123 122
124 if (m_PresenceService.LoginAgent(principal, session, ssession)) 123 if (m_PresenceService.LoginAgent(user, session, ssession))
125 return SuccessResult(); 124 return SuccessResult();
126 125
127 return FailureResult(); 126 return FailureResult();
diff --git a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs
index 906d6bd..4ad457f 100644
--- a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors
86 86
87 #region IPresenceService 87 #region IPresenceService
88 88
89 public bool LoginAgent(UUID principalID, UUID sessionID, UUID secureSessionID) 89 public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
90 { 90 {
91 Dictionary<string, object> sendData = new Dictionary<string, object>(); 91 Dictionary<string, object> sendData = new Dictionary<string, object>();
92 //sendData["SCOPEID"] = scopeID.ToString(); 92 //sendData["SCOPEID"] = scopeID.ToString();
@@ -94,7 +94,7 @@ namespace OpenSim.Services.Connectors
94 sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString(); 94 sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
95 sendData["METHOD"] = "login"; 95 sendData["METHOD"] = "login";
96 96
97 sendData["PrincipalID"] = principalID.ToString(); 97 sendData["UserID"] = userID;
98 sendData["SessionID"] = sessionID.ToString(); 98 sendData["SessionID"] = sessionID.ToString();
99 sendData["SecureSessionID"] = secureSessionID.ToString(); 99 sendData["SecureSessionID"] = secureSessionID.ToString();
100 100
diff --git a/OpenSim/Services/Interfaces/IPresenceService.cs b/OpenSim/Services/Interfaces/IPresenceService.cs
index 56d8f15..de3813a 100644
--- a/OpenSim/Services/Interfaces/IPresenceService.cs
+++ b/OpenSim/Services/Interfaces/IPresenceService.cs
@@ -34,7 +34,7 @@ namespace OpenSim.Services.Interfaces
34{ 34{
35 public class PresenceInfo 35 public class PresenceInfo
36 { 36 {
37 public UUID PrincipalID; 37 public string UserID;
38 public UUID RegionID; 38 public UUID RegionID;
39 public bool Online; 39 public bool Online;
40 public DateTime Login; 40 public DateTime Login;
@@ -48,8 +48,8 @@ namespace OpenSim.Services.Interfaces
48 48
49 public PresenceInfo(Dictionary<string, object> kvp) 49 public PresenceInfo(Dictionary<string, object> kvp)
50 { 50 {
51 if (kvp.ContainsKey("PrincipalID")) 51 if (kvp.ContainsKey("UserID"))
52 UUID.TryParse(kvp["PrincipalID"].ToString(), out PrincipalID); 52 UserID = kvp["UserID"].ToString();
53 if (kvp.ContainsKey("RegionID")) 53 if (kvp.ContainsKey("RegionID"))
54 UUID.TryParse(kvp["RegionID"].ToString(), out RegionID); 54 UUID.TryParse(kvp["RegionID"].ToString(), out RegionID);
55 if (kvp.ContainsKey("login")) 55 if (kvp.ContainsKey("login"))
@@ -68,7 +68,7 @@ namespace OpenSim.Services.Interfaces
68 public Dictionary<string, object> ToKeyValuePairs() 68 public Dictionary<string, object> ToKeyValuePairs()
69 { 69 {
70 Dictionary<string, object> result = new Dictionary<string, object>(); 70 Dictionary<string, object> result = new Dictionary<string, object>();
71 result["PrincipalID"] = PrincipalID.ToString(); 71 result["UserID"] = UserID;
72 result["RegionID"] = RegionID.ToString(); 72 result["RegionID"] = RegionID.ToString();
73 result["online"] = Online.ToString(); 73 result["online"] = Online.ToString();
74 result["login"] = Login.ToString(); 74 result["login"] = Login.ToString();
@@ -82,7 +82,7 @@ namespace OpenSim.Services.Interfaces
82 82
83 public interface IPresenceService 83 public interface IPresenceService
84 { 84 {
85 bool LoginAgent(UUID principalID, UUID sessionID, UUID secureSessionID); 85 bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID);
86 bool LogoutAgent(UUID sessionID); 86 bool LogoutAgent(UUID sessionID);
87 bool LogoutRegionAgents(UUID regionID); 87 bool LogoutRegionAgents(UUID regionID);
88 88
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