public override Hashtable ToHashtable() { try { Hashtable responseData = new Hashtable(); loginFlagsHash = new Hashtable(); loginFlagsHash["daylight_savings"] = DST; loginFlagsHash["stipend_since_login"] = StipendSinceLogin; loginFlagsHash["gendered"] = Gendered; loginFlagsHash["ever_logged_in"] = EverLoggedIn; loginFlags.Add(loginFlagsHash); responseData["first_name"] = Firstname; responseData["last_name"] = Lastname; responseData["display_name"] = DisplayName; responseData["agent_access"] = agentAccess; responseData["agent_access_max"] = agentAccessMax; responseData["udp_blacklist"] = udpBlackList; if (AllowFirstLife != null) { uiConfigHash["allow_first_life"] = AllowFirstLife; } uiConfig.Add(uiConfigHash); responseData["sim_port"] = (Int32)SimPort; responseData["sim_ip"] = SimAddress; responseData["http_port"] = (Int32)SimHttpPort; responseData["agent_id"] = AgentID.ToString(); responseData["session_id"] = SessionID.ToString(); responseData["secure_session_id"] = SecureSessionID.ToString(); responseData["circuit_code"] = CircuitCode; responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; responseData["login-flags"] = loginFlags; responseData["seed_capability"] = seedCapability; responseData["event_categories"] = eventCategories; responseData["event_notifications"] = new ArrayList(); // TODO: What is this? responseData["classified_categories"] = classifiedCategories; responseData["ui-config"] = uiConfig; responseData["export"] = AllowExportPermission ? "flag" : ""; if (agentInventory != null) { responseData["inventory-skeleton"] = agentInventory; responseData["inventory-root"] = inventoryRoot; } responseData["inventory-skel-lib"] = InventoryLibrary; responseData["inventory-lib-root"] = InventoryLibRoot; responseData["gestures"] = activeGestures; responseData["inventory-lib-owner"] = InventoryLibraryOwner; responseData["initial-outfit"] = initialOutfit; responseData["tutorial_setting"] = tutorial; responseData["start_location"] = startLocation; responseData["home"] = home; responseData["look_at"] = lookAt; responseData["message"] = Message; responseData["region_x"] = (Int32)(RegionX); responseData["region_y"] = (Int32)(RegionY); responseData["region_size_x"] = (RegionSizeX); responseData["region_size_y"] = (RegionSizeY); #region Global Textures ArrayList globalTextures = new ArrayList(); Hashtable globalTexturesHash = new Hashtable(); globalTexturesHash["sun_texture_id"] = SunTexture; globalTexturesHash["cloud_texture_id"] = CloudTexture; globalTexturesHash["moon_texture_id"] = MoonTexture; globalTextures.Add(globalTexturesHash); responseData["global-textures"] = globalTextures; #endregion Global Textures if (SearchURL != String.Empty) { responseData["search"] = SearchURL; } IMapService mapService = m_registry.RequestModuleInterface <IMapService>(); if (mapService != null) { responseData["map-server-url"] = mapService.GetURLOfMap(); } else if (MapTileURL != String.Empty) { responseData["map-server-url"] = MapTileURL; } if (WebProfileURL != String.Empty) { responseData["web_profile_url"] = WebProfileURL; } if (HelpURL != String.Empty) { responseData["help_url_format"] = HelpURL; } if (SnapshotConfigURL != String.Empty) { responseData["snapshot_config_url"] = SnapshotConfigURL; } if (HelpURL != String.Empty) { responseData["help_url_format"] = HelpURL; } if (OpenIDURL != String.Empty) { responseData["openid_url"] = OpenIDURL; } if (MaxAgentGroups != 0) { responseData["max-agent-groups"] = MaxAgentGroups; } else { responseData["max-agent-groups"] = 100; } //Makes viewers crash... if (VoiceServerType != String.Empty) { Hashtable voice_config = new Hashtable(); voice_config["VoiceServerType"] = VoiceServerType; ArrayList list = new ArrayList { voice_config }; responseData["voice-config"] = list; } if (m_buddyList != null) { responseData["buddy-list"] = m_buddyList.ToArray(); } if (m_source != null) { // we're mapping GridInfoService keys to // the ones expected by known viewers. // hippo, imprudence, phoenix are known to work IConfig gridInfo = m_source.Configs["GridInfoService"]; if (gridInfo.GetBoolean("SendGridInfoToViewerOnLogin", false)) { string tmp; tmp = gridInfo.GetString("gridname", String.Empty); if (tmp != String.Empty) { responseData["gridname"] = tmp; } tmp = gridInfo.GetString("login", String.Empty); if (tmp != String.Empty) { responseData["loginuri"] = tmp; } // alternate keys of the same thing. (note careful not to overwrite responsdata["welcome"] tmp = gridInfo.GetString("loginpage", String.Empty); if (tmp != String.Empty) { responseData["loginpage"] = tmp; } tmp = gridInfo.GetString("welcome", String.Empty); if (tmp != String.Empty) { responseData["loginpage"] = tmp; } // alternate keys of the same thing. tmp = gridInfo.GetString("economy", String.Empty); if (tmp != String.Empty) { responseData["economy"] = tmp; } tmp = gridInfo.GetString("helperuri", String.Empty); if (tmp != String.Empty) { responseData["helperuri"] = tmp; } tmp = gridInfo.GetString("about", String.Empty); if (tmp != String.Empty) { responseData["about"] = tmp; } tmp = gridInfo.GetString("help", String.Empty); if (tmp != String.Empty) { responseData["help"] = tmp; } tmp = gridInfo.GetString("register", String.Empty); if (tmp != String.Empty) { responseData["register"] = tmp; } tmp = gridInfo.GetString("password", String.Empty); if (tmp != String.Empty) { responseData["password"] = tmp; } tmp = gridInfo.GetString("CurrencySymbol", String.Empty); if (tmp != String.Empty) { responseData["currency"] = tmp; } tmp = gridInfo.GetString("RealCurrencySymbol", String.Empty); if (tmp != String.Empty) { responseData["real_currency"] = tmp; } tmp = gridInfo.GetString("DirectoryFee", String.Empty); if (tmp != String.Empty) { responseData["directory_fee"] = tmp; } tmp = gridInfo.GetString("MaxGroups", String.Empty); if (tmp != String.Empty) { responseData["max_groups"] = tmp; } } } responseData["login"] = "******"; return(responseData); } catch (Exception e) { MainConsole.Instance.Warn("[CLIENT]: LoginResponse: Error creating Hashtable Response: " + e); return(LLFailedLoginResponse.InternalError.ToHashtable()); } }
public override Hashtable ToHashtable() { try { Hashtable responseData = new Hashtable(); loginFlagsHash = new Hashtable(); loginFlagsHash["daylight_savings"] = DST; loginFlagsHash["stipend_since_login"] = StipendSinceLogin; loginFlagsHash["gendered"] = Gendered; loginFlagsHash["ever_logged_in"] = EverLoggedIn; loginFlags.Add(loginFlagsHash); responseData["first_name"] = Firstname; responseData["last_name"] = Lastname; responseData["agent_access"] = agentAccess; responseData["agent_access_max"] = agentAccessMax; globalTextures.Add(globalTexturesHash); // this.eventCategories.Add(this.eventCategoriesHash); AddToUIConfig("allow_first_life", allowFirstLife); uiConfig.Add(uiConfigHash); responseData["sim_port"] = (Int32)SimPort; responseData["sim_ip"] = SimAddress; responseData["http_port"] = (Int32)SimHttpPort; responseData["agent_id"] = AgentID.ToString(); responseData["session_id"] = SessionID.ToString(); responseData["secure_session_id"] = SecureSessionID.ToString(); responseData["circuit_code"] = CircuitCode; responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; responseData["login-flags"] = loginFlags; responseData["global-textures"] = globalTextures; responseData["seed_capability"] = seedCapability; responseData["event_categories"] = eventCategories; responseData["event_notifications"] = new ArrayList(); // todo responseData["classified_categories"] = classifiedCategories; responseData["ui-config"] = uiConfig; if (agentInventory != null) { responseData["inventory-skeleton"] = agentInventory; responseData["inventory-root"] = inventoryRoot; } responseData["inventory-skel-lib"] = inventoryLibrary; responseData["inventory-lib-root"] = inventoryLibRoot; responseData["gestures"] = activeGestures; responseData["inventory-lib-owner"] = inventoryLibraryOwner; responseData["initial-outfit"] = initialOutfit; responseData["start_location"] = startLocation; responseData["seed_capability"] = seedCapability; responseData["home"] = home; responseData["look_at"] = lookAt; responseData["message"] = welcomeMessage; responseData["region_x"] = (Int32)(RegionX); responseData["region_y"] = (Int32)(RegionY); responseData["region_size_x"] = (Int32)RegionSizeX; responseData["region_size_y"] = (Int32)RegionSizeY; m_log.DebugFormat("[LOGIN RESPONSE] returning sizeX={0}, sizeY={1}", RegionSizeX, RegionSizeY); if (searchURL != String.Empty) { responseData["search"] = searchURL; } if (mapTileURL != String.Empty) { responseData["map-server-url"] = mapTileURL; } if (profileURL != String.Empty) { responseData["profile-server-url"] = profileURL; } if (DestinationsURL != String.Empty) { responseData["destination_guide_url"] = DestinationsURL; } if (AvatarsURL != String.Empty) { responseData["avatar_picker_url"] = AvatarsURL; } // We need to send an openid_token back in the response too if (openIDURL != String.Empty) { responseData["openid_url"] = openIDURL; } if (m_buddyList != null) { responseData["buddy-list"] = m_buddyList.ToArray(); } if (currency != String.Empty) { // responseData["real_currency"] = currency; responseData["currency"] = currency; } if (ClassifiedFee != String.Empty) { responseData["classified_fee"] = ClassifiedFee; } responseData["login"] = "******"; return(responseData); } catch (Exception e) { m_log.Warn("[CLIENT]: LoginResponse: Error creating Hashtable Response: " + e.Message); return(LLFailedLoginResponse.InternalError.ToHashtable()); } }
public virtual XmlRpcResponse ToXmlRpcResponse() { try { Hashtable responseData = new Hashtable(); loginFlagsHash = new Hashtable(); loginFlagsHash["daylight_savings"] = DST; loginFlagsHash["stipend_since_login"] = StipendSinceLogin; loginFlagsHash["gendered"] = Gendered; loginFlagsHash["ever_logged_in"] = EverLoggedIn; loginFlags.Add(loginFlagsHash); responseData["first_name"] = Firstname; responseData["last_name"] = Lastname; responseData["agent_access"] = agentAccess; responseData["agent_access_max"] = agentAccess; responseData["agent_region_access"] = agentAccess; globalTexturesHash = new Hashtable(); globalTexturesHash["sun_texture_id"] = SunTexture; globalTexturesHash["cloud_texture_id"] = CloudTexture; globalTexturesHash["moon_texture_id"] = MoonTexture; globalTextures.Add(globalTexturesHash); // this.eventCategories.Add(this.eventCategoriesHash); AddToUIConfig("allow_first_life", allowFirstLife); uiConfig.Add(uiConfigHash); responseData["sim_port"] = (Int32)SimPort; responseData["sim_ip"] = SimAddress; responseData["http_port"] = (Int32)SimHttpPort; responseData["agent_id"] = AgentID.ToString(); responseData["session_id"] = SessionID.ToString(); responseData["secure_session_id"] = SecureSessionID.ToString(); responseData["circuit_code"] = CircuitCode; responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; responseData["login-flags"] = loginFlags; responseData["global-textures"] = globalTextures; responseData["seed_capability"] = seedCapability; // m_log.WarnFormat("[LOGIN]: >>> ToXmlRpcResponse UUID={0} SSID={1}", AgentID, SecureSessionID); responseData["event_categories"] = eventCategories; responseData["event_notifications"] = new ArrayList(); // todo responseData["classified_categories"] = classifiedCategories; responseData["ui-config"] = uiConfig; if (agentInventory != null) { responseData["inventory-skeleton"] = agentInventory; responseData["inventory-root"] = inventoryRoot; } responseData["inventory-skel-lib"] = inventoryLibrary; responseData["inventory-lib-root"] = inventoryLibRoot; responseData["gestures"] = activeGestures; responseData["inventory-lib-owner"] = inventoryLibraryOwner; responseData["initial-outfit"] = initialOutfit; responseData["start_location"] = startLocation; responseData["seed_capability"] = seedCapability; responseData["home"] = home; responseData["look_at"] = lookAt; responseData["message"] = welcomeMessage; responseData["region_x"] = (Int32)(RegionX * Constants.RegionSize); responseData["region_y"] = (Int32)(RegionY * Constants.RegionSize); responseData["cof_version"] = CofVersion; responseData["map-server-url"] = MapServerURI; if (!String.IsNullOrWhiteSpace(ProfileServerURI)) // Just in case it's not set, let's let the viewers do as they will. { responseData["profile-server-url"] = ProfileServerURI; responseData["web_profile_url"] = ProfileServerURI; // Support Aurora-sim-style web profile urls. } responseData["max-agent-groups"] = Constants.MaxGroups.ToString(); if (m_buddyList != null) { responseData["buddy-list"] = m_buddyList.ToArray(); } responseData["login"] = "******"; xmlRpcResponse.Value = responseData; return(xmlRpcResponse); } catch (Exception e) { m_log.Warn("[CLIENT]: LoginResponse: Error creating XML-RPC Response: " + e.Message); return(GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); } }
public override OSD ToOSDMap() { try { OSDMap map = new OSDMap(); map["first_name"] = OSD.FromString(Firstname); map["last_name"] = OSD.FromString(Lastname); map["agent_access"] = OSD.FromString(agentAccess); map["agent_access_max"] = OSD.FromString(agentAccessMax); map["sim_port"] = OSD.FromInteger(SimPort); map["sim_ip"] = OSD.FromString(SimAddress); map["agent_id"] = OSD.FromUUID(AgentID); map["real_id"] = OSD.FromUUID(RealID); map["session_id"] = OSD.FromUUID(SessionID); map["secure_session_id"] = OSD.FromUUID(SecureSessionID); map["circuit_code"] = OSD.FromInteger(CircuitCode); map["seconds_since_epoch"] = OSD.FromInteger((int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds); #region Login Flags OSDMap loginFlagsLLSD = new OSDMap(); loginFlagsLLSD["daylight_savings"] = OSD.FromString(DST); loginFlagsLLSD["stipend_since_login"] = OSD.FromString(StipendSinceLogin); loginFlagsLLSD["gendered"] = OSD.FromString(Gendered); loginFlagsLLSD["ever_logged_in"] = OSD.FromString(EverLoggedIn); map["login-flags"] = WrapOSDMap(loginFlagsLLSD); #endregion Login Flags #region Global Textures OSDMap globalTexturesLLSD = new OSDMap(); globalTexturesLLSD["sun_texture_id"] = OSD.FromString(SunTexture); globalTexturesLLSD["cloud_texture_id"] = OSD.FromString(CloudTexture); globalTexturesLLSD["moon_texture_id"] = OSD.FromString(MoonTexture); map["global-textures"] = WrapOSDMap(globalTexturesLLSD); #endregion Global Textures map["seed_capability"] = OSD.FromString(seedCapability); map["event_categories"] = ArrayListToOSDArray(eventCategories); //map["event_notifications"] = new OSDArray(); // todo map["classified_categories"] = ArrayListToOSDArray(classifiedCategories); #region UI Config OSDMap uiConfigLLSD = new OSDMap(); uiConfigLLSD["allow_first_life"] = OSD.FromString(allowFirstLife); map["ui-config"] = WrapOSDMap(uiConfigLLSD); #endregion UI Config #region Inventory map["inventory-skeleton"] = ArrayListToOSDArray(agentInventory); map["inventory-skel-lib"] = ArrayListToOSDArray(inventoryLibrary); map["inventory-root"] = ArrayListToOSDArray(inventoryRoot);; map["inventory-lib-root"] = ArrayListToOSDArray(inventoryLibRoot); map["inventory-lib-owner"] = ArrayListToOSDArray(inventoryLibraryOwner); #endregion Inventory map["gestures"] = ArrayListToOSDArray(activeGestures); map["initial-outfit"] = ArrayListToOSDArray(initialOutfit); map["start_location"] = OSD.FromString(startLocation); map["seed_capability"] = OSD.FromString(seedCapability); map["home"] = OSD.FromString(home); map["look_at"] = OSD.FromString(lookAt); map["max-agent-groups"] = OSD.FromInteger(MaxAgentGroups); map["message"] = OSD.FromString(welcomeMessage); map["region_x"] = OSD.FromInteger(RegionX); map["region_y"] = OSD.FromInteger(RegionY); if (mapTileURL != String.Empty) { map["map-server-url"] = OSD.FromString(mapTileURL); } if (profileURL != String.Empty) { map["profile-server-url"] = OSD.FromString(profileURL); } if (openIDURL != String.Empty) { map["openid_url"] = OSD.FromString(openIDURL); map["openid_token"] = OSD.FromString(AgentID.ToString() + ":" + Util.Md5Hash(SecureSessionID.ToString())); } if (searchURL != String.Empty) { map["search"] = OSD.FromString(searchURL); } if (ClassifiedFee != String.Empty) { map["classified_fee"] = OSD.FromString(ClassifiedFee); } if (m_buddyList != null) { map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); } map["login"] = OSD.FromString("true"); return(map); } catch (Exception e) { m_log.Warn("[CLIENT]: LoginResponse: Error creating LLSD Response: " + e.Message); return(LLFailedLoginResponse.InternalError.ToOSDMap()); } }
public virtual XmlRpcResponse ToXmlRpcResponse() { try { Hashtable responseData = new Hashtable(); loginFlagsHash = new Hashtable(); loginFlagsHash["daylight_savings"] = DST; loginFlagsHash["stipend_since_login"] = StipendSinceLogin; loginFlagsHash["gendered"] = Gendered; loginFlagsHash["ever_logged_in"] = EverLoggedIn; loginFlags.Add(loginFlagsHash); responseData["first_name"] = Firstname; responseData["last_name"] = Lastname; responseData["agent_access"] = agentAccess; globalTexturesHash = new Hashtable(); globalTexturesHash["sun_texture_id"] = SunTexture; globalTexturesHash["cloud_texture_id"] = CloudTexture; globalTexturesHash["moon_texture_id"] = MoonTexture; globalTextures.Add(globalTexturesHash); // this.eventCategories.Add(this.eventCategoriesHash); AddToUIConfig("allow_first_life", allowFirstLife); uiConfig.Add(uiConfigHash); responseData["sim_port"] = (Int32)SimPort; responseData["sim_ip"] = SimAddress; responseData["http_port"] = (Int32)SimHttpPort; responseData["agent_id"] = AgentID.ToString(); responseData["session_id"] = SessionID.ToString(); responseData["secure_session_id"] = SecureSessionID.ToString(); responseData["circuit_code"] = CircuitCode; responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; responseData["login-flags"] = loginFlags; responseData["global-textures"] = globalTextures; responseData["seed_capability"] = seedCapability; responseData["event_categories"] = eventCategories; responseData["event_notifications"] = new ArrayList(); // todo responseData["classified_categories"] = classifiedCategories; responseData["ui-config"] = uiConfig; if (agentInventory != null) { responseData["inventory-skeleton"] = agentInventory; responseData["inventory-root"] = inventoryRoot; } responseData["inventory-skel-lib"] = inventoryLibrary; responseData["inventory-lib-root"] = inventoryLibRoot; responseData["gestures"] = activeGestures; responseData["inventory-lib-owner"] = inventoryLibraryOwner; responseData["initial-outfit"] = initialOutfit; responseData["start_location"] = startLocation; responseData["seed_capability"] = seedCapability; responseData["home"] = home; responseData["look_at"] = lookAt; responseData["message"] = welcomeMessage; responseData["region_x"] = (Int32)(RegionX * Constants.RegionSize); responseData["region_y"] = (Int32)(RegionY * Constants.RegionSize); if (m_buddyList != null) { responseData["buddy-list"] = m_buddyList.ToArray(); } responseData["login"] = "******"; xmlRpcResponse.Value = responseData; return(xmlRpcResponse); } catch (Exception e) { m_log.Warn("[CLIENT]: LoginResponse: Error creating XML-RPC Response: " + e.Message); return(GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); } }