aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Interfaces/IGridUserService.cs
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/IGridUserService.cs
parentimprove handling of undersize sculpt textures (diff)
downloadopensim-SC-a58859a0d4206c194c9c56212218e2cafc2cc373.zip
opensim-SC-a58859a0d4206c194c9c56212218e2cafc2cc373.tar.gz
opensim-SC-a58859a0d4206c194c9c56212218e2cafc2cc373.tar.bz2
opensim-SC-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/IGridUserService.cs')
-rw-r--r--OpenSim/Services/Interfaces/IGridUserService.cs42
1 files changed, 41 insertions, 1 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