Exemplo n.º 1
0
 public void Start(IConfigSource config, IRegistryCore registry)
 {
     m_Database = Framework.Utilities.DataManager.RequestPlugin<IAvatarData>();
     m_ArchiveService = registry.RequestModuleInterface<IAvatarAppearanceArchiver>();
     registry.RequestModuleInterface<ISimulationBase>()
             .EventManager.RegisterEventHandler("DeleteUserInformation", DeleteUserInformation);
 }
Exemplo n.º 2
0
 public void Start(IConfigSource config, IRegistryCore registry)
 {
     m_Database       = Framework.Utilities.DataManager.RequestPlugin <IAvatarData> ();
     m_ArchiveService = registry.RequestModuleInterface <IAvatarAppearanceArchiver> ();
     registry.RequestModuleInterface <ISimulationBase> ()
     .EventManager.RegisterEventHandler("DeleteUserInformation", DeleteUserInformation);
 }
        public AvatarServiceBase(IConfigSource config)
            : base(config)
        {
            string dllName    = String.Empty;
            string connString = String.Empty;
            string realm      = "Avatars";

            //
            // Try reading the [DatabaseService] section, if it exists
            //
            IConfig dbConfig = config.Configs["DatabaseService"];

            if (dbConfig != null)
            {
                if (dllName == String.Empty)
                {
                    dllName = dbConfig.GetString("StorageProvider", String.Empty);
                }
                if (connString == String.Empty)
                {
                    connString = dbConfig.GetString("ConnectionString", String.Empty);
                }
            }

            //
            // [AvatarService] section overrides [DatabaseService], if it exists
            //
            IConfig presenceConfig = config.Configs["AvatarService"];

            if (presenceConfig != null)
            {
                dllName    = presenceConfig.GetString("StorageProvider", dllName);
                connString = presenceConfig.GetString("ConnectionString", connString);
                realm      = presenceConfig.GetString("Realm", realm);
            }

            //
            // We tried, but this doesn't exist. We can't proceed.
            //
            if (dllName.Equals(String.Empty))
            {
                throw new Exception("No StorageProvider configured");
            }

            m_Database = LoadPlugin <IAvatarData>(dllName, new Object[] { connString, realm });
            if (m_Database == null)
            {
                throw new Exception("Could not find a storage interface in the given module " + dllName);
            }
        }
Exemplo n.º 4
0
        public AvatarServiceBase(IConfigSource config)
            : base(config)
        {
            string dllName = String.Empty;
            string connString = String.Empty;
            string realm = "Avatars";

            //
            // Try reading the [DatabaseService] section, if it exists
            //
            IConfig dbConfig = config.Configs["DatabaseService"];
            if (dbConfig != null)
            {
                if (dllName == String.Empty)
                    dllName = dbConfig.GetString("StorageProvider", String.Empty);
                if (connString == String.Empty)
                    connString = dbConfig.GetString("ConnectionString", String.Empty);
            }

            //
            // [AvatarService] section overrides [DatabaseService], if it exists
            //
            IConfig presenceConfig = config.Configs["AvatarService"];
            if (presenceConfig != null)
            {
                dllName = presenceConfig.GetString("StorageProvider", dllName);
                connString = presenceConfig.GetString("ConnectionString", connString);
                realm = presenceConfig.GetString("Realm", realm);
            }
            
            //
            // We tried, but this doesn't exist. We can't proceed.
            //
            if (dllName.Equals(String.Empty))
                throw new Exception("No StorageProvider configured");

            m_Database = LoadPlugin<IAvatarData>(dllName, new Object[] { connString, realm });
            if (m_Database == null)
                throw new Exception("Could not find a storage interface in the given module " + dllName);

        }
Exemplo n.º 5
0
 public void Start(IConfigSource config, IRegistryCore registry)
 {
     m_Database = DataManager.RequestPlugin<IAvatarData>();
 }
