public void RegisterCaps(IRegionClientCapsService service) { m_service = service; m_presenceService = service.Registry.RequestModuleInterface<IPresenceService>(); m_gridUserService = service.Registry.RequestModuleInterface<IGridUserService>(); GenericHTTPMethod method = delegate(Hashtable httpMethod) { return ProcessUpdateAgentLanguage(httpMethod, m_service.AgentID); }; service.AddStreamHandler("UpdateAgentLanguage", new RestHTTPHandler("POST", service.CreateCAPS("UpdateAgentLanguage", ""), method)); method = delegate(Hashtable httpMethod) { return ProcessUpdateAgentInfo(httpMethod, m_service.AgentID); }; service.AddStreamHandler("UpdateAgentInformation", new RestHTTPHandler("POST", service.CreateCAPS("UpdateAgentInformation", ""), method)); method = delegate(Hashtable httpMethod) { return HomeLocation(httpMethod, m_service.AgentID); }; service.AddStreamHandler("HomeLocation", new RestHTTPHandler("POST", service.CreateCAPS("HomeLocation", ""), method)); }
public UserAccountService(IConfigSource config) : base(config) { IConfig userConfig = config.Configs["UserAccountService"]; if (userConfig == null) throw new Exception("No UserAccountService configuration"); string gridServiceDll = userConfig.GetString("GridService", string.Empty); if (gridServiceDll != string.Empty) m_GridService = LoadPlugin<IGridService>(gridServiceDll, new Object[] { config }); string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty); if (authServiceDll != string.Empty) m_AuthenticationService = LoadPlugin<IAuthenticationService>(authServiceDll, new Object[] { config }); string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty); if (presenceServiceDll != string.Empty) m_GridUserService = LoadPlugin<IGridUserService>(presenceServiceDll, new Object[] { config }); string invServiceDll = userConfig.GetString("InventoryService", string.Empty); if (invServiceDll != string.Empty) m_InventoryService = LoadPlugin<IInventoryService>(invServiceDll, new Object[] { config }); string avatarServiceDll = userConfig.GetString("AvatarService", string.Empty); if (avatarServiceDll != string.Empty) m_AvatarService = LoadPlugin<IAvatarService>(avatarServiceDll, new Object[] { config }); m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false); // In case there are several instances of this class in the same process, // the console commands are only registered for the root instance if (m_RootInstance == null && MainConsole.Instance != null) { m_RootInstance = this; MainConsole.Instance.Commands.AddCommand("Users", false, "create user", "create user [<first> [<last> [<pass> [<email> [<user id>]]]]]", "Create a new user", HandleCreateUser); MainConsole.Instance.Commands.AddCommand("Users", false, "reset user password", "reset user password [<first> [<last> [<password>]]]", "Reset a user password", HandleResetUserPassword); MainConsole.Instance.Commands.AddCommand("Users", false, "set user level", "set user level [<first> [<last> [<level>]]]", "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, " + "this account will be treated as god-moded. " + "It will also affect the 'login level' command. ", HandleSetUserLevel); MainConsole.Instance.Commands.AddCommand("Users", false, "show account", "show account <first> <last>", "Show account details for the given user", HandleShowAccount); } }
public CAPSPrivateSeedHandler(IHttpServer server, IInventoryService inventoryService, ILibraryService libraryService, IGridUserService guService, IPresenceService presenceService, string URL, UUID agentID, string HostName) { m_server = server; m_InventoryService = inventoryService; m_LibraryService = libraryService; m_GridUserService = guService; m_PresenceService = presenceService; SimToInform = URL; m_AgentID = agentID; m_HostName = HostName; if(m_server != null) AddServerCAPS(); }
public GridUserServiceConnector(IConfigSource config, IHttpServer server, string configName) : base(config, server, configName) { IConfig serverConfig = config.Configs[m_ConfigName]; if (serverConfig == null) throw new Exception(String.Format("No section {0} in config file", m_ConfigName)); string service = serverConfig.GetString("LocalServiceModule", String.Empty); if (service == String.Empty) throw new Exception("No LocalServiceModule in config file"); Object[] args = new Object[] { config }; m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(service, args); server.AddStreamHandler(new GridUserServerPostHandler(m_GridUserService)); }
public void Initialise(IConfigSource source) { IConfig moduleConfig = source.Configs["Modules"]; if (moduleConfig != null) { string name = moduleConfig.GetString("GridUserServices", ""); if (name == Name) { m_RemoteConnector = new GridUserServicesConnector(source); m_Enabled = true; m_ActivityDetector = new ActivityDetector(this); m_log.Info("[REMOTE GRID USER CONNECTOR]: Remote grid user enabled"); } } }
public UserAccountService(IConfigSource config) : base(config) { IConfig userConfig = config.Configs["UserAccountService"]; if (userConfig == null) throw new Exception("No UserAccountService configuration"); // In case there are several instances of this class in the same process, // the console commands are only registered for the root instance if (m_RootInstance == null) { m_RootInstance = this; string gridServiceDll = userConfig.GetString("GridService", string.Empty); if (gridServiceDll != string.Empty) m_GridService = LoadPlugin<IGridService>(gridServiceDll, new Object[] { config }); string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty); if (authServiceDll != string.Empty) m_AuthenticationService = LoadPlugin<IAuthenticationService>(authServiceDll, new Object[] { config }); string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty); if (presenceServiceDll != string.Empty) m_GridUserService = LoadPlugin<IGridUserService>(presenceServiceDll, new Object[] { config }); string invServiceDll = userConfig.GetString("InventoryService", string.Empty); if (invServiceDll != string.Empty) m_InventoryService = LoadPlugin<IInventoryService>(invServiceDll, new Object[] { config }); if (MainConsole.Instance != null) { MainConsole.Instance.Commands.AddCommand("UserService", false, "create user", "create user [<first> [<last> [<pass> [<email>]]]]", "Create a new user", HandleCreateUser); MainConsole.Instance.Commands.AddCommand("UserService", false, "reset user password", "reset user password [<first> [<last> [<password>]]]", "Reset a user password", HandleResetUserPassword); } } }
public void Initialise(IConfigSource source) { IConfig moduleConfig = source.Configs["Modules"]; if (moduleConfig != null) { string name = moduleConfig.GetString("GridUserServices", ""); if (name == Name) { IConfig userConfig = source.Configs["GridUserService"]; if (userConfig == null) { m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: GridUserService missing from OpenSim.ini"); return; } string serviceDll = userConfig.GetString("LocalServiceModule", String.Empty); if (serviceDll == String.Empty) { m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: No LocalServiceModule named in section GridUserService"); return; } Object[] args = new Object[] { source }; m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(serviceDll, args); if (m_GridUserService == null) { m_log.ErrorFormat( "[LOCAL GRID USER SERVICE CONNECTOR]: Cannot load user account service specified as {0}", serviceDll); return; } m_ActivityDetector = new ActivityDetector(this); m_Enabled = true; m_log.Info("[LOCAL GRID USER SERVICE CONNECTOR]: Local grid user connector enabled"); } } }
public UserAgentService(IConfigSource config) { if (!m_Initialized) { m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); IConfig serverConfig = config.Configs["UserAgentService"]; if (serverConfig == null) throw new Exception(String.Format("No section UserAgentService in config file")); string gridService = serverConfig.GetString("GridService", String.Empty); string gridUserService = serverConfig.GetString("GridUserService", String.Empty); if (gridService == string.Empty || gridUserService == string.Empty) throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); m_GatekeeperConnector = new GatekeeperServiceConnector(); m_Initialized = true; } }
public void Initialise(IConfigSource source) { IConfig moduleConfig = source.Configs["Modules"]; if (moduleConfig != null) { string name = moduleConfig.GetString("GridUserServices", ""); if (name == Name) { IConfig userConfig = source.Configs["GridUserService"]; if (userConfig == null) { m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: GridUserService missing from ini files"); return; } string serviceDll = userConfig.GetString("LocalServiceModule", String.Empty); if (serviceDll == String.Empty) { m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: No LocalServiceModule named in section GridUserService"); return; } Object[] args = new Object[] { source }; m_service = ServerUtils.LoadPlugin<IGridUserService>(serviceDll, args); if (m_service == null) { m_log.Error("[LOCAL GRID USER SERVICE CONNECTOR]: Can't load GridUser service"); return; } m_Enabled = true; m_log.Info("[LOCAL GRID USER SERVICE CONNECTOR]: Local GridUser connector enabled"); } } }
// IConfig m_ClientsConfig; public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService) { m_LoginServerConfig = config.Configs["LoginService"]; if (m_LoginServerConfig == null) { throw new Exception(String.Format("No section LoginService in config file")); } string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty); string gridUserService = m_LoginServerConfig.GetString("GridUserService", String.Empty); string agentService = m_LoginServerConfig.GetString("UserAgentService", String.Empty); string authService = m_LoginServerConfig.GetString("AuthenticationService", String.Empty); string invService = m_LoginServerConfig.GetString("InventoryService", String.Empty); string gridService = m_LoginServerConfig.GetString("GridService", String.Empty); string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty); string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty); string friendsService = m_LoginServerConfig.GetString("FriendsService", String.Empty); string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty); string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty); m_DefaultRegionName = m_LoginServerConfig.GetString("DefaultRegion", String.Empty); m_WelcomeMessage = m_LoginServerConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true); m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_GatekeeperURL = Util.GetConfigVarFromSections <string>(config, "GatekeeperURI", new string[] { "Startup", "Hypergrid", "LoginService" }, String.Empty); m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); m_ProfileURL = m_LoginServerConfig.GetString("ProfileServerURL", string.Empty); m_OpenIDURL = m_LoginServerConfig.GetString("OpenIDServerURL", String.Empty); m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty); m_ClassifiedFee = m_LoginServerConfig.GetString("ClassifiedFee", string.Empty); m_DestinationGuide = m_LoginServerConfig.GetString("DestinationGuide", string.Empty); m_AvatarPicker = m_LoginServerConfig.GetString("AvatarPicker", string.Empty); m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty); m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty); m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time"); // Clean up some of these vars if (m_MapTileURL != String.Empty) { m_MapTileURL = m_MapTileURL.Trim(); if (!m_MapTileURL.EndsWith("/")) { m_MapTileURL = m_MapTileURL + "/"; } } // These are required; the others aren't if (accountService == string.Empty || authService == string.Empty) { throw new Exception("LoginService is missing service specifications"); } // replace newlines in welcome message m_WelcomeMessage = m_WelcomeMessage.Replace("\\n", "\n"); Object[] args = new Object[] { config }; m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(accountService, args); m_GridUserService = ServerUtils.LoadPlugin <IGridUserService>(gridUserService, args); m_AuthenticationService = ServerUtils.LoadPlugin <IAuthenticationService>(authService, args); m_InventoryService = ServerUtils.LoadPlugin <IInventoryService>(invService, args); if (gridService != string.Empty) { m_GridService = ServerUtils.LoadPlugin <IGridService>(gridService, args); } if (presenceService != string.Empty) { m_PresenceService = ServerUtils.LoadPlugin <IPresenceService>(presenceService, args); } if (avatarService != string.Empty) { m_AvatarService = ServerUtils.LoadPlugin <IAvatarService>(avatarService, args); } if (friendsService != string.Empty) { m_FriendsService = ServerUtils.LoadPlugin <IFriendsService>(friendsService, args); } if (simulationService != string.Empty) { m_RemoteSimulationService = ServerUtils.LoadPlugin <ISimulationService>(simulationService, args); } if (agentService != string.Empty) { m_UserAgentService = ServerUtils.LoadPlugin <IUserAgentService>(agentService, args); } // // deal with the services given as argument // m_LocalSimulationService = simService; if (libraryService != null) { m_log.DebugFormat("[LLOGIN SERVICE]: Using LibraryService given as argument"); m_LibraryService = libraryService; } else if (libService != string.Empty) { m_log.DebugFormat("[LLOGIN SERVICE]: Using instantiated LibraryService"); m_LibraryService = ServerUtils.LoadPlugin <ILibraryService>(libService, args); } m_GatekeeperConnector = new GatekeeperServiceConnector(); if (!Initialized) { Initialized = true; RegisterCommands(); } m_log.DebugFormat("[LLOGIN SERVICE]: Starting..."); }
public ActivityDetector(IGridUserService guservice) { m_GridUserService = guservice; m_log.DebugFormat("[ACTIVITY DETECTOR]: starting "); }
public void PostInitialize(IConfigSource config, IRegistryCore registry) { m_GridUserService = registry.RequestModuleInterface<IGridUserService>(); }
public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService) { m_LoginServerConfig = config.Configs["LoginService"]; if (m_LoginServerConfig == null) { throw new Exception(String.Format("No section LoginService in config file")); } string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty); string gridUserService = m_LoginServerConfig.GetString("GridUserService", String.Empty); string agentService = m_LoginServerConfig.GetString("UserAgentService", String.Empty); string authService = m_LoginServerConfig.GetString("AuthenticationService", String.Empty); string invService = m_LoginServerConfig.GetString("InventoryService", String.Empty); string gridService = m_LoginServerConfig.GetString("GridService", String.Empty); string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty); string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty); string friendsService = m_LoginServerConfig.GetString("FriendsService", String.Empty); string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty); string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty); m_DefaultRegionName = m_LoginServerConfig.GetString("DefaultRegion", String.Empty); m_WelcomeMessage = m_LoginServerConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true); m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); // These are required; the others aren't if (accountService == string.Empty || authService == string.Empty) { throw new Exception("LoginService is missing service specifications"); } Object[] args = new Object[] { config }; m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(accountService, args); m_GridUserService = ServerUtils.LoadPlugin <IGridUserService>(gridUserService, args); m_AuthenticationService = ServerUtils.LoadPlugin <IAuthenticationService>(authService, args); m_InventoryService = ServerUtils.LoadPlugin <IInventoryService>(invService, args); if (gridService != string.Empty) { m_GridService = ServerUtils.LoadPlugin <IGridService>(gridService, args); } if (presenceService != string.Empty) { m_PresenceService = ServerUtils.LoadPlugin <IPresenceService>(presenceService, args); } if (avatarService != string.Empty) { m_AvatarService = ServerUtils.LoadPlugin <IAvatarService>(avatarService, args); } if (friendsService != string.Empty) { m_FriendsService = ServerUtils.LoadPlugin <IFriendsService>(friendsService, args); } if (simulationService != string.Empty) { m_RemoteSimulationService = ServerUtils.LoadPlugin <ISimulationService>(simulationService, args); } if (agentService != string.Empty) { m_UserAgentService = ServerUtils.LoadPlugin <IUserAgentService>(agentService, args); } // // deal with the services given as argument // m_LocalSimulationService = simService; if (libraryService != null) { m_log.DebugFormat("[LLOGIN SERVICE]: Using LibraryService given as argument"); m_LibraryService = libraryService; } else if (libService != string.Empty) { m_log.DebugFormat("[LLOGIN SERVICE]: Using instantiated LibraryService"); m_LibraryService = ServerUtils.LoadPlugin <ILibraryService>(libService, args); } m_GatekeeperConnector = new GatekeeperServiceConnector(); if (!Initialized) { Initialized = true; RegisterCommands(); } m_log.DebugFormat("[LLOGIN SERVICE]: Starting..."); }
public GatekeeperService(IConfigSource config, ISimulationService simService) { if (!m_Initialized) { m_Initialized = true; IConfig serverConfig = config.Configs["GatekeeperService"]; if (serverConfig == null) { throw new Exception(String.Format("No section GatekeeperService in config file")); } string accountService = serverConfig.GetString("UserAccountService", String.Empty); string homeUsersService = serverConfig.GetString("UserAgentService", string.Empty); string gridService = serverConfig.GetString("GridService", String.Empty); string presenceService = serverConfig.GetString("PresenceService", String.Empty); string simulationService = serverConfig.GetString("SimulationService", String.Empty); string gridUserService = serverConfig.GetString("GridUserService", String.Empty); string bansService = serverConfig.GetString("BansService", String.Empty); // These are mandatory, the others aren't if (gridService == string.Empty || presenceService == string.Empty) { throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); } string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); UUID.TryParse(scope, out m_ScopeID); //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); m_ExternalName = Util.GetConfigVarFromSections <string>(config, "GatekeeperURI", new string[] { "Startup", "Hypergrid", "GatekeeperService" }, String.Empty); m_ExternalName = serverConfig.GetString("ExternalName", m_ExternalName); if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/")) { m_ExternalName = m_ExternalName + "/"; } try { m_Uri = new Uri(m_ExternalName); } catch { m_log.WarnFormat("[GATEKEEPER SERVICE]: Malformed gatekeeper address {0}", m_ExternalName); } Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin <IGridService>(gridService, args); m_PresenceService = ServerUtils.LoadPlugin <IPresenceService>(presenceService, args); if (accountService != string.Empty) { m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(accountService, args); } if (homeUsersService != string.Empty) { m_UserAgentService = ServerUtils.LoadPlugin <IUserAgentService>(homeUsersService, args); } if (gridUserService != string.Empty) { m_GridUserService = ServerUtils.LoadPlugin <IGridUserService>(gridUserService, args); } if (bansService != string.Empty) { m_BansService = ServerUtils.LoadPlugin <IBansService>(bansService, args); } if (simService != null) { m_SimulationService = simService; } else if (simulationService != string.Empty) { m_SimulationService = ServerUtils.LoadPlugin <ISimulationService>(simulationService, args); } m_AllowedClients = serverConfig.GetString("AllowedClients", string.Empty); m_DeniedClients = serverConfig.GetString("DeniedClients", string.Empty); m_ForeignAgentsAllowed = serverConfig.GetBoolean("ForeignAgentsAllowed", true); LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_ForeignsAllowedExceptions); LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_ForeignsDisallowedExceptions); if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) { throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); } m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); } }
public void RegionLoaded(Scene scene) { m_GridUserService = scene.GridUserService; m_PresenceService = scene.PresenceService; m_PresenceService.LogoutRegionAgents(scene.RegionInfo.RegionID); }
public GridUserServerPostHandler(IGridUserService service) : base("POST", "/griduser") { m_GridUserService = service; }
public void PostInitialize(IConfigSource config, IRegistryCore registry) { m_UserAccountService = registry.RequestModuleInterface<IUserAccountService>(); m_GridUserService = registry.RequestModuleInterface<IGridUserService>(); m_AuthenticationService = registry.RequestModuleInterface<IAuthenticationService>(); m_InventoryService = registry.RequestModuleInterface<IInventoryService>(); m_GridService = registry.RequestModuleInterface<IGridService>(); m_PresenceService = registry.RequestModuleInterface<IPresenceService>(); m_AvatarService = registry.RequestModuleInterface<IAvatarService>(); m_FriendsService = registry.RequestModuleInterface<IFriendsService>(); m_SimulationService = registry.RequestModuleInterface<ISimulationService>(); m_AssetService = registry.RequestModuleInterface<IAssetService>(); m_LibraryService = registry.RequestModuleInterface<ILibraryService>(); m_CapsService = registry.RequestModuleInterface<ICapsService>(); }
public GridUserServerPostHandler(IGridUserService service, IServiceAuth auth) : base("POST", "/griduser", auth) { m_GridUserService = service; }
public UserAgentService(IConfigSource config, IFriendsSimConnector friendsConnector) { // Let's set this always, because we don't know the sequence // of instantiations if (friendsConnector != null) m_FriendsLocalSimConnector = friendsConnector; if (!m_Initialized) { m_Initialized = true; m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); m_FriendsSimConnector = new FriendsSimConnector(); IConfig serverConfig = config.Configs["UserAgentService"]; if (serverConfig == null) throw new Exception(String.Format("No section UserAgentService in config file")); string gridService = serverConfig.GetString("GridService", String.Empty); string gridUserService = serverConfig.GetString("GridUserService", String.Empty); string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty); string friendsService = serverConfig.GetString("FriendsService", String.Empty); string presenceService = serverConfig.GetString("PresenceService", String.Empty); string userAccountService = serverConfig.GetString("UserAccountService", String.Empty); m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false); if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty) throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); m_GatekeeperConnector = new GatekeeperServiceConnector(); m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args); m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args); m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountService, args); m_LevelOutsideContacts = serverConfig.GetInt("LevelOutsideContacts", 0); LoadTripPermissionsFromConfig(serverConfig, "ForeignTripsAllowed"); LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_TripsAllowedExceptions); LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_TripsDisallowedExceptions); m_GridName = serverConfig.GetString("ExternalName", string.Empty); if (m_GridName == string.Empty) { serverConfig = config.Configs["GatekeeperService"]; m_GridName = serverConfig.GetString("ExternalName", string.Empty); } if (!m_GridName.EndsWith("/")) m_GridName = m_GridName + "/"; } }
public UserAccountService(IConfigSource config) : base(config) { IConfig userConfig = config.Configs["UserAccountService"]; if (userConfig == null) { throw new Exception("No UserAccountService configuration"); } string gridServiceDll = userConfig.GetString("GridService", string.Empty); if (gridServiceDll != string.Empty) { m_GridService = LoadPlugin <IGridService>(gridServiceDll, new Object[] { config }); } string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty); if (authServiceDll != string.Empty) { m_AuthenticationService = LoadPlugin <IAuthenticationService>(authServiceDll, new Object[] { config }); } string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty); if (presenceServiceDll != string.Empty) { m_GridUserService = LoadPlugin <IGridUserService>(presenceServiceDll, new Object[] { config }); } string invServiceDll = userConfig.GetString("InventoryService", string.Empty); if (invServiceDll != string.Empty) { m_InventoryService = LoadPlugin <IInventoryService>(invServiceDll, new Object[] { config }); } string avatarServiceDll = userConfig.GetString("AvatarService", string.Empty); if (avatarServiceDll != string.Empty) { m_AvatarService = LoadPlugin <IAvatarService>(avatarServiceDll, new Object[] { config }); } m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false); // In case there are several instances of this class in the same process, // the console commands are only registered for the root instance if (m_RootInstance == null && MainConsole.Instance != null) { m_RootInstance = this; MainConsole.Instance.Commands.AddCommand("Users", false, "create user", "create user [<first> [<last> [<pass> [<email> [<user id>]]]]]", "Create a new user", HandleCreateUser); MainConsole.Instance.Commands.AddCommand("Users", false, "reset user password", "reset user password [<first> [<last> [<password>]]]", "Reset a user password", HandleResetUserPassword); MainConsole.Instance.Commands.AddCommand("Users", false, "set user level", "set user level [<first> [<last> [<level>]]]", "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, " + "this account will be treated as god-moded. " + "It will also affect the 'login level' command. ", HandleSetUserLevel); MainConsole.Instance.Commands.AddCommand("Users", false, "show account", "show account <first> <last>", "Show account details for the given user", HandleShowAccount); } }
public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService) { m_config = config; m_AuroraLoginConfig = config.Configs["AuroraLoginService"]; if (m_AuroraLoginConfig != null) { m_UseTOS = m_AuroraLoginConfig.GetBoolean("UseTermsOfServiceOnFirstLogin", false); m_DefaultHomeRegion = m_AuroraLoginConfig.GetString("DefaultHomeRegion", ""); m_DefaultUserAvatarArchive = m_AuroraLoginConfig.GetString("DefaultAvatarArchiveForNewUser", ""); m_AllowAnonymousLogin = m_AuroraLoginConfig.GetBoolean("AllowAnonymousLogin", false); m_AuthenticateUsers = m_AuroraLoginConfig.GetBoolean("AuthenticateUsers", true); m_TOSLocation = m_AuroraLoginConfig.GetString("FileNameOfTOS", ""); m_AllowFirstLife = m_AuroraLoginConfig.GetBoolean("AllowFirstLifeInProfile", true); m_TutorialURL = m_AuroraLoginConfig.GetString("TutorialURL", m_TutorialURL); ReadEventValues(m_AuroraLoginConfig); ReadClassifiedValues(m_AuroraLoginConfig); CAPSServerURL = m_AuroraLoginConfig.GetString("CAPSServiceURL", ""); CAPSServicePassword = m_AuroraLoginConfig.GetString("CAPSServicePassword", ""); } m_LoginServerConfig = config.Configs["LoginService"]; if (m_LoginServerConfig == null) throw new Exception(String.Format("No section LoginService in config file")); string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty); string gridUserService = m_LoginServerConfig.GetString("GridUserService", String.Empty); string agentService = m_LoginServerConfig.GetString("UserAgentService", String.Empty); string authService = m_LoginServerConfig.GetString("AuthenticationService", String.Empty); string invService = m_LoginServerConfig.GetString("InventoryService", String.Empty); string gridService = m_LoginServerConfig.GetString("GridService", String.Empty); string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty); string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty); string friendsService = m_LoginServerConfig.GetString("FriendsService", String.Empty); string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty); string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty); m_DefaultRegionName = m_LoginServerConfig.GetString("DefaultRegion", String.Empty); m_WelcomeMessage = m_LoginServerConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true); m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); // These are required; the others aren't if (accountService == string.Empty || authService == string.Empty) throw new Exception("LoginService is missing service specifications"); Object[] args = new Object[] { config }; m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args); m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args); if (gridService != string.Empty) m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); if (presenceService != string.Empty) m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); if (avatarService != string.Empty) m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args); if (friendsService != string.Empty) m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args); if (simulationService != string.Empty) m_RemoteSimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); if (agentService != string.Empty) m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(agentService, args); // // deal with the services given as argument // m_LocalSimulationService = simService; if (libraryService != null) { m_log.DebugFormat("[LLOGIN SERVICE]: Using LibraryService given as argument"); m_LibraryService = libraryService; } else if (libService != string.Empty) { m_log.DebugFormat("[LLOGIN SERVICE]: Using instantiated LibraryService"); m_LibraryService = ServerUtils.LoadPlugin<ILibraryService>(libService, args); } m_GatekeeperConnector = new GatekeeperServiceConnector(); if (!Initialized) { Initialized = true; RegisterCommands(); } //Start the grid profile archiver. new GridAvatarProfileArchiver(m_UserAccountService); archiver = new GridAvatarArchiver(m_UserAccountService, m_AvatarService, m_InventoryService); LoginModules = Aurora.Framework.AuroraModuleLoader.PickupModules<ILoginModule>(); foreach (ILoginModule module in LoginModules) { module.Initialize(this, config, m_UserAccountService); } m_log.DebugFormat("[LLOGIN SERVICE]: Starting..."); }
public void PostStart(IConfigSource config, IRegistryCore registry) { m_GridService = registry.RequestModuleInterface<IGridService>(); m_GridUserService = registry.RequestModuleInterface<IGridUserService>(); m_GatekeeperConnector = new GatekeeperServiceConnector(); m_GatekeeperService = registry.RequestModuleInterface<IGatekeeperService>(); }
public SimianActivityDetector(IGridUserService guService) { m_GridUserService = guService; //m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Started"); }
public UserAgentService(IConfigSource config, IFriendsSimConnector friendsConnector) { // Let's set this always, because we don't know the sequence // of instantiations if (friendsConnector != null) { m_FriendsLocalSimConnector = friendsConnector; } if (!m_Initialized) { m_Initialized = true; m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); m_FriendsSimConnector = new FriendsSimConnector(); IConfig serverConfig = config.Configs["UserAgentService"]; if (serverConfig == null) { throw new Exception(String.Format("No section UserAgentService in config file")); } string gridService = serverConfig.GetString("GridService", String.Empty); string gridUserService = serverConfig.GetString("GridUserService", String.Empty); string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty); string friendsService = serverConfig.GetString("FriendsService", String.Empty); string presenceService = serverConfig.GetString("PresenceService", String.Empty); string userAccountService = serverConfig.GetString("UserAccountService", String.Empty); m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false); if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty) { throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); } Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin <IGridService>(gridService, args); m_GridUserService = ServerUtils.LoadPlugin <IGridUserService>(gridUserService, args); m_GatekeeperConnector = new GatekeeperServiceConnector(); m_GatekeeperService = ServerUtils.LoadPlugin <IGatekeeperService>(gatekeeperService, args); m_FriendsService = ServerUtils.LoadPlugin <IFriendsService>(friendsService, args); m_PresenceService = ServerUtils.LoadPlugin <IPresenceService>(presenceService, args); m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(userAccountService, args); m_LevelOutsideContacts = serverConfig.GetInt("LevelOutsideContacts", 0); LoadTripPermissionsFromConfig(serverConfig, "ForeignTripsAllowed"); LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_TripsAllowedExceptions); LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_TripsDisallowedExceptions); m_GridName = serverConfig.GetString("ExternalName", string.Empty); if (m_GridName == string.Empty) { serverConfig = config.Configs["GatekeeperService"]; m_GridName = serverConfig.GetString("ExternalName", string.Empty); } if (!m_GridName.EndsWith("/")) { m_GridName = m_GridName + "/"; } } }
public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService) { m_LoginServerConfig = config.Configs["LoginService"]; if (m_LoginServerConfig == null) throw new Exception(String.Format("No section LoginService in config file")); string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty); string gridUserService = m_LoginServerConfig.GetString("GridUserService", String.Empty); string agentService = m_LoginServerConfig.GetString("UserAgentService", String.Empty); string authService = m_LoginServerConfig.GetString("AuthenticationService", String.Empty); string invService = m_LoginServerConfig.GetString("InventoryService", String.Empty); string gridService = m_LoginServerConfig.GetString("GridService", String.Empty); string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty); string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty); string friendsService = m_LoginServerConfig.GetString("FriendsService", String.Empty); string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty); string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty); m_DefaultRegionName = m_LoginServerConfig.GetString("DefaultRegion", String.Empty); m_WelcomeMessage = m_LoginServerConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true); m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty); m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty); // These are required; the others aren't if (accountService == string.Empty || authService == string.Empty) throw new Exception("LoginService is missing service specifications"); Object[] args = new Object[] { config }; m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args); m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args); if (gridService != string.Empty) m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); if (presenceService != string.Empty) m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); if (avatarService != string.Empty) m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args); if (friendsService != string.Empty) m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args); if (simulationService != string.Empty) m_RemoteSimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); if (agentService != string.Empty) m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(agentService, args); // // deal with the services given as argument // m_LocalSimulationService = simService; if (libraryService != null) { m_log.DebugFormat("[LLOGIN SERVICE]: Using LibraryService given as argument"); m_LibraryService = libraryService; } else if (libService != string.Empty) { m_log.DebugFormat("[LLOGIN SERVICE]: Using instantiated LibraryService"); m_LibraryService = ServerUtils.LoadPlugin<ILibraryService>(libService, args); } m_GatekeeperConnector = new GatekeeperServiceConnector(); if (!Initialized) { Initialized = true; RegisterCommands(); } m_log.DebugFormat("[LLOGIN SERVICE]: Starting..."); }
public CAPSPublicHandler(IHttpServer server, string pass, IInventoryService inventory, ILibraryService library, IGridUserService guService, IPresenceService presenceService, string hostName) : base("POST", "/CAPS/REGISTER") { m_server = server; CAPSPass = pass; m_inventory = inventory; m_library = library; m_GridUserService = guService; m_PresenceService = presenceService; m_hostName = hostName; }
public GatekeeperService(IConfigSource config, ISimulationService simService) { if (!m_Initialized) { m_Initialized = true; IConfig serverConfig = config.Configs["GatekeeperService"]; if (serverConfig == null) throw new Exception(String.Format("No section GatekeeperService in config file")); string accountService = serverConfig.GetString("UserAccountService", String.Empty); string homeUsersService = serverConfig.GetString("UserAgentService", string.Empty); string gridService = serverConfig.GetString("GridService", String.Empty); string presenceService = serverConfig.GetString("PresenceService", String.Empty); string simulationService = serverConfig.GetString("SimulationService", String.Empty); string gridUserService = serverConfig.GetString("GridUserService", String.Empty); string bansService = serverConfig.GetString("BansService", String.Empty); // These are mandatory, the others aren't if (gridService == string.Empty || presenceService == string.Empty) throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); UUID.TryParse(scope, out m_ScopeID); //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); m_ExternalName = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", new string[] { "Startup", "Hypergrid", "GatekeeperService" }, String.Empty); m_ExternalName = serverConfig.GetString("ExternalName", m_ExternalName); if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/")) m_ExternalName = m_ExternalName + "/"; try { m_Uri = new Uri(m_ExternalName); } catch { m_log.WarnFormat("[GATEKEEPER SERVICE]: Malformed gatekeeper address {0}", m_ExternalName); } Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); if (accountService != string.Empty) m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); if (homeUsersService != string.Empty) m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args); if (gridUserService != string.Empty) m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); if (bansService != string.Empty) m_BansService = ServerUtils.LoadPlugin<IBansService>(bansService, args); if (simService != null) m_SimulationService = simService; else if (simulationService != string.Empty) m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); m_AllowedClients = serverConfig.GetString("AllowedClients", string.Empty); m_DeniedClients = serverConfig.GetString("DeniedClients", string.Empty); m_ForeignAgentsAllowed = serverConfig.GetBoolean("ForeignAgentsAllowed", true); LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_ForeignsAllowedExceptions); LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_ForeignsDisallowedExceptions); if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); } }
public SimianActivityDetector(IGridUserService guService) { m_GridUserService = guService; m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Started"); }
public GridUserServerPostHandler(IGridUserService service) : base("POST", "/griduser") { m_GridUserService = service; }
public UserAgentService(IConfigSource config) { if (!m_Initialized) { m_Initialized = true; m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); IConfig serverConfig = config.Configs["UserAgentService"]; if (serverConfig == null) throw new Exception(String.Format("No section UserAgentService in config file")); string gridService = serverConfig.GetString("GridService", String.Empty); string gridUserService = serverConfig.GetString("GridUserService", String.Empty); string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty); m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false); if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty) throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); m_GatekeeperConnector = new GatekeeperServiceConnector(); m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args); m_GridName = serverConfig.GetString("ExternalName", string.Empty); if (m_GridName == string.Empty) { serverConfig = config.Configs["GatekeeperService"]; m_GridName = serverConfig.GetString("ExternalName", string.Empty); } if (!m_GridName.EndsWith("/")) m_GridName = m_GridName + "/"; } }
public UserAgentService(IConfigSource config, IFriendsSimConnector friendsConnector) : base(config) { // Let's set this always, because we don't know the sequence // of instantiations if (friendsConnector != null) { m_FriendsLocalSimConnector = friendsConnector; } if (!m_Initialized) { m_Initialized = true; m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); m_FriendsSimConnector = new FriendsSimConnector(); IConfig serverConfig = config.Configs["UserAgentService"]; if (serverConfig == null) { throw new Exception(String.Format("No section UserAgentService in config file")); } string gridService = serverConfig.GetString("GridService", String.Empty); string gridUserService = serverConfig.GetString("GridUserService", String.Empty); string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty); string friendsService = serverConfig.GetString("FriendsService", String.Empty); string presenceService = serverConfig.GetString("PresenceService", String.Empty); string userAccountService = serverConfig.GetString("UserAccountService", String.Empty); m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false); if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty) { throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); } Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin <IGridService>(gridService, args); m_GridUserService = ServerUtils.LoadPlugin <IGridUserService>(gridUserService, args); m_GatekeeperConnector = new GatekeeperServiceConnector(); m_GatekeeperService = ServerUtils.LoadPlugin <IGatekeeperService>(gatekeeperService, args); m_FriendsService = ServerUtils.LoadPlugin <IFriendsService>(friendsService, args); m_PresenceService = ServerUtils.LoadPlugin <IPresenceService>(presenceService, args); m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(userAccountService, args); m_LevelOutsideContacts = serverConfig.GetInt("LevelOutsideContacts", 0); m_ShowDetails = serverConfig.GetBoolean("ShowUserDetailsInHGProfile", true); LoadTripPermissionsFromConfig(serverConfig, "ForeignTripsAllowed"); LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_TripsAllowedExceptions); LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_TripsDisallowedExceptions); m_GridName = Util.GetConfigVarFromSections <string>(config, "GatekeeperURI", new string[] { "Startup", "Hypergrid", "UserAgentService" }, String.Empty); if (string.IsNullOrEmpty(m_GridName)) // Legacy. Remove soon. { m_GridName = serverConfig.GetString("ExternalName", string.Empty); if (m_GridName == string.Empty) { serverConfig = config.Configs["GatekeeperService"]; m_GridName = serverConfig.GetString("ExternalName", string.Empty); } } if (!string.IsNullOrEmpty(m_GridName)) { m_GridName = m_GridName.ToLowerInvariant(); if (!m_GridName.EndsWith("/")) { m_GridName = m_GridName + "/"; } Uri gateURI; if (!Uri.TryCreate(m_GridName, UriKind.Absolute, out gateURI)) { throw new Exception(String.Format("[UserAgentService] could not parse gatekeeper uri")); } string host = gateURI.DnsSafeHost; IPAddress ip = Util.GetHostFromDNS(host); if (ip == null) { throw new Exception(String.Format("[UserAgentService] failed to resolve gatekeeper host")); } m_MyExternalIP = ip.ToString(); } // Finally some cleanup m_Database.DeleteOld(); } }
public GatekeeperService(IConfigSource config, ISimulationService simService) { if (!m_Initialized) { m_Initialized = true; IConfig serverConfig = config.Configs["GatekeeperService"]; if (serverConfig == null) { throw new Exception(String.Format("No section GatekeeperService in config file")); } string accountService = serverConfig.GetString("UserAccountService", string.Empty); string homeUsersService = serverConfig.GetString("UserAgentService", string.Empty); string gridService = serverConfig.GetString("GridService", string.Empty); string presenceService = serverConfig.GetString("PresenceService", string.Empty); string simulationService = serverConfig.GetString("SimulationService", string.Empty); string gridUserService = serverConfig.GetString("GridUserService", string.Empty); string bansService = serverConfig.GetString("BansService", string.Empty); // These are mandatory, the others aren't if (gridService == string.Empty || presenceService == string.Empty) { throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); } string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); UUID.TryParse(scope, out m_ScopeID); //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); string[] sections = new string[] { "Const, Startup", "Hypergrid", "GatekeeperService" }; string externalName = Util.GetConfigVarFromSections <string>(config, "GatekeeperURI", sections, string.Empty); if (string.IsNullOrEmpty(externalName)) { externalName = serverConfig.GetString("ExternalName", string.Empty); } m_gatekeeperHost = new OSHHTPHost(externalName, true); if (!m_gatekeeperHost.IsResolvedHost) { m_log.Error((m_gatekeeperHost.IsValidHost ? "Could not resolve GatekeeperURI" : "GatekeeperURI is a invalid host ") + externalName ?? ""); throw new Exception("GatekeeperURI is invalid"); } m_gatekeeperURL = m_gatekeeperHost.URIwEndSlash; string gatekeeperURIAlias = Util.GetConfigVarFromSections <string>(config, "GatekeeperURIAlias", sections, string.Empty); if (!string.IsNullOrWhiteSpace(gatekeeperURIAlias)) { string[] alias = gatekeeperURIAlias.Split(','); for (int i = 0; i < alias.Length; ++i) { OSHHTPHost tmp = new OSHHTPHost(alias[i].Trim(), false); if (tmp.IsValidHost) { if (m_gateKeeperAlias == null) { m_gateKeeperAlias = new HashSet <OSHHTPHost>(); } m_gateKeeperAlias.Add(tmp); } } } object[] args = new object[] { config }; m_GridService = ServerUtils.LoadPlugin <IGridService>(gridService, args); m_PresenceService = ServerUtils.LoadPlugin <IPresenceService>(presenceService, args); if (accountService != string.Empty) { m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(accountService, args); } if (homeUsersService != string.Empty) { m_UserAgentService = ServerUtils.LoadPlugin <IUserAgentService>(homeUsersService, args); } if (gridUserService != string.Empty) { m_GridUserService = ServerUtils.LoadPlugin <IGridUserService>(gridUserService, args); } if (bansService != string.Empty) { m_BansService = ServerUtils.LoadPlugin <IBansService>(bansService, args); } if (simService != null) { m_SimulationService = simService; } else if (simulationService != string.Empty) { m_SimulationService = ServerUtils.LoadPlugin <ISimulationService>(simulationService, args); } string[] possibleAccessControlConfigSections = new string[] { "AccessControl", "GatekeeperService" }; m_AllowedClients = Util.GetConfigVarFromSections <string>( config, "AllowedClients", possibleAccessControlConfigSections, string.Empty); m_DeniedClients = Util.GetConfigVarFromSections <string>( config, "DeniedClients", possibleAccessControlConfigSections, string.Empty); m_DeniedMacs = Util.GetConfigVarFromSections <string>( config, "DeniedMacs", possibleAccessControlConfigSections, string.Empty); m_ForeignAgentsAllowed = serverConfig.GetBoolean("ForeignAgentsAllowed", true); LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_ForeignsAllowedExceptions); LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_ForeignsDisallowedExceptions); if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) { throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); } IConfig presenceConfig = config.Configs["PresenceService"]; if (presenceConfig != null) { m_allowDuplicatePresences = presenceConfig.GetBoolean("AllowDuplicatePresences", m_allowDuplicatePresences); } IConfig messagingConfig = config.Configs["Messaging"]; if (messagingConfig != null) { m_messageKey = messagingConfig.GetString("MessageKey", String.Empty); } m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); } }
public ActivityDetector(IGridUserService guservice) { m_GridUserService = guservice; m_log.DebugFormat("[ACTIVITY DETECTOR]: starting "); }
public GridUserServerPostHandler(IGridUserService service, IServiceAuth auth) : base("POST", "/griduser", auth) { m_GridUserService = service; }
// IConfig m_ClientsConfig; public LLLoginService(IConfigSource config, ISimulationService simService, ILibraryService libraryService) { m_LoginServerConfig = config.Configs["LoginService"]; if (m_LoginServerConfig == null) throw new Exception(String.Format("No section LoginService in config file")); string accountService = m_LoginServerConfig.GetString("UserAccountService", String.Empty); string gridUserService = m_LoginServerConfig.GetString("GridUserService", String.Empty); string agentService = m_LoginServerConfig.GetString("UserAgentService", String.Empty); string authService = m_LoginServerConfig.GetString("AuthenticationService", String.Empty); string invService = m_LoginServerConfig.GetString("InventoryService", String.Empty); string gridService = m_LoginServerConfig.GetString("GridService", String.Empty); string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty); string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty); string friendsService = m_LoginServerConfig.GetString("FriendsService", String.Empty); string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty); string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty); m_DefaultRegionName = m_LoginServerConfig.GetString("DefaultRegion", String.Empty); m_WelcomeMessage = m_LoginServerConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true); m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false); m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_GatekeeperURL = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", new string[] { "Startup", "Hypergrid", "LoginService" }, String.Empty); m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); m_ProfileURL = m_LoginServerConfig.GetString("ProfileServerURL", string.Empty); m_OpenIDURL = m_LoginServerConfig.GetString("OpenIDServerURL", String.Empty); m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty); m_ClassifiedFee = m_LoginServerConfig.GetString("ClassifiedFee", string.Empty); m_DestinationGuide = m_LoginServerConfig.GetString ("DestinationGuide", string.Empty); m_AvatarPicker = m_LoginServerConfig.GetString ("AvatarPicker", string.Empty); m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty); m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty); m_DSTZone = m_LoginServerConfig.GetString("DSTZone", "America/Los_Angeles;Pacific Standard Time"); // Clean up some of these vars if (m_MapTileURL != String.Empty) { m_MapTileURL = m_MapTileURL.Trim(); if (!m_MapTileURL.EndsWith("/")) m_MapTileURL = m_MapTileURL + "/"; } // These are required; the others aren't if (accountService == string.Empty || authService == string.Empty) throw new Exception("LoginService is missing service specifications"); // replace newlines in welcome message m_WelcomeMessage = m_WelcomeMessage.Replace("\\n", "\n"); Object[] args = new Object[] { config }; m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args); m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args); if (gridService != string.Empty) m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); if (presenceService != string.Empty) m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); if (avatarService != string.Empty) m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args); if (friendsService != string.Empty) m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args); if (simulationService != string.Empty) m_RemoteSimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); if (agentService != string.Empty) m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(agentService, args); // Get the Hypergrid inventory service (exists only if Hypergrid is enabled) string hgInvServicePlugin = m_LoginServerConfig.GetString("HGInventoryServicePlugin", String.Empty); if (hgInvServicePlugin != string.Empty) { string hgInvServiceArg = m_LoginServerConfig.GetString("HGInventoryServiceConstructorArg", String.Empty); Object[] args2 = new Object[] { config, hgInvServiceArg }; m_HGInventoryService = ServerUtils.LoadPlugin<IInventoryService>(hgInvServicePlugin, args2); } // // deal with the services given as argument // m_LocalSimulationService = simService; if (libraryService != null) { m_log.DebugFormat("[LLOGIN SERVICE]: Using LibraryService given as argument"); m_LibraryService = libraryService; } else if (libService != string.Empty) { m_log.DebugFormat("[LLOGIN SERVICE]: Using instantiated LibraryService"); m_LibraryService = ServerUtils.LoadPlugin<ILibraryService>(libService, args); } m_GatekeeperConnector = new GatekeeperServiceConnector(); if (!Initialized) { Initialized = true; RegisterCommands(); } m_log.DebugFormat("[LLOGIN SERVICE]: Starting..."); }
public UserAccountService(IConfigSource config) : base(config) { IConfig userConfig = config.Configs["UserAccountService"]; if (userConfig == null) { throw new Exception("No UserAccountService configuration"); } string gridServiceDll = userConfig.GetString("GridService", string.Empty); if (gridServiceDll != string.Empty) { m_GridService = LoadPlugin <IGridService>(gridServiceDll, new Object[] { config }); } string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty); if (authServiceDll != string.Empty) { m_AuthenticationService = LoadPlugin <IAuthenticationService>(authServiceDll, new Object[] { config }); } string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty); if (presenceServiceDll != string.Empty) { m_GridUserService = LoadPlugin <IGridUserService>(presenceServiceDll, new Object[] { config }); } string invServiceDll = userConfig.GetString("InventoryService", string.Empty); if (invServiceDll != string.Empty) { m_InventoryService = LoadPlugin <IInventoryService>(invServiceDll, new Object[] { config }); } string avatarServiceDll = userConfig.GetString("AvatarService", string.Empty); if (avatarServiceDll != string.Empty) { m_AvatarService = LoadPlugin <IAvatarService>(avatarServiceDll, new Object[] { config }); } m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false); // create a system grid god account UserAccount ggod = GetUserAccount(UUID.Zero, UUID_GRID_GOD); if (ggod == null) { UserAccountData d = new UserAccountData(); d.FirstName = "GRID"; d.LastName = "SERVICES"; d.PrincipalID = UUID_GRID_GOD; d.ScopeID = UUID.Zero; d.Data = new Dictionary <string, string>(); d.Data["Email"] = string.Empty; d.Data["Created"] = Util.UnixTimeSinceEpoch().ToString(); d.Data["UserLevel"] = "240"; d.Data["UserFlags"] = "0"; d.Data["ServiceURLs"] = string.Empty; m_Database.Store(d); } if (m_RootInstance == null) { m_RootInstance = this; // In case there are several instances of this class in the same process, // the console commands are only registered for the root instance if (MainConsole.Instance != null) { MainConsole.Instance.Commands.AddCommand("Users", false, "create user", "create user [<first> [<last> [<pass> [<email> [<user id> [<model>]]]]]]", "Create a new user", HandleCreateUser); MainConsole.Instance.Commands.AddCommand("Users", false, "reset user password", "reset user password [<first> [<last> [<password>]]]", "Reset a user password", HandleResetUserPassword); MainConsole.Instance.Commands.AddCommand("Users", false, "reset user email", "reset user email [<first> [<last> [<email>]]]", "Reset a user email address", HandleResetUserEmail); MainConsole.Instance.Commands.AddCommand("Users", false, "set user level", "set user level [<first> [<last> [<level>]]]", "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, " + "this account will be treated as god-moded. " + "It will also affect the 'login level' command. ", HandleSetUserLevel); MainConsole.Instance.Commands.AddCommand("Users", false, "show account", "show account <first> <last>", "Show account details for the given user", HandleShowAccount); } } }