Annotation of /trunk/ModularRex/RexNetwork/RexLogin/RexLoginModule.cs
Parent Directory
|
Revision Log
Revision 99 - (view) (download)
| 1 : | afrisby | 3 | using System; |
| 2 : | afrisby | 5 | using System.Collections; |
| 3 : | afrisby | 3 | using System.Collections.Generic; |
| 4 : | afrisby | 6 | using System.Reflection; |
| 5 : | using log4net; | ||
| 6 : | afrisby | 3 | using Nini.Config; |
| 7 : | afrisby | 6 | using Nwc.XmlRpc; |
| 8 : | using OpenMetaverse; | ||
| 9 : | using OpenSim.Framework; | ||
| 10 : | using OpenSim.Framework.Communications; | ||
| 11 : | mikkopa | 63 | using OpenSim.Region.Framework.Interfaces; |
| 12 : | using OpenSim.Region.Framework.Scenes; | ||
| 13 : | mikkopa | 73 | using OpenSim.Framework.Communications.Cache; |
| 14 : | afrisby | 3 | |
| 15 : | namespace ModularRex.RexNetwork.RexLogin | ||
| 16 : | { | ||
| 17 : | afrisby | 6 | public class RexLoginModule : IRegionModule |
| 18 : | afrisby | 3 | { |
| 19 : | afrisby | 6 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
| 20 : | afrisby | 3 | |
| 21 : | afrisby | 6 | private readonly List<Scene> m_scenes = new List<Scene>(); |
| 22 : | mikkopa | 39 | private readonly Dictionary<UUID, string> m_authUrl = new Dictionary<UUID, string>(); |
| 23 : | afrisby | 10 | |
| 24 : | mikkopa | 68 | private List<RexUDPServer> m_udpservers = new List<RexUDPServer>(); |
| 25 : | afrisby | 6 | private IConfigSource m_config; |
| 26 : | |||
| 27 : | private RegionInfo m_primaryRegionInfo; | ||
| 28 : | private uint m_rexPort = 7000; | ||
| 29 : | |||
| 30 : | mikkopa | 68 | private OpenSim.Framework.Servers.XmlRpcMethod default_login_to_simulator; |
| 31 : | |||
| 32 : | mikkopa | 73 | /// <summary> |
| 33 : | /// Used during login to send the skeleton of the OpenSim Library to the client. | ||
| 34 : | /// </summary> | ||
| 35 : | protected LibraryRootFolder m_libraryRootFolder; | ||
| 36 : | |||
| 37 : | mikkopa | 39 | public void Configure(IConfigSource config) |
| 38 : | { | ||
| 39 : | if (config.Configs.Contains("ModRex")) | ||
| 40 : | { | ||
| 41 : | m_rexPort = (uint) config.Configs["ModRex"].GetInt("FirstPort", (int) m_rexPort); | ||
| 42 : | } | ||
| 43 : | |||
| 44 : | } | ||
| 45 : | |||
| 46 : | afrisby | 3 | public void Initialise(Scene scene, IConfigSource source) |
| 47 : | { | ||
| 48 : | mikkopa | 68 | //if (m_udpserver == null) |
| 49 : | // m_udpserver = new RexUDPServer(); | ||
| 50 : | afrisby | 5 | |
| 51 : | afrisby | 6 | m_config = source; |
| 52 : | afrisby | 5 | |
| 53 : | afrisby | 6 | m_scenes.Add(scene); |
| 54 : | afrisby | 10 | |
| 55 : | scene.EventManager.OnClientConnect += EventManager_OnClientConnect; | ||
| 56 : | afrisby | 3 | } |
| 57 : | |||
| 58 : | afrisby | 10 | /// <summary> |
| 59 : | /// Used to transmit in the Account Name to the new RexClientView | ||
| 60 : | /// Would like to pipe it via the RexClientView constructor, | ||
| 61 : | /// but doing so would require a stactic dictionary of expected | ||
| 62 : | /// values. | ||
| 63 : | /// </summary> | ||
| 64 : | void EventManager_OnClientConnect(OpenSim.Framework.Client.IClientCore client) | ||
| 65 : | { | ||
| 66 : | RexClientView rex; | ||
| 67 : | if(client.TryGet(out rex)) | ||
| 68 : | { | ||
| 69 : | mikkopa | 99 | if (m_authUrl.ContainsKey(rex.AgentId)) |
| 70 : | { | ||
| 71 : | rex.RexAccount = m_authUrl[rex.AgentId]; | ||
| 72 : | } | ||
| 73 : | else | ||
| 74 : | { | ||
| 75 : | m_log.WarnFormat("[REX] Client {0} does not have realXtend acccount", rex.AgentId); | ||
| 76 : | } | ||
| 77 : | afrisby | 10 | } |
| 78 : | } | ||
| 79 : | afrisby | 6 | |
| 80 : | afrisby | 10 | |
| 81 : | afrisby | 6 | public void PostInitialise() |
| 82 : | afrisby | 5 | { |
| 83 : | mikkopa | 42 | if (m_config.Configs["realXtend"].GetBoolean("enabled", true)) |
| 84 : | { | ||
| 85 : | mikkopa | 73 | //Load OpenSim Library folder config |
| 86 : | string LibrariesXMLFile = m_config.Configs["StandAlone"].GetString("LibrariesXMLFile"); | ||
| 87 : | m_libraryRootFolder = new LibraryRootFolder(LibrariesXMLFile); | ||
| 88 : | afrisby | 5 | |
| 89 : | mikkopa | 42 | m_log.Info("[REX] Overloading Login_to_Simulator"); |
| 90 : | mikkopa | 68 | default_login_to_simulator = m_scenes[0].CommsManager.HttpServer.GetXmlRPCHandler("login_to_simulator"); |
| 91 : | mikkopa | 42 | m_scenes[0].CommsManager.HttpServer.AddXmlRPCHandler("login_to_simulator", XmlRpcLoginMethod); |
| 92 : | afrisby | 5 | |
| 93 : | mikkopa | 42 | m_primaryRegionInfo = m_scenes[0].RegionInfo; |
| 94 : | |||
| 95 : | m_log.Info("[REX] Initialising"); | ||
| 96 : | mikkopa | 68 | //m_udpserver.Initialise(m_primaryRegionInfo.InternalEndPoint.Address, ref m_rexPort, 0, false, m_config, m_scenes[0].AssetCache, |
| 97 : | // m_scenes[0].AuthenticateHandler); | ||
| 98 : | mikkopa | 42 | foreach (Scene scene in m_scenes) |
| 99 : | { | ||
| 100 : | mikkopa | 68 | RexUDPServer udpserver = new RexUDPServer(); |
| 101 : | m_log.Debug("[REX] RegionInfo: " + scene.RegionInfo.InternalEndPoint.Port); | ||
| 102 : | uint udp_port = Convert.ToUInt32(scene.RegionInfo.InternalEndPoint.Port - 2000); | ||
| 103 : | //uses 2000 smaller port num than spesified for LLClient in Regions/ xml-file | ||
| 104 : | udpserver.Initialise(scene.RegionInfo.InternalEndPoint.Address, ref udp_port, 0, false, m_config, | ||
| 105 : | mikkopa | 72 | scene.CommsManager.AssetCache, scene.AuthenticateHandler); |
| 106 : | mikkopa | 68 | udpserver.AddScene(scene); |
| 107 : | //m_udpserver.AddScene(scene); //this doesn't add scene to existing UDP server, but instead replaces the old one | ||
| 108 : | m_udpservers.Add(udpserver); | ||
| 109 : | udpserver.Start(); | ||
| 110 : | mikkopa | 42 | } |
| 111 : | mikkopa | 68 | //m_udpserver.Start(); |
| 112 : | mikkopa | 42 | } |
| 113 : | else | ||
| 114 : | afrisby | 6 | { |
| 115 : | mikkopa | 42 | m_log.Info("[REX] Not overloading Login_to_Simulator and not starting UDP server"); |
| 116 : | afrisby | 6 | } |
| 117 : | afrisby | 3 | } |
| 118 : | |||
| 119 : | public void Close() | ||
| 120 : | { | ||
| 121 : | |||
| 122 : | } | ||
| 123 : | |||
| 124 : | public string Name | ||
| 125 : | { | ||
| 126 : | get { return "RexLoginOverrider"; } | ||
| 127 : | } | ||
| 128 : | |||
| 129 : | public bool IsSharedModule | ||
| 130 : | { | ||
| 131 : | get { return true; } | ||
| 132 : | } | ||
| 133 : | afrisby | 6 | |
| 134 : | #region RexLoginHelper | ||
| 135 : | |||
| 136 : | public bool AuthenticateUser(string accountName, string sessionHash) | ||
| 137 : | { | ||
| 138 : | return true; | ||
| 139 : | } | ||
| 140 : | |||
| 141 : | mikkopa | 39 | private static LoginService.InventoryData GetInventorySkeleton(Scene any, UUID userID) |
| 142 : | { | ||
| 143 : | List<InventoryFolderBase> folders = any.CommsManager.InterServiceInventoryService.GetInventorySkeleton(userID); | ||
| 144 : | |||
| 145 : | // If we have user auth but no inventory folders for some reason, create a new set of folders. | ||
| 146 : | if (null == folders || 0 == folders.Count) | ||
| 147 : | { | ||
| 148 : | any.CommsManager.InterServiceInventoryService.CreateNewUserInventory(userID); | ||
| 149 : | folders = any.CommsManager.InterServiceInventoryService.GetInventorySkeleton(userID); | ||
| 150 : | } | ||
| 151 : | |||
| 152 : | UUID rootID = UUID.Zero; | ||
| 153 : | ArrayList AgentInventoryArray = new ArrayList(); | ||
| 154 : | foreach (InventoryFolderBase InvFolder in folders) | ||
| 155 : | { | ||
| 156 : | if (InvFolder.ParentID == UUID.Zero) | ||
| 157 : | { | ||
| 158 : | rootID = InvFolder.ID; | ||
| 159 : | } | ||
| 160 : | Hashtable TempHash = new Hashtable(); | ||
| 161 : | TempHash["name"] = InvFolder.Name; | ||
| 162 : | TempHash["parent_id"] = InvFolder.ParentID.ToString(); | ||
| 163 : | TempHash["version"] = (Int32)InvFolder.Version; | ||
| 164 : | TempHash["type_default"] = (Int32)InvFolder.Type; | ||
| 165 : | TempHash["folder_id"] = InvFolder.ID.ToString(); | ||
| 166 : | AgentInventoryArray.Add(TempHash); | ||
| 167 : | } | ||
| 168 : | |||
| 169 : | return new LoginService.InventoryData(AgentInventoryArray, rootID); | ||
| 170 : | } | ||
| 171 : | |||
| 172 : | private static ArrayList GetLibraryOwner() | ||
| 173 : | { | ||
| 174 : | //for now create random inventory library owner | ||
| 175 : | Hashtable TempHash = new Hashtable(); | ||
| 176 : | TempHash["agent_id"] = "11111111-1111-0000-0000-000100bba000"; | ||
| 177 : | ArrayList inventoryLibOwner = new ArrayList(); | ||
| 178 : | inventoryLibOwner.Add(TempHash); | ||
| 179 : | return inventoryLibOwner; | ||
| 180 : | } | ||
| 181 : | |||
| 182 : | // TEMP // TEMP // | ||
| 183 : | |||
| 184 : | public class RexAccountProperties | ||
| 185 : | { | ||
| 186 : | public string FirstName; | ||
| 187 : | public string LastName; | ||
| 188 : | public string AsAddress; | ||
| 189 : | public UUID uuid; | ||
| 190 : | public string Account; | ||
| 191 : | } | ||
| 192 : | |||
| 193 : | public RexAccountProperties GetRexProperties(string RexAccount, string RexAuthURL) | ||
| 194 : | { | ||
| 195 : | m_log.Info("[REXCLIENT] Resolving avatar..."); | ||
| 196 : | Hashtable ReqVals = new Hashtable(); | ||
| 197 : | ReqVals["avatar_account"] = RexAccount; | ||
| 198 : | ReqVals["AuthenticationAddress"] = RexAuthURL; | ||
| 199 : | |||
| 200 : | ArrayList SendParams = new ArrayList(); | ||
| 201 : | SendParams.Add(ReqVals); | ||
| 202 : | |||
| 203 : | XmlRpcRequest req = new XmlRpcRequest("get_user_by_account", SendParams); | ||
| 204 : | |||
| 205 : | m_log.Info("[REXCLIENT] Sending XMLRPC Request to http://" + RexAuthURL); | ||
| 206 : | |||
| 207 : | XmlRpcResponse authreply = req.Send("http://" + RexAuthURL, 9000); | ||
| 208 : | |||
| 209 : | //m_log.Info(authreply.ToString()); | ||
| 210 : | |||
| 211 : | string rexAsAddress = ((Hashtable) authreply.Value)["as_address"].ToString(); | ||
| 212 : | /* string rexSkypeURL = ((Hashtable)authreply.Value)["skype_url"].ToString(); */ | ||
| 213 : | UUID userID = new UUID(((Hashtable) authreply.Value)["uuid"].ToString()); | ||
| 214 : | |||
| 215 : | RexAccountProperties rtn = new RexAccountProperties(); | ||
| 216 : | |||
| 217 : | rtn.FirstName = ((Hashtable)authreply.Value)["firstname"].ToString(); | ||
| 218 : | rtn.LastName = ((Hashtable)authreply.Value)["lastname"].ToString(); | ||
| 219 : | rtn.AsAddress = ((Hashtable)authreply.Value)["as_address"].ToString(); | ||
| 220 : | rtn.uuid = userID; | ||
| 221 : | rtn.Account = RexAccount; | ||
| 222 : | |||
| 223 : | return rtn; | ||
| 224 : | } | ||
| 225 : | |||
| 226 : | // TEMP // TEMP // | ||
| 227 : | |||
| 228 : | afrisby | 6 | public virtual XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) |
| 229 : | { | ||
| 230 : | //CFK: CustomizeResponse contains sufficient strings to alleviate the need for this. | ||
| 231 : | //CKF: m_log.Info("[LOGIN]: Attempting login now..."); | ||
| 232 : | XmlRpcResponse response = new XmlRpcResponse(); | ||
| 233 : | Hashtable requestData = (Hashtable)request.Params[0]; | ||
| 234 : | |||
| 235 : | bool GoodXML = (requestData.Contains("account") && requestData.Contains("sessionhash")); | ||
| 236 : | bool GoodLogin; | ||
| 237 : | |||
| 238 : | string startLocationRequest = "last"; | ||
| 239 : | |||
| 240 : | LoginResponse logResponse = new LoginResponse(); | ||
| 241 : | |||
| 242 : | string account; | ||
| 243 : | string sessionHash; | ||
| 244 : | mikkopa | 99 | string clientVersion = "Unknown"; |
| 245 : | afrisby | 6 | |
| 246 : | mikkopa | 99 | if (requestData.Contains("version")) |
| 247 : | { | ||
| 248 : | clientVersion = (string)requestData["version"]; | ||
| 249 : | } | ||
| 250 : | |||
| 251 : | afrisby | 6 | if (GoodXML) |
| 252 : | { | ||
| 253 : | account = (string)requestData["account"]; | ||
| 254 : | sessionHash = (string)requestData["sessionhash"]; | ||
| 255 : | |||
| 256 : | m_log.InfoFormat( | ||
| 257 : | "[REX LOGIN BEGIN]: XMLRPC Received login request message from user '{0}' '{1}'", | ||
| 258 : | account, sessionHash); | ||
| 259 : | |||
| 260 : | if (requestData.Contains("start")) | ||
| 261 : | { | ||
| 262 : | startLocationRequest = (string)requestData["start"]; | ||
| 263 : | } | ||
| 264 : | |||
| 265 : | m_log.DebugFormat( | ||
| 266 : | "[REXLOGIN]: XMLRPC Client is {0}, start location is {1}", clientVersion, startLocationRequest); | ||
| 267 : | |||
| 268 : | GoodLogin = AuthenticateUser(account, sessionHash); | ||
| 269 : | } | ||
| 270 : | else | ||
| 271 : | { | ||
| 272 : | mikkopa | 99 | if (clientVersion.StartsWith("realXtend")) |
| 273 : | mikkopa | 68 | { |
| 274 : | mikkopa | 99 | XmlRpcResponse rep = default_login_to_simulator(request); |
| 275 : | Hashtable val = (Hashtable)rep.Value; | ||
| 276 : | val["rex"] = "running rex mode"; | ||
| 277 : | val["sim_port"] = (Int32)m_rexPort; | ||
| 278 : | val["region_x"] = (Int32)(m_primaryRegionInfo.RegionLocX * 256); | ||
| 279 : | val["region_y"] = (Int32)(m_primaryRegionInfo.RegionLocY * 256); | ||
| 280 : | return rep; | ||
| 281 : | mikkopa | 68 | } |
| 282 : | else | ||
| 283 : | { | ||
| 284 : | mikkopa | 99 | if (default_login_to_simulator != null) |
| 285 : | { | ||
| 286 : | m_log.Info( | ||
| 287 : | "[REXLOGIN END]: XMLRPC login_to_simulator login message did not contain all the required data. Trying default method."); | ||
| 288 : | return default_login_to_simulator(request); | ||
| 289 : | } | ||
| 290 : | else | ||
| 291 : | { | ||
| 292 : | m_log.Info( | ||
| 293 : | "[REXLOGIN END]: XMLRPC login_to_simulator login message did not contain all the required data."); | ||
| 294 : | return logResponse.CreateGridErrorResponse(); | ||
| 295 : | } | ||
| 296 : | mikkopa | 68 | } |
| 297 : | afrisby | 6 | } |
| 298 : | |||
| 299 : | if (!GoodLogin) | ||
| 300 : | { | ||
| 301 : | m_log.InfoFormat("[LOGIN END]: XMLRPC User {0} ({1}) failed authentication", account, sessionHash); | ||
| 302 : | |||
| 303 : | return logResponse.CreateLoginFailedResponse(); | ||
| 304 : | } | ||
| 305 : | try | ||
| 306 : | { | ||
| 307 : | mikkopa | 39 | string actName = account.Split('@')[0]; |
| 308 : | string actSrv = account.Split('@')[1]; | ||
| 309 : | afrisby | 6 | |
| 310 : | mikkopa | 39 | RexAccountProperties rap = GetRexProperties(actName, actSrv); |
| 311 : | afrisby | 6 | |
| 312 : | mikkopa | 39 | UUID agentID = rap.uuid; |
| 313 : | afrisby | 6 | |
| 314 : | afrisby | 10 | // Used to transmit the login URL to the |
| 315 : | // RexAvatar class when it connects. | ||
| 316 : | m_authUrl[agentID] = account; | ||
| 317 : | |||
| 318 : | afrisby | 6 | logResponse.CircuitCode = Util.RandomClass.Next(); |
| 319 : | |||
| 320 : | mikkopa | 39 | logResponse.Lastname = "<" + account + ">"; |
| 321 : | logResponse.Firstname = rap.FirstName + " " + rap.LastName; | ||
| 322 : | afrisby | 6 | |
| 323 : | mikkopa | 39 | logResponse.AgentID = agentID; |
| 324 : | afrisby | 6 | |
| 325 : | mikkopa | 39 | // NOT SECURE |
| 326 : | afrisby | 6 | logResponse.SessionID = GetSessionID(account); |
| 327 : | logResponse.SecureSessionID = GetSecureID(account); | ||
| 328 : | mikkopa | 39 | |
| 329 : | afrisby | 6 | logResponse.Message = "Welcome to ModularRex"; |
| 330 : | |||
| 331 : | logResponse.SimAddress = m_primaryRegionInfo.ExternalEndPoint.Address.ToString(); | ||
| 332 : | logResponse.SimPort = m_rexPort; | ||
| 333 : | logResponse.RegionX = m_primaryRegionInfo.RegionLocX; | ||
| 334 : | logResponse.RegionY = m_primaryRegionInfo.RegionLocY; | ||
| 335 : | |||
| 336 : | |||
| 337 : | logResponse.StartLocation = startLocationRequest; | ||
| 338 : | |||
| 339 : | mikkopa | 39 | string capsPath = OpenSim.Framework.Communications.Capabilities.CapsUtil.GetRandomCapsObjectPath(); |
| 340 : | mikkopa | 99 | string httpServerURI = "http://" + m_primaryRegionInfo.ExternalHostName + ":" + m_primaryRegionInfo.HttpPort; |
| 341 : | mikkopa | 39 | //string seedcap = "http://" + m_scenes[0].RegionInfo.ExternalEndPoint.Address + ":" + |
| 342 : | // "9000" + "/CAPS/" + capsPath + "0000/"; | ||
| 343 : | mikkopa | 99 | string seedcap = httpServerURI + OpenSim.Framework.Communications.Capabilities.CapsUtil.GetCapsSeedPath(capsPath);//capsPath;// + "0000/"; |
| 344 : | afrisby | 6 | |
| 345 : | logResponse.SeedCapability = seedcap; | ||
| 346 : | |||
| 347 : | mikkopa | 39 | m_scenes[0].CommsManager.UserAdminService.AddUser(logResponse.Firstname, logResponse.Lastname, "", |
| 348 : | account, 1000, 1000, agentID); | ||
| 349 : | m_scenes[0].CommsManager.InterServiceInventoryService.CreateNewUserInventory(agentID); | ||
| 350 : | |||
| 351 : | LoginService.InventoryData inventData = GetInventorySkeleton(m_scenes[0], agentID); | ||
| 352 : | |||
| 353 : | ArrayList AgentInventoryArray = inventData.InventoryArray; | ||
| 354 : | |||
| 355 : | Hashtable InventoryRootHash = new Hashtable(); | ||
| 356 : | InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); | ||
| 357 : | ArrayList InventoryRoot = new ArrayList(); | ||
| 358 : | InventoryRoot.Add(InventoryRootHash); | ||
| 359 : | //userProfile.RootInventoryFolderID = inventData.RootFolderID; | ||
| 360 : | |||
| 361 : | // Inventory Library Section | ||
| 362 : | Hashtable InventoryLibRootHash = new Hashtable(); | ||
| 363 : | InventoryLibRootHash["folder_id"] = "00000112-000f-0000-0000-000100bba000"; | ||
| 364 : | ArrayList InventoryLibRoot = new ArrayList(); | ||
| 365 : | InventoryLibRoot.Add(InventoryLibRootHash); | ||
| 366 : | |||
| 367 : | logResponse.InventoryLibRoot = InventoryLibRoot; | ||
| 368 : | logResponse.InventoryLibraryOwner = GetLibraryOwner(); | ||
| 369 : | logResponse.InventoryRoot = InventoryRoot; | ||
| 370 : | logResponse.InventorySkeleton = AgentInventoryArray; | ||
| 371 : | mikkopa | 73 | logResponse.InventoryLibrary = GetInventoryLibrary(); |
| 372 : | mikkopa | 39 | |
| 373 : | afrisby | 6 | foreach (Scene scene in m_scenes) |
| 374 : | { | ||
| 375 : | AgentCircuitData acd = new AgentCircuitData(); | ||
| 376 : | |||
| 377 : | acd.AgentID = agentID; | ||
| 378 : | acd.BaseFolder = UUID.Zero; | ||
| 379 : | mikkopa | 99 | acd.CapsPath = capsPath;// seedcap; //this was causing problems |
| 380 : | afrisby | 6 | |
| 381 : | // Will login to the first region | ||
| 382 : | acd.child = scene == m_scenes[0]; | ||
| 383 : | |||
| 384 : | acd.circuitcode = (uint)logResponse.CircuitCode; | ||
| 385 : | acd.firstname = logResponse.Firstname; | ||
| 386 : | acd.InventoryFolder = UUID.Zero; | ||
| 387 : | acd.lastname = logResponse.Lastname; | ||
| 388 : | acd.SecureSessionID = logResponse.SecureSessionID; | ||
| 389 : | acd.SessionID = logResponse.SessionID; | ||
| 390 : | acd.startpos = new Vector3(128, 128, 128); | ||
| 391 : | |||
| 392 : | scene.NewUserConnection(acd); | ||
| 393 : | } | ||
| 394 : | |||
| 395 : | |||
| 396 : | |||
| 397 : | XmlRpcResponse rep = logResponse.ToXmlRpcResponse(); | ||
| 398 : | |||
| 399 : | Hashtable val = (Hashtable) rep.Value; | ||
| 400 : | val["rex"] = "running rex mode"; | ||
| 401 : | |||
| 402 : | mikkopa | 34 | //m_log.Debug(rep.ToString()); |
| 403 : | afrisby | 6 | |
| 404 : | return rep; | ||
| 405 : | } | ||
| 406 : | catch (Exception e) | ||
| 407 : | { | ||
| 408 : | m_log.Info("[REXLOGIN END]: XMLRPC Login failed, " + e); | ||
| 409 : | } | ||
| 410 : | |||
| 411 : | m_log.Info("[REXLOGIN END]: XMLRPC Login failed. Sending back blank XMLRPC response"); | ||
| 412 : | return response; | ||
| 413 : | } | ||
| 414 : | |||
| 415 : | private static UUID GetAgentID(string account) | ||
| 416 : | { | ||
| 417 : | UUID agentID = new UUID(Util.Md5Hash(account)); | ||
| 418 : | return agentID; | ||
| 419 : | } | ||
| 420 : | |||
| 421 : | private static UUID GetSessionID(string account) | ||
| 422 : | { | ||
| 423 : | UUID agentID = new UUID(Util.Md5Hash(account + "session")); | ||
| 424 : | return agentID; | ||
| 425 : | } | ||
| 426 : | |||
| 427 : | /// <summary> | ||
| 428 : | /// Not really secure. | ||
| 429 : | /// </summary> | ||
| 430 : | private static UUID GetSecureID(string account) | ||
| 431 : | { | ||
| 432 : | UUID agentID = new UUID(Util.Md5Hash(account + "secure")); | ||
| 433 : | return agentID; | ||
| 434 : | } | ||
| 435 : | |||
| 436 : | mikkopa | 73 | /// <summary> |
| 437 : | /// Converts the inventory library skeleton into the form required by the rpc request. | ||
| 438 : | /// </summary> | ||
| 439 : | /// <returns></returns> | ||
| 440 : | protected virtual ArrayList GetInventoryLibrary() | ||
| 441 : | { | ||
| 442 : | Dictionary<UUID, InventoryFolderImpl> rootFolders | ||
| 443 : | = m_libraryRootFolder.RequestSelfAndDescendentFolders(); | ||
| 444 : | ArrayList folderHashes = new ArrayList(); | ||
| 445 : | |||
| 446 : | foreach (InventoryFolderBase folder in rootFolders.Values) | ||
| 447 : | { | ||
| 448 : | Hashtable TempHash = new Hashtable(); | ||
| 449 : | TempHash["name"] = folder.Name; | ||
| 450 : | TempHash["parent_id"] = folder.ParentID.ToString(); | ||
| 451 : | TempHash["version"] = (Int32)folder.Version; | ||
| 452 : | TempHash["type_default"] = (Int32)folder.Type; | ||
| 453 : | TempHash["folder_id"] = folder.ID.ToString(); | ||
| 454 : | folderHashes.Add(TempHash); | ||
| 455 : | } | ||
| 456 : | |||
| 457 : | return folderHashes; | ||
| 458 : | } | ||
| 459 : | |||
| 460 : | afrisby | 6 | #endregion |
| 461 : | |||
| 462 : | afrisby | 3 | } |
| 463 : | afrisby | 6 | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