Exemplo n.º 6
0
        public void Initialize(IConfigSource config, IRegistryCore registry)
        {
            m_registry = registry;

            string dllName = String.Empty;
            string connString = String.Empty;
            ///This was decamel-cased, and it will break MONO appearently as MySQL on MONO cares about case.
            string realm = "Avatars";
            string cacherealm = "AvatarsCache";

            //
            // Try reading the [DatabaseService] section, if it exists
            //
            IConfig dbConfig = config.Configs["DatabaseService"];
            if (dbConfig != null)
            {
                if (dllName == String.Empty)
                    dllName = dbConfig.GetString("StorageProvider", String.Empty);
                if (connString == String.Empty)
                    connString = dbConfig.GetString("ConnectionString", String.Empty);
            }

            //
            // [AvatarService] section overrides [DatabaseService], if it exists
            //
            IConfig presenceConfig = config.Configs["AvatarService"];
            if (presenceConfig != null)
            {
                dllName = presenceConfig.GetString("StorageProvider", dllName);
                connString = presenceConfig.GetString("ConnectionString", connString);
                realm = presenceConfig.GetString("Realm", realm);
                cacherealm = presenceConfig.GetString("CacheRealm", cacherealm);
                m_enableCacheBakedTextures = presenceConfig.GetBoolean("EnableBakedTextureCaching", m_enableCacheBakedTextures);
            }

            //
            // We tried, but this doesn't exist. We can't proceed.
            //
            if (dllName.Equals(String.Empty))
                throw new Exception("No StorageProvider configured");

            m_Database = AuroraModuleLoader.LoadPlugin<IAvatarData>(dllName, new Object[] { connString, realm });
            m_CacheDatabase = AuroraModuleLoader.LoadPlugin<IAvatarData>(dllName, new Object[] { connString, cacherealm });
            if (m_Database == null)
                throw new Exception("Could not find a storage interface in the given module " + dllName);
            registry.RegisterModuleInterface<IAvatarService>(this);
            m_log.Debug("[AVATAR SERVICE]: Starting avatar service");
        }
Exemplo n.º 7
0
 public void Start(IConfigSource config, IRegistryCore registry)
 {
     m_Database = DataManager.RequestPlugin <IAvatarData>();
     registry.RequestModuleInterface <ISimulationBase>().EventManager.RegisterEventHandler("DeleteUserInformation", DeleteUserInformation);
 }
Exemplo n.º 8
0
        // public static string[] AvatarCodes;

        #endregion

        #region MonoBehavior
        public static void Setup()
        {
            IAgentDataProvider agentDatabase;

            if (LSDatabaseManager.TryGetDatabase <IAgentDataProvider>(out agentDatabase))
            {
                AgentData  = agentDatabase.AgentData;
                AgentCodes = new string[AgentData.Length];

                AgentController.CachedAgents = new Dictionary <string, FastStack <LSAgent> >(AgentData.Length);

                OrganizerObject = LSUtility.CreateEmpty().transform;
                OrganizerObject.gameObject.name = "OrganizerObject";
                OrganizerObject.gameObject.SetActive(false);

                GameObject.DontDestroyOnLoad(OrganizerObject);
                for (int i = 0; i < AgentData.Length; i++)
                {
                    IAgentData interfacer = AgentData[i];
                    string     agentCode  = interfacer.Name;
                    AgentCodes[i] = agentCode;

                    AgentController.CachedAgents.Add(agentCode, new FastStack <LSAgent>(2));
                    AgentCodeInterfacerMap.Add(agentCode, interfacer);
                    AgentCodeIndexMap.Add(agentCode, (ushort)i);
                }
            }
            else
            {
                Debug.Log("Database does not provide AgentData. Make sure it implements IAgentDataProvider.");
            }

            IWorldObjectDataProvider worldObjectDatabase;

            if (LSDatabaseManager.TryGetDatabase <IWorldObjectDataProvider>(out worldObjectDatabase))
            {
                WorldObjectData  = worldObjectDatabase.WorldObjectData;
                WorldObjectCodes = new string[AgentData.Length];

                for (int i = 0; i < WorldObjectData.Length; i++)
                {
                    IWorldObjectData interfacer      = WorldObjectData[i];
                    string           worldObjectCode = interfacer.Name;
                    WorldObjectCodes[i] = worldObjectCode;

                    WorldObjectCodeInterfacerMap.Add(worldObjectCode, interfacer);
                }
            }
            else
            {
                Debug.Log("Database does not provide WorldObjectData. Make sure it implements IWorldObjectDataProvider.");
            }

            IAvatarDataProvider avatarDatabase;

            if (LSDatabaseManager.TryGetDatabase <IAvatarDataProvider>(out avatarDatabase))
            {
                AvatarData = avatarDatabase.AvatarData;
                Avatars    = new Texture2D[AvatarData.Length];

                for (int i = 0; i < AvatarData.Length; i++)
                {
                    IAvatarData interfacer = AvatarData[i];
                    Texture2D   avatar     = interfacer.GetAvatar();
                    //  AvatarCodes[i] = avatarCode;
                    Avatars[i] = avatar;
                    // AvatarCodeInterfacerMap.Add(avatarCode, interfacer);
                }
            }
            else
            {
                Debug.Log("Database does not provide WorldObjectData. Make sure it implements IWorldObjectDataProvider.");
            }
        }
Exemplo n.º 9
0
 public void Start(IConfigSource config, IRegistryCore registry)
 {
     m_Database = Aurora.DataManager.DataManager.RequestPlugin <IAvatarData> ();
 }
Exemplo n.º 10
0
 public void Start(IConfigSource config, IRegistryCore registry)
 {
     m_Database = DataManager.RequestPlugin<IAvatarData>();
     registry.RequestModuleInterface<ISimulationBase>().EventManager.RegisterEventHandler("DeleteUserInformation", DeleteUserInformation);
 }