diff options
-rw-r--r-- | OpenGrid.Framework.Data.MySQL/MySQLManager.cs | 81 | ||||
-rw-r--r-- | OpenGrid.Framework.Data/UserProfileData.cs | 13 |
2 files changed, 89 insertions, 5 deletions
diff --git a/OpenGrid.Framework.Data.MySQL/MySQLManager.cs b/OpenGrid.Framework.Data.MySQL/MySQLManager.cs index e4622a8..a476e97 100644 --- a/OpenGrid.Framework.Data.MySQL/MySQLManager.cs +++ b/OpenGrid.Framework.Data.MySQL/MySQLManager.cs | |||
@@ -118,6 +118,87 @@ namespace OpenGrid.Framework.Data.MySQL | |||
118 | retval.regionUserURI = (string)reader["regionUserURI"]; | 118 | retval.regionUserURI = (string)reader["regionUserURI"]; |
119 | retval.regionUserRecvKey = (string)reader["regionUserRecvKey"]; | 119 | retval.regionUserRecvKey = (string)reader["regionUserRecvKey"]; |
120 | retval.regionUserSendKey = (string)reader["regionUserSendKey"]; | 120 | retval.regionUserSendKey = (string)reader["regionUserSendKey"]; |
121 | |||
122 | // World Map Addition | ||
123 | retval.regionMapTextureID = new libsecondlife.LLUUID((string)reader["regionMapTexture"]); | ||
124 | } | ||
125 | else | ||
126 | { | ||
127 | return null; | ||
128 | } | ||
129 | return retval; | ||
130 | } | ||
131 | |||
132 | public UserAgentData getAgentRow(IDataReader reader) | ||
133 | { | ||
134 | UserAgentData retval = new UserAgentData(); | ||
135 | |||
136 | if (reader.Read()) | ||
137 | { | ||
138 | // Agent IDs | ||
139 | retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]); | ||
140 | retval.sessionID = new libsecondlife.LLUUID((string)reader["sessionID"]); | ||
141 | retval.secureSessionID = new libsecondlife.LLUUID((string)reader["secureSessionID"]); | ||
142 | |||
143 | // Agent Who? | ||
144 | retval.agentIP = (string)reader["agentIP"]; | ||
145 | retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString()); | ||
146 | retval.agentOnline = Convert.ToBoolean(reader["agentOnline"].ToString()); | ||
147 | |||
148 | // Login/Logout times (UNIX Epoch) | ||
149 | retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString()); | ||
150 | retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString()); | ||
151 | |||
152 | // Current position | ||
153 | retval.currentRegion = (string)reader["currentRegion"]; | ||
154 | retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString()); | ||
155 | libsecondlife.LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos); | ||
156 | } | ||
157 | else | ||
158 | { | ||
159 | return null; | ||
160 | } | ||
161 | return retval; | ||
162 | } | ||
163 | |||
164 | public UserProfileData getUserRow(IDataReader reader) | ||
165 | { | ||
166 | UserProfileData retval = new UserProfileData(); | ||
167 | |||
168 | if (reader.Read()) | ||
169 | { | ||
170 | retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]); | ||
171 | retval.username = (string)reader["username"]; | ||
172 | retval.surname = (string)reader["lastname"]; | ||
173 | |||
174 | retval.passwordHash = (string)reader["passwordHash"]; | ||
175 | retval.passwordSalt = (string)reader["passwordSalt"]; | ||
176 | |||
177 | retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); | ||
178 | retval.homeLocation = new libsecondlife.LLVector3( | ||
179 | Convert.ToSingle(reader["homeLocationX"].ToString()), | ||
180 | Convert.ToSingle(reader["homeLocationY"].ToString()), | ||
181 | Convert.ToSingle(reader["homeLocationZ"].ToString())); | ||
182 | retval.homeLookAt = new libsecondlife.LLVector3( | ||
183 | Convert.ToSingle(reader["homeLookAtX"].ToString()), | ||
184 | Convert.ToSingle(reader["homeLookAtY"].ToString()), | ||
185 | Convert.ToSingle(reader["homeLookAtZ"].ToString())); | ||
186 | |||
187 | retval.created = Convert.ToInt32(reader["created"].ToString()); | ||
188 | retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); | ||
189 | |||
190 | retval.userInventoryURI = (string)reader["userInventoryURI"]; | ||
191 | retval.userAssetURI = (string)reader["userAssetURI"]; | ||
192 | |||
193 | retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); | ||
194 | retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); | ||
195 | |||
196 | retval.profileAboutText = (string)reader["profileAboutText"]; | ||
197 | retval.profileFirstText = (string)reader["profileFirstText"]; | ||
198 | |||
199 | retval.profileImage = new libsecondlife.LLUUID((string)reader["profileImage"]); | ||
200 | retval.profileFirstImage = new libsecondlife.LLUUID((string)reader["profileFirstImage"]); | ||
201 | |||
121 | } | 202 | } |
122 | else | 203 | else |
123 | { | 204 | { |
diff --git a/OpenGrid.Framework.Data/UserProfileData.cs b/OpenGrid.Framework.Data/UserProfileData.cs index 3d8eec4..ec89107 100644 --- a/OpenGrid.Framework.Data/UserProfileData.cs +++ b/OpenGrid.Framework.Data/UserProfileData.cs | |||
@@ -38,14 +38,17 @@ namespace OpenGrid.Framework.Data | |||
38 | 38 | ||
39 | public class UserAgentData | 39 | public class UserAgentData |
40 | { | 40 | { |
41 | public LLUUID UUID; // Internal session ID | ||
41 | public string agentIP; // The IP of the agent | 42 | public string agentIP; // The IP of the agent |
42 | public uint agentPort; // The port of the agent | 43 | public uint agentPort; // The port of the agent |
43 | public bool agentOnline; // The online status of the agent | 44 | public bool agentOnline; // The online status of the agent |
44 | public LLUUID sessionID; // The session ID for the agent | 45 | public LLUUID sessionID; // The session ID for the agent (used by client) |
45 | public LLUUID secureSessionID; // The secure session ID for the agent | 46 | public LLUUID secureSessionID; // The secure session ID for the agent (used by client) |
46 | public LLUUID regionID; // The region ID the agent occupies | 47 | public LLUUID regionID; // The region ID the agent occupies |
47 | public uint loginTime; // EPOCH based Timestamp | 48 | public int loginTime; // EPOCH based Timestamp |
48 | public uint logoutTime; // Timestamp or 0 if N/A | 49 | public int logoutTime; // Timestamp or 0 if N/A |
49 | 50 | public LLUUID currentRegion; // UUID of the users current region | |
51 | public ulong currentHandle; // RegionHandle of the users current region | ||
52 | public LLVector3 currentPos; // Current position in the region | ||
50 | } | 53 | } |
51 | } | 54 | } |