예제 #1
0
        public EstateDataRobustConnector(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 };
            IEstateDataService e_service = ServerUtils.LoadPlugin <IEstateDataService>(service, args);

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);;

            server.AddStreamHandler(new EstateServerGetHandler(e_service, auth));
            server.AddStreamHandler(new EstateServerPostHandler(e_service, auth));
        }
        public GroupsServiceRobustConnector(IConfigSource config, IHttpServer server, string configName) :
            base(config, server, configName)
        {
            string key = string.Empty;

            if (configName != String.Empty)
            {
                m_ConfigName = configName;
            }

            m_log.DebugFormat("[Groups.RobustConnector]: Starting with config name {0}", m_ConfigName);

            IConfig groupsConfig = config.Configs[m_ConfigName];

            if (groupsConfig != null)
            {
                key = groupsConfig.GetString("SecretKey", string.Empty);
                m_log.DebugFormat("[Groups.RobustConnector]: Starting with secret key {0}", key);
            }
            else
            {
                m_log.WarnFormat("[Groups.RobustConnector]: Unable to find {0} section in configuration", m_ConfigName);
            }

            m_GroupsService = new GroupsService(config);

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);

            server.AddStreamHandler(new GroupsServicePostHandler(m_GroupsService, auth));
        }
예제 #3
0
        public XBakesConnector(IConfigSource config, IHttpServer server, string configName) :
            base(config, server, configName)
        {
            if (configName != String.Empty)
            {
                m_ConfigName = configName;
            }

            IConfig serverConfig = config.Configs[m_ConfigName];

            if (serverConfig == null)
            {
                throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
            }

            string assetService = serverConfig.GetString("LocalServiceModule",
                                                         String.Empty);

            if (assetService == String.Empty)
            {
                throw new Exception("No BakedTextureService in config file");
            }

            Object[] args = new Object[] { config };
            m_BakesService =
                ServerUtils.LoadPlugin <IBakedTextureService>(assetService, args);

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);

            server.AddStreamHandler(new BakesServerGetHandler(m_BakesService, auth));
            server.AddStreamHandler(new BakesServerPostHandler(m_BakesService, auth));
        }
예제 #4
0
        public XInventoryInConnector(IConfigSource config, IHttpServer server, string configName) :
            base(config, server, configName)
        {
            if (configName != String.Empty)
            {
                m_ConfigName = configName;
            }

            m_log.DebugFormat("[XInventoryInConnector]: Starting with config name {0}", m_ConfigName);

            IConfig serverConfig = config.Configs[m_ConfigName];

            if (serverConfig == null)
            {
                throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
            }

            string inventoryService = serverConfig.GetString("LocalServiceModule",
                                                             String.Empty);

            if (inventoryService == String.Empty)
            {
                throw new Exception("No InventoryService in config file");
            }

            Object[] args = new Object[] { config, m_ConfigName };
            m_InventoryService =
                ServerUtils.LoadPlugin <IInventoryService>(inventoryService, args);

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);

            server.AddStreamHandler(new XInventoryConnectorPostHandler(m_InventoryService, auth));
        }
예제 #5
0
        public XBakesConnector(IConfigSource config, IHttpServer server, string configName) :
            base(config, server, configName)
        {
            if (configName != string.Empty)
            {
                m_ConfigName = configName;
            }

            IConfig serverConfig = config.Configs[m_ConfigName];

            if (serverConfig == null)
            {
                throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
            }

            string bakesServiceName = serverConfig.GetString("LocalServiceModule", string.Empty);

            if (string.IsNullOrWhiteSpace(bakesServiceName))
            {
                throw new Exception("No BakedTextureService in config file");
            }

            object[]             args         = new object[] { config };
            IBakedTextureService bakesService = ServerUtils.LoadPlugin <IBakedTextureService>(bakesServiceName, args);

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);

            server.AddSimpleStreamHandler(new BakesServerHandler(bakesService, auth), true);
        }
        // Called from standalone configurations
        public AssetProxyConnector(IConfigSource config, IHttpServer server, string configName, IFriendsSimConnector localConn) : base(config, server, configName)
        {
            try
            {
                if (configName != String.Empty)
                {
                    m_ConfigName = configName;
                }

                IConfig serverConfig = config.Configs[m_ConfigName];
                if (serverConfig == null)
                {
                    throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
                }

                m_AssetService = new AssetServerProxy(config, m_ConfigName);

                IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);

                server.AddStreamHandler(new AssetServerGetHandler(m_AssetService, auth, string.Empty));
                server.AddStreamHandler(new AssetServerPostHandler(m_AssetService, auth));
                server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, AllowedRemoteDeleteTypes.None, auth));
                server.AddStreamHandler(new AssetsExistHandler(m_AssetService));
            }catch (Exception error)
            {
                m_log.Error(error.Message);
                m_log.Error(error.StackTrace);
            }
        }
예제 #7
0
        public void Initialise(IConfigSource configSource)
        {
            IConfig config = configSource.Configs["XBakes"];

            if (config == null)
            {
                return;
            }

            m_URL  = config.GetString("URL", String.Empty);
            m_Auth = ServiceAuth.Create(configSource, "XBakes");
        }
예제 #8
0
        public OfflineIMServiceRobustConnector(IConfigSource config, IHttpServer server, string configName) :
            base(config, server, configName)
        {
            if (configName != String.Empty)
            {
                m_ConfigName = configName;
            }

            m_log.DebugFormat("[OfflineIM.V2.RobustConnector]: Starting with config name {0}", m_ConfigName);

            m_OfflineIMService = new OfflineIMService(config);

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);

            server.AddStreamHandler(new OfflineIMServicePostHandler(m_OfflineIMService, auth));
        }
        public MapAddServiceConnector(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 mapService = serverConfig.GetString("LocalServiceModule",
                                                       String.Empty);

            if (mapService == String.Empty)
            {
                throw new Exception("No LocalServiceModule in config file");
            }

            Object[] args = new Object[] { config };
            m_MapService = ServerUtils.LoadPlugin <IMapImageService>(mapService, args);

            string gridService = serverConfig.GetString("GridService", String.Empty);

            if (gridService != string.Empty)
            {
                m_GridService = ServerUtils.LoadPlugin <IGridService>(gridService, args);
            }

            if (m_GridService != null)
            {
                m_log.InfoFormat("[MAP IMAGE HANDLER]: GridService check is ON");
            }
            else
            {
                m_log.InfoFormat("[MAP IMAGE HANDLER]: GridService check is OFF");
            }

            bool         proxy = serverConfig.GetBoolean("HasProxy", false);
            IServiceAuth auth  = ServiceAuth.Create(config, m_ConfigName);

            server.AddStreamHandler(new MapServerPostHandler(m_MapService, m_GridService, proxy, auth));
        }
        public ExperienceServiceConnector(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("LocalServiceModule not present in ExperienceService config file ExperienceService section");
            }

            Object[] args = new Object[] { config };
            m_ExperienceService = ServerUtils.LoadPlugin <IExperienceService>(service, args);

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);

            server.AddStreamHandler(new ExperienceServerPostHandler(m_ExperienceService, auth));
        }
        // Called from Robust
        public HGGetDisplayNames(IConfigSource config, IHttpServer server, string 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_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(service, args);

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);

            server.AddStreamHandler(new HGGetDisplayNamesPostHandler(m_UserAccountService));
        }
예제 #12
0
        public AgentPreferencesServiceConnector(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 (String.IsNullOrWhiteSpace(service))
            {
                throw new Exception("No LocalServiceModule in config file");
            }

            Object[] args = new Object[] { config };
            m_AgentPreferencesService = ServerUtils.LoadPlugin <IAgentPreferencesService>(service, args);

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);;

            server.AddStreamHandler(new AgentPreferencesServerPostHandler(m_AgentPreferencesService, auth));
        }
예제 #13
0
        public AssetServiceConnector(IConfigSource config, IHttpServer server, string configName) :
            base(config, server, configName)
        {
            if (configName != String.Empty)
            {
                m_ConfigName = configName;
            }

            IConfig serverConfig = config.Configs[m_ConfigName];

            if (serverConfig == null)
            {
                throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
            }

            string assetService = serverConfig.GetString("LocalServiceModule",
                                                         String.Empty);

            if (assetService == String.Empty)
            {
                throw new Exception("No LocalServiceModule in config file");
            }

            Object[] args = new Object[] { config, m_ConfigName };
            m_AssetService =
                ServerUtils.LoadPlugin <IAssetService>(assetService, args);

            if (m_AssetService == null)
            {
                throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
            }

            bool allowDelete         = serverConfig.GetBoolean("AllowRemoteDelete", false);
            bool allowDeleteAllTypes = serverConfig.GetBoolean("AllowRemoteDeleteAllTypes", false);

            string redirectURL = serverConfig.GetString("RedirectURL", string.Empty);

            AllowedRemoteDeleteTypes allowedRemoteDeleteTypes;

            if (!allowDelete)
            {
                allowedRemoteDeleteTypes = AllowedRemoteDeleteTypes.None;
            }
            else
            {
                if (allowDeleteAllTypes)
                {
                    allowedRemoteDeleteTypes = AllowedRemoteDeleteTypes.All;
                }
                else
                {
                    allowedRemoteDeleteTypes = AllowedRemoteDeleteTypes.MapTile;
                }
            }

            IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);

            server.AddStreamHandler(new AssetServerGetHandler(m_AssetService, auth, redirectURL));
            server.AddStreamHandler(new AssetServerPostHandler(m_AssetService, auth));
            server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowedRemoteDeleteTypes, auth));
            server.AddStreamHandler(new AssetsExistHandler(m_AssetService));

            MainConsole.Instance.Commands.AddCommand("Assets", false,
                                                     "show asset",
                                                     "show asset <ID>",
                                                     "Show asset information",
                                                     HandleShowAsset);

            MainConsole.Instance.Commands.AddCommand("Assets", false,
                                                     "delete asset",
                                                     "delete asset <ID>",
                                                     "Delete asset from database",
                                                     HandleDeleteAsset);

            MainConsole.Instance.Commands.AddCommand("Assets", false,
                                                     "dump asset",
                                                     "dump asset <ID>",
                                                     "Dump asset to a file",
                                                     "The filename is the same as the ID given.",
                                                     HandleDumpAsset);
        }