aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Interfaces
diff options
context:
space:
mode:
authorDiva Canto2010-05-07 21:29:56 -0700
committerDiva Canto2010-05-07 21:29:56 -0700
commita58859a0d4206c194c9c56212218e2cafc2cc373 (patch)
treefed51a4e40c344b76f6b8b4d5c5b2ec0d2e142e4 /OpenSim/Services/Interfaces
parentimprove handling of undersize sculpt textures (diff)
downloadopensim-SC_OLD-a58859a0d4206c194c9c56212218e2cafc2cc373.zip
opensim-SC_OLD-a58859a0d4206c194c9c56212218e2cafc2cc373.tar.gz
opensim-SC_OLD-a58859a0d4206c194c9c56212218e2cafc2cc373.tar.bz2
opensim-SC_OLD-a58859a0d4206c194c9c56212218e2cafc2cc373.tar.xz
GridUserService in place. Replaces the contrived concept of storing user's home and position info in the presence service. WARNING: I violated a taboo by deleting 2 migration files and simplifying the original table creation for Presence. This should not cause any problems to anyone, though. Things will work with the new simplified table, as well as with the previous contrived one. If there are any problems, solving them is as easy as dropping the presence table and deleting its row in the migrations table. The presence info only exists during a user's session anyway.
BTW, the Meshing files want to be committed too -- EOFs.
Diffstat (limited to 'OpenSim/Services/Interfaces')
-rw-r--r--OpenSim/Services/Interfaces/IGridUserService.cs42
-rw-r--r--OpenSim/Services/Interfaces/IPresenceService.cs24
2 files changed, 43 insertions, 23 deletions
diff --git a/OpenSim/Services/Interfaces/IGridUserService.cs b/OpenSim/Services/Interfaces/IGridUserService.cs
index a7c2c6f..e629dff 100644
--- a/OpenSim/Services/Interfaces/IGridUserService.cs
+++ b/OpenSim/Services/Interfaces/IGridUserService.cs
@@ -37,39 +37,79 @@ namespace OpenSim.Services.Interfaces
37 public class GridUserInfo 37 public class GridUserInfo
38 { 38 {
39 public string UserID; 39 public string UserID;
40
40 public UUID HomeRegionID; 41 public UUID HomeRegionID;
41 public Vector3 HomePosition; 42 public Vector3 HomePosition;
42 public Vector3 HomeLookAt; 43 public Vector3 HomeLookAt;
43 44
45 public UUID LastRegionID;
46 public Vector3 LastPosition;
47 public Vector3 LastLookAt;
48
49 public bool Online;
50 public DateTime Login;
51 public DateTime Logout;
52
44 public GridUserInfo() {} 53 public GridUserInfo() {}
45 54
46 public GridUserInfo(Dictionary<string, object> kvp) 55 public GridUserInfo(Dictionary<string, object> kvp)
47 { 56 {
48 if (kvp.ContainsKey("UserID")) 57 if (kvp.ContainsKey("UserID"))
49 UserID = kvp["UserID"].ToString(); 58 UserID = kvp["UserID"].ToString();
59
50 if (kvp.ContainsKey("HomeRegionID")) 60 if (kvp.ContainsKey("HomeRegionID"))
51 UUID.TryParse(kvp["HomeRegionID"].ToString(), out HomeRegionID); 61 UUID.TryParse(kvp["HomeRegionID"].ToString(), out HomeRegionID);
52 if (kvp.ContainsKey("HomePosition")) 62 if (kvp.ContainsKey("HomePosition"))
53 Vector3.TryParse(kvp["HomePosition"].ToString(), out HomePosition); 63 Vector3.TryParse(kvp["HomePosition"].ToString(), out HomePosition);
54 if (kvp.ContainsKey("HomeLookAt")) 64 if (kvp.ContainsKey("HomeLookAt"))
55 Vector3.TryParse(kvp["HomeLookAt"].ToString(), out HomeLookAt); 65 Vector3.TryParse(kvp["HomeLookAt"].ToString(), out HomeLookAt);
66
67 if (kvp.ContainsKey("LastRegionID"))
68 UUID.TryParse(kvp["LastRegionID"].ToString(), out HomeRegionID);
69 if (kvp.ContainsKey("LastPosition"))
70 Vector3.TryParse(kvp["LastPosition"].ToString(), out LastPosition);
71 if (kvp.ContainsKey("LastLookAt"))
72 Vector3.TryParse(kvp["LastLookAt"].ToString(), out LastLookAt);
73
74 if (kvp.ContainsKey("Login"))
75 DateTime.TryParse(kvp["Login"].ToString(), out Login);
76 if (kvp.ContainsKey("Logout"))
77 DateTime.TryParse(kvp["Logout"].ToString(), out Logout);
78 if (kvp.ContainsKey("Online"))
79 Boolean.TryParse(kvp["Online"].ToString(), out Online);
80
56 } 81 }
57 82
58 public Dictionary<string, object> ToKeyValuePairs() 83 public Dictionary<string, object> ToKeyValuePairs()
59 { 84 {
60 Dictionary<string, object> result = new Dictionary<string, object>(); 85 Dictionary<string, object> result = new Dictionary<string, object>();
61 result["UserID"] = UserID; 86 result["UserID"] = UserID;
87
62 result["HomeRegionID"] = HomeRegionID.ToString(); 88 result["HomeRegionID"] = HomeRegionID.ToString();
63 result["HomePosition"] = HomePosition.ToString(); 89 result["HomePosition"] = HomePosition.ToString();
64 result["HomeLookAt"] = HomeLookAt.ToString(); 90 result["HomeLookAt"] = HomeLookAt.ToString();
65 91
92 result["LastRegionID"] = LastRegionID.ToString();
93 result["LastPosition"] = LastPosition.ToString();
94 result["LastLookAt"] = LastLookAt.ToString();
95
96 result["Online"] = Online.ToString();
97 result["Login"] = Login.ToString();
98 result["Logout"] = Logout.ToString();
99
100
66 return result; 101 return result;
67 } 102 }
68 } 103 }
69 104
70 public interface IGridUserService 105 public interface IGridUserService
71 { 106 {
107 GridUserInfo LoggedIn(string userID);
108 bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt);
109
110 bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt);
111 bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt);
112
72 GridUserInfo GetGridUserInfo(string userID); 113 GridUserInfo GetGridUserInfo(string userID);
73 bool StoreGridUserInfo(GridUserInfo info);
74 } 114 }
75} \ No newline at end of file 115} \ No newline at end of file
diff --git a/OpenSim/Services/Interfaces/IPresenceService.cs b/OpenSim/Services/Interfaces/IPresenceService.cs
index b4c1859..9687d22 100644
--- a/OpenSim/Services/Interfaces/IPresenceService.cs
+++ b/OpenSim/Services/Interfaces/IPresenceService.cs
@@ -55,23 +55,10 @@ namespace OpenSim.Services.Interfaces
55 UserID = kvp["UserID"].ToString(); 55 UserID = kvp["UserID"].ToString();
56 if (kvp.ContainsKey("RegionID")) 56 if (kvp.ContainsKey("RegionID"))
57 UUID.TryParse(kvp["RegionID"].ToString(), out RegionID); 57 UUID.TryParse(kvp["RegionID"].ToString(), out RegionID);
58 if (kvp.ContainsKey("login"))
59 DateTime.TryParse(kvp["login"].ToString(), out Login);
60 if (kvp.ContainsKey("logout"))
61 DateTime.TryParse(kvp["logout"].ToString(), out Logout);
62 if (kvp.ContainsKey("lookAt")) 58 if (kvp.ContainsKey("lookAt"))
63 Vector3.TryParse(kvp["lookAt"].ToString(), out LookAt); 59 Vector3.TryParse(kvp["lookAt"].ToString(), out LookAt);
64 if (kvp.ContainsKey("online"))
65 Boolean.TryParse(kvp["online"].ToString(), out Online);
66 if (kvp.ContainsKey("position")) 60 if (kvp.ContainsKey("position"))
67 Vector3.TryParse(kvp["position"].ToString(), out Position); 61 Vector3.TryParse(kvp["position"].ToString(), out Position);
68 if (kvp.ContainsKey("HomeRegionID"))
69 UUID.TryParse(kvp["HomeRegionID"].ToString(), out HomeRegionID);
70 if (kvp.ContainsKey("HomePosition"))
71 Vector3.TryParse(kvp["HomePosition"].ToString(), out HomePosition);
72 if (kvp.ContainsKey("HomeLookAt"))
73 Vector3.TryParse(kvp["HomeLookAt"].ToString(), out HomeLookAt);
74
75 } 62 }
76 63
77 public Dictionary<string, object> ToKeyValuePairs() 64 public Dictionary<string, object> ToKeyValuePairs()
@@ -79,14 +66,8 @@ namespace OpenSim.Services.Interfaces
79 Dictionary<string, object> result = new Dictionary<string, object>(); 66 Dictionary<string, object> result = new Dictionary<string, object>();
80 result["UserID"] = UserID; 67 result["UserID"] = UserID;
81 result["RegionID"] = RegionID.ToString(); 68 result["RegionID"] = RegionID.ToString();
82 result["online"] = Online.ToString();
83 result["login"] = Login.ToString();
84 result["logout"] = Logout.ToString();
85 result["position"] = Position.ToString(); 69 result["position"] = Position.ToString();
86 result["lookAt"] = LookAt.ToString(); 70 result["lookAt"] = LookAt.ToString();
87 result["HomeRegionID"] = HomeRegionID.ToString();
88 result["HomePosition"] = HomePosition.ToString();
89 result["HomeLookAt"] = HomeLookAt.ToString();
90 71
91 return result; 72 return result;
92 } 73 }
@@ -115,11 +96,10 @@ namespace OpenSim.Services.Interfaces
115 public interface IPresenceService 96 public interface IPresenceService
116 { 97 {
117 bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID); 98 bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID);
118 bool LogoutAgent(UUID sessionID, Vector3 position, Vector3 lookAt); 99 bool LogoutAgent(UUID sessionID);
119 bool LogoutRegionAgents(UUID regionID); 100 bool LogoutRegionAgents(UUID regionID);
120 101
121 bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt); 102 bool ReportAgent(UUID sessionID, UUID regionID);
122 bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt);
123 103
124 PresenceInfo GetAgent(UUID sessionID); 104 PresenceInfo GetAgent(UUID sessionID);
125 PresenceInfo[] GetAgents(string[] userIDs); 105 PresenceInfo[] GetAgents(string[] userIDs);