aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
authorMelanie2009-12-28 17:34:42 +0000
committerMelanie2009-12-28 17:34:42 +0000
commit92a40129b5dfde0d8ef798941f5efb31ca3a73fd (patch)
tree92f10121b7eb3d592621af7a74ebb6f06cea0858 /OpenSim/Services
parent* Added the new modules to Resources, making them active. (diff)
downloadopensim-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')
-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
4 files changed, 30 insertions, 34 deletions
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