public void Startup(ConfigurationLoader loader) { m_IMRouter = loader.IMRouter; m_AvatarNameService = loader.GetService <AvatarNameServiceInterface>(m_AvatarNameServiceName); m_OfflineIMService = loader.GetService <OfflineIMServiceInterface>(m_OfflineIMServiceName); m_IMRouter.OfflineIM.Add(Send); }
public void Startup(ConfigurationLoader loader) { IConfig config = loader.Config.Configs[GetType().FullName]; m_GroupsServiceName = config.GetString("GroupsService"); m_BackendGroupsServiceName = config.GetString("BackendGroupsService", m_GroupsServiceName); m_AvatarNameServiceName = config.GetString("AvatarNameService"); m_GroupsService = loader.GetService <GroupsServiceInterface>(m_GroupsServiceName); m_BackendGroupsService = loader.GetService <GroupsServiceInterface>(m_BackendGroupsServiceName); m_AvatarNameService = loader.GetService <AvatarNameServiceInterface>(m_AvatarNameServiceName); }
public void Startup(ConfigurationLoader loader) { m_IMRouter = loader.IMRouter; RwLockedList <AvatarNameServiceInterface> services = new RwLockedList <AvatarNameServiceInterface>(); foreach (string name in m_AvatarNameServiceNames) { AvatarNameServiceInterface service; loader.GetService(name, out service); services.Add(service); } m_AvatarNameService = new AggregatingAvatarNameService(services); loader.GetService(m_GroupsServiceName, out m_GroupsService); }
public void Startup(ConfigurationLoader loader) { m_Scenes = loader.Scenes; m_Loader = loader; m_GatekeeperURI = loader.GatekeeperURI; IConfig config = loader.Config.Configs[GetType().FullName]; /* we use same asset id keying here so to make them compatible with the other scripts */ foreach (string key in config.GetKeys()) { if (UUID.TryParse(key, out m_AssetID)) { m_ScriptFile = config.GetString(key); break; } } m_ObjectPermissionsBase = GetPermissions(config, "ObjectPermisionsBase"); m_ObjectPermissionsOwner = GetPermissions(config, "ObjectPermisionsOwner"); m_ObjectPermissionsGroup = GetPermissions(config, "ObjectPermisionsGroup"); m_ObjectPermissionsNext = GetPermissions(config, "ObjectPermisionsNext"); m_ObjectPermissionsEveryone = GetPermissions(config, "ObjectPermisionsEveryone"); m_ScriptPermissionsBase = GetPermissions(config, "ScriptPermisionsBase"); m_ScriptPermissionsOwner = GetPermissions(config, "ScriptPermisionsOwner"); m_ScriptPermissionsGroup = GetPermissions(config, "ScriptPermisionsGroup"); m_ScriptPermissionsNext = GetPermissions(config, "ScriptPermisionsNext"); m_ScriptPermissionsEveryone = GetPermissions(config, "ScriptPermisionsEveryone"); m_LoadOarFileName = config.GetString("OarFilename", string.Empty); m_TimeoutMs = config.GetInt("RunTimeout", 1000); m_RegionID = UUID.Parse(config.GetString("RegionID")); m_RegionOwner = new UGUIWithName(config.GetString("RegionOwner")) { IsAuthoritative = true }; m_EstateOwner = new UGUIWithName(config.GetString("EstateOwner", m_RegionOwner.ToString())) { IsAuthoritative = true }; m_EstateID = (uint)config.GetInt("EstateID", 100); m_EstateName = config.GetString("EstateName", "My Estate"); m_ObjectID = UUID.Parse(config.GetString("ID", UUID.Random.ToString())); m_RegionName = config.GetString("RegionName", "Testing Region"); m_ProductName = config.GetString("RegionProductName", "Mainland"); m_RegionLocation = new GridVector(config.GetString("RegionLocation", "10000,10000"), 256); m_RegionSize = new GridVector(config.GetString("RegionSize", "1,1"), 256); m_RegionAccess = (RegionAccess)Enum.Parse(typeof(RegionAccess), config.GetString("RegionAccess", "PG")); m_RegionPort = config.GetInt("RegionPort", 9300); m_Runner = loader.GetServicesByValue <TestRunner>()[0]; m_Position = Vector3.Parse(config.GetString("Position", "<128, 128, 23>")); m_Rotation = Quaternion.Parse(config.GetString("Rotation", "<0,0,0,1>")); m_ItemID = UUID.Parse(config.GetString("ScriptItemID", UUID.Random.ToString())); m_RezzingObjID = UUID.Parse(config.GetString("RezzingObjectID", UUID.Zero.ToString())); m_ObjectName = config.GetString("ObjectName", "Object"); m_ScriptName = config.GetString("ScriptName", "Script"); string experienceName = config.GetString("ExperienceName", "My Experience"); UUID experienceID; UUID.TryParse(config.GetString("ExperienceID", UUID.Zero.ToString()), out experienceID); m_ExperienceID = new UEI(experienceID, experienceName, null); m_ObjectDescription = config.GetString("ObjectDescription", ""); m_ScriptDescription = config.GetString("ScriptDescription", ""); m_RegionStorage = loader.GetService <GridServiceInterface>("RegionStorage"); m_SceneFactory = loader.GetService <SceneFactoryInterface>("DefaultSceneImplementation"); m_EstateService = loader.GetService <EstateServiceInterface>("EstateService"); m_AvatarNameService = loader.GetService <AvatarNameServiceInterface>("AvatarNameStorage"); m_UserAccountService = loader.GetService <UserAccountServiceInterface>("UserAccountService"); m_AvatarNameService.Store(m_RegionOwner); m_AvatarNameService.Store(m_EstateOwner); try { m_UserAccountService.Add(new UserAccount { Principal = m_RegionOwner, IsLocalToGrid = true, }); } catch { m_Log.Info("UserAccount creation failed for RegionOwner"); } if (!m_EstateOwner.EqualsGrid(m_RegionOwner)) { try { m_UserAccountService.Add(new UserAccount { Principal = m_RegionOwner, IsLocalToGrid = true, }); } catch { m_Log.Info("UserAccount creation failed for EstateOwner"); } } m_ObjectOwner = new UGUIWithName(config.GetString("ObjectOwner")) { IsAuthoritative = true }; m_AvatarNameService.Store(m_ObjectOwner); if (config.Contains("ObjectCreator")) { m_ObjectCreator = new UGUIWithName(config.GetString("ObjectCreator")) { IsAuthoritative = true }; m_AvatarNameService.Store(m_ObjectCreator); try { m_UserAccountService.Add(new UserAccount { Principal = m_ObjectCreator, IsLocalToGrid = true, }); } catch { /* intentionally ignored */ } } else { m_ObjectCreator = m_ObjectOwner; } if (config.Contains("ObjectLastOwner")) { m_ObjectLastOwner = new UGUIWithName(config.GetString("ObjectLastOwner")) { IsAuthoritative = true }; m_AvatarNameService.Store(m_ObjectLastOwner); try { m_UserAccountService.Add(new UserAccount { Principal = m_ObjectLastOwner, IsLocalToGrid = true, }); } catch { /* intentionally ignored */ } } else { m_ObjectLastOwner = m_ObjectOwner; } m_ScriptOwner = new UGUIWithName(config.GetString("ScriptOwner")) { IsAuthoritative = true }; m_AvatarNameService.Store(m_ScriptOwner); if (config.Contains("ScriptCreator")) { m_ScriptCreator = new UGUIWithName(config.GetString("ScriptCreator")) { IsAuthoritative = true }; m_AvatarNameService.Store(m_ScriptCreator); try { m_UserAccountService.Add(new UserAccount { Principal = m_ScriptCreator, IsLocalToGrid = true, }); } catch { /* intentionally ignored */ } } else { m_ScriptCreator = m_ScriptOwner; } if (config.Contains("ScriptLastOwner")) { m_ScriptLastOwner = new UGUIWithName(config.GetString("ScriptLastOwner")) { IsAuthoritative = true }; m_AvatarNameService.Store(m_ScriptLastOwner); try { m_UserAccountService.Add(new UserAccount { Principal = m_ScriptLastOwner, IsLocalToGrid = true, }); } catch { /* intentionally ignored */ } } else { m_ScriptLastOwner = m_ScriptOwner; } m_StartParameter = config.GetInt("StartParameter", 0); if (string.IsNullOrEmpty(m_ScriptFile)) { throw new ArgumentException("Script filename and UUID missing"); } m_AdditionalObjectConfigs = config.GetString("AdditionalObjects", string.Empty).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (m_AdditionalObjectConfigs.Length == 1 && m_AdditionalObjectConfigs[0] == string.Empty) { m_AdditionalObjectConfigs = new string[0]; } m_AdditionalInventoryConfigs = config.GetString("AdditionalInventories", string.Empty).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (m_AdditionalInventoryConfigs.Length == 1 && m_AdditionalInventoryConfigs[0] == string.Empty) { m_AdditionalInventoryConfigs = new string[0]; } m_AssetSourcesConfig = config.GetString("AssetSources", string.Empty); m_ScriptStatesConfig = config.GetString("ScriptStates", string.Empty); CompilerRegistry.ScriptCompilers.DefaultCompilerName = config.GetString("DefaultCompiler"); }
public void Startup(ConfigurationLoader loader) { IConfig config = loader.Config.Configs[GetType().FullName]; m_AvatarNameService = loader.GetService <AvatarNameServiceInterface>(config.GetString("AvatarNameService")); }
public GridIMRouter(IConfig config) { m_AvatarNameServiceNames = config.GetString("AvatarNameServices", string.Empty); m_AvatarNameService = new AggregatingAvatarNameService(m_AvatarNameServices); }