public void Initialize (ILoginService service, IConfigSource config, IRegistryCore registry)
        {
            IConfig loginServerConfig = config.Configs ["LoginService"];
            if (loginServerConfig != null) {
                m_UseTOS = loginServerConfig.GetBoolean ("UseTermsOfServiceOnFirstLogin", false);
                m_TOSLocation = loginServerConfig.GetString ("FileNameOfTOS", "");

                if (m_TOSLocation.Length > 0) {
                    // html appears to be broken
                    if (m_TOSLocation.ToLower ().StartsWith ("http://", StringComparison.Ordinal))
                        m_TOSLocation = m_TOSLocation.Replace ("ServersHostname", MainServer.Instance.HostName);
                    else {
                        var simBase = registry.RequestModuleInterface<ISimulationBase> ();
                        var TOSFileName = PathHelpers.VerifyReadFile (m_TOSLocation, ".txt", simBase.DefaultDataPath);
                        if (TOSFileName == "") {
                            m_UseTOS = false;
                            MainConsole.Instance.ErrorFormat ("Unable to locate the Terms of Service file : '{0}'", m_TOSLocation);
                            MainConsole.Instance.Error (" Show 'Terms of Service' for a new user login is disabled!");
                        } else
                            m_TOSLocation = TOSFileName;
                    }
                } else
                    m_UseTOS = false;

            }
            m_AuthenticationService = registry.RequestModuleInterface<IAuthenticationService> ();
            m_LoginService = service;
        }
 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 void PostStart(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("SimulationInHandler", "") != Name)
                return;

            bool secure = handlerConfig.GetBoolean("SecureSimulation", true);
            IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("SimulationInHandlerPort"));

            m_LocalSimulationService = registry.RequestModuleInterface<ISimulationService>();
            
            string path = "/" + UUID.Random().ToString() + "/agent/";

            IGridRegisterModule registerModule = registry.RequestModuleInterface<IGridRegisterModule>();
            if (registerModule != null && secure)
                registerModule.AddGenericInfo("SimulationAgent", path);
            else
            {
                secure = false;
                path = "/agent/";
            }

            server.AddHTTPHandler(path, new AgentHandler(m_LocalSimulationService.GetInnerService(), secure).Handler);
            server.AddHTTPHandler("/object/", new ObjectHandler(m_LocalSimulationService.GetInnerService()).Handler);
        }
Beispiel #4
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("AssetInHandler", "") != Name)
                return;

            m_registry = registry;
            m_port = handlerConfig.GetUInt("AssetInHandlerPort");

            if (handlerConfig.GetBoolean("UnsecureUrls", false))
            {
                IHttpServer server = m_registry.RequestModuleInterface<ISimulationBase>().GetHttpServer(m_port);
                m_port = server.Port;
                string url = "/assets";

                IAssetService m_AssetService = m_registry.RequestModuleInterface<IAssetService>();
                server.AddStreamHandler(new AssetServerGetHandler(m_AssetService, url, 0, registry));
                server.AddStreamHandler(new AssetServerPostHandler(m_AssetService, url, 0, registry));
                server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, m_allowDelete, url, 0, registry));
            }

            IConfig serverConfig = config.Configs[m_ConfigName];
            m_allowDelete = serverConfig != null ? serverConfig.GetBoolean("AllowRemoteDelete", false) : false;

            m_registry.RequestModuleInterface<IGridRegistrationService>().RegisterModule(this);
        }
 public virtual void Start(IConfigSource config, IRegistryCore registry)
 {
     m_Database = Aurora.DataManager.DataManager.RequestPlugin<IInventoryData> ();
     m_UserAccountService = registry.RequestModuleInterface<IUserAccountService>();
     m_LibraryService = registry.RequestModuleInterface<ILibraryService>();
     m_AssetService = registry.RequestModuleInterface<IAssetService>();
 }
Beispiel #6
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            if (config.Configs["Currency"] == null ||
                config.Configs["Currency"].GetString("Module", "") != "SimpleCurrency")
                return;
            if (!config.Configs["Currency"].GetBoolean("RunServer", false))
                return;

            m_connector = DataManager.RequestPlugin<ISimpleCurrencyConnector>() as SimpleCurrencyConnector;

            if (m_connector.GetConfig().ClientPort == 0 && MainServer.Instance == null)
                return;
            IHttpServer server =
                registry.RequestModuleInterface<ISimulationBase>()
                        .GetHttpServer((uint) m_connector.GetConfig().ClientPort);
            server.AddXmlRPCHandler("getCurrencyQuote", QuoteFunc);
            server.AddXmlRPCHandler("buyCurrency", BuyFunc);
            server.AddXmlRPCHandler("preflightBuyLandPrep", PreflightBuyLandPrepFunc);
            server.AddXmlRPCHandler("buyLandPrep", LandBuyFunc);
            server.AddXmlRPCHandler("getBalance", GetbalanceFunc);
            server.AddXmlRPCHandler("/currency.php", GetbalanceFunc);
            server.AddXmlRPCHandler("/landtool.php", GetbalanceFunc);

            m_syncMessagePoster = registry.RequestModuleInterface<ISyncMessagePosterService>();
            m_agentInfoService = registry.RequestModuleInterface<IAgentInfoService>();
        }
Beispiel #7
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            registry.RequestModuleInterface<ISimulationBase>().EventManager.OnGenericEvent += OnGenericEvent;

            //Also look for incoming messages to display
            registry.RequestModuleInterface<IAsyncMessageRecievedService>().OnMessageReceived += OnMessageReceived;
        }
 public void Start(IConfigSource config, IRegistryCore registry)
 {
     m_GridService = registry.RequestModuleInterface<IGridService>();
     m_AuthenticationService = registry.RequestModuleInterface<IAuthenticationService>();
     m_InventoryService = registry.RequestModuleInterface<IInventoryService>();
     m_Database = DataManager.RequestPlugin<IUserAccountData>();
     if (m_Database == null)
         throw new Exception("Could not find a storage interface in the given module");
 }
        public virtual void Start(IConfigSource config, IRegistryCore registry)
        {
            m_Database = DataManager.RequestPlugin<IInventoryData>();
            m_UserAccountService = registry.RequestModuleInterface<IUserAccountService>();
            m_LibraryService = registry.RequestModuleInterface<ILibraryService>();
            m_AssetService = registry.RequestModuleInterface<IAssetService>();

            registry.RequestModuleInterface<ISimulationBase>().EventManager.RegisterEventHandler("DeleteUserInformation", DeleteUserInformation);
        }
        public void PostStart(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("PresenceInHandler", "") != Name)
                return;
            IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("PresenceInHandlerPort"));
            m_PresenceService = registry.RequestModuleInterface<IPresenceService>();

            server.AddStreamHandler(new PresenceServerPostHandler(m_PresenceService));
        }
 public void PostStart(IConfigSource config, IRegistryCore registry)
 {
     IConfig handlerConfig = config.Configs["Handlers"];
     if (handlerConfig.GetString("EventQueueInHandler", "") != Name)
         return;
     IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("EventQueueInHandlerPort"));
     
     IEventQueueService service = registry.RequestModuleInterface<IEventQueueService>();
     ICapsService capsService = registry.RequestModuleInterface<ICapsService>();
     server.AddStreamHandler(new EQMEventPoster(service, capsService));
 }
        public void PostStart(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("FreeswitchInHandler", "") != Name)
                return;
            IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("FreeswitchInHandlerPort"));
            m_FreeswitchService = registry.RequestModuleInterface<IFreeswitchService>();

            server.AddHTTPHandler(String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix), FreeSwitchConfigHTTPHandler);
            server.AddHTTPHandler(String.Format("{0}/region-config", m_freeSwitchAPIPrefix), RegionConfigHTTPHandler);
        }
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            IConfig hgConfig = config.Configs["HyperGrid"];
            if (hgConfig == null || !hgConfig.GetBoolean ("Enabled", false))
                return;

            IConfig friendConfig = config.Configs["HGFriends"];
            if (friendConfig == null || !friendConfig.GetBoolean ("Enabled", false))
                return;

            MainServer.Instance.AddStreamHandler (new HGFriendsServerPostHandler (registry.RequestModuleInterface<IFriendsService>(),
                registry.RequestModuleInterface<IUserAgentService>()));
        }
        public void PostStart(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("LLLoginHandler", "") != Name)
                return;

            IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("LLLoginHandlerPort"));
            m_log.Debug("[LLLOGIN IN CONNECTOR]: Starting...");
            ReadLocalServiceFromConfig(config);
            m_LoginService = registry.RequestModuleInterface<ILoginService>();

            InitializeHandlers(server);
        }
Beispiel #15
0
        public void PostStart(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("CAPSHandler", "") != Name)
                return;
            ICapsService m_capsService = registry.RequestModuleInterface<ICapsService>();

            string Password = handlerConfig.GetString("CAPSHandlerPassword", String.Empty);
            if (Password != "" & m_capsService != null)
            {
                m_server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer(handlerConfig.GetUInt("CAPSHandlerPort"));
                //This handler allows sims to post CAPS for their sims on the CAPS server.
                m_server.AddStreamHandler(new CAPSHandler(Password, m_capsService));
            }
        }
        public void Start (IConfigSource config, IRegistryCore registry)
        {
            IConfig externalConfig = config.Configs ["ExternalCaps"];
            if (externalConfig == null)
                return;
            m_allowedCapsModules = Util.ConvertToList (externalConfig.GetString ("CapsHandlers"), true);
            
            ISyncMessageRecievedService service = registry.RequestModuleInterface<ISyncMessageRecievedService> ();
            service.OnMessageReceived += service_OnMessageReceived;
            m_syncPoster = registry.RequestModuleInterface<ISyncMessagePosterService> ();
            m_registry = registry;
            registry.RegisterModuleInterface<IExternalCapsHandler> (this);

            Init (registry, GetType ().Name);
        }
        public void Initialize (IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs ["Handlers"];
            if (handlerConfig.GetString ("UserAccountHandler", "") != Name)
                return;

            var simBase = registry.RequestModuleInterface<ISimulationBase> ();
            m_defaultDataPath = simBase.DefaultDataPath;

            Configure (config, registry);
            Init (registry, Name, serverPath: "/user/", serverHandlerName: "UserAccountServerURI");

            // check for user name seed
            IConfig loginConfig = config.Configs ["LoginService"];
            if (loginConfig != null) {
                string userNameSeed = loginConfig.GetString ("UserNameSeed", "");
                if (userNameSeed != "")
                    m_userNameSeed = userNameSeed.Split (',');
            }

            // check for initial stipend payment for new users
            IConfig currConfig = config.Configs ["Currency"];
            if (currConfig != null)
                m_newUserStipend = currConfig.GetInt ("NewUserStipend", 0);

        }
        public void Start (IConfigSource config, IRegistryCore registry)
        {
            if (config.Configs ["Currency"] == null ||
                config.Configs ["Currency"].GetString ("Module", "") != "BaseCurrency")
                return;

            // we only want this if we are local..
            bool remoteCalls = false;
            IConfig connectorConfig = config.Configs ["UniverseConnectors"];
            if ((connectorConfig != null) && connectorConfig.Contains ("DoRemoteCalls"))
                remoteCalls = connectorConfig.GetBoolean ("DoRemoteCalls", false);

            if (remoteCalls)
                return;

            m_connector = Framework.Utilities.DataManager.RequestPlugin<IBaseCurrencyConnector> () as BaseCurrencyConnector;
            var curPort = m_connector.GetConfig ().ClientPort;
            if (curPort == 0 && MainServer.Instance == null)
                return;

            IHttpServer server = registry.RequestModuleInterface<ISimulationBase> ().GetHttpServer ((uint)curPort);
            server.AddXmlRPCHandler ("getCurrencyQuote", QuoteFunc);
            server.AddXmlRPCHandler ("buyCurrency", BuyFunc);
            server.AddXmlRPCHandler ("preflightBuyLandPrep", PreflightBuyLandPrepFunc);
            server.AddXmlRPCHandler ("buyLandPrep", LandBuyFunc);
            server.AddXmlRPCHandler ("getBalance", GetbalanceFunc);
            server.AddXmlRPCHandler ("/currency.php", GetbalanceFunc);
            server.AddXmlRPCHandler ("/landtool.php", GetbalanceFunc);

            m_syncMessagePoster = registry.RequestModuleInterface<ISyncMessagePosterService> ();
            m_agentInfoService = registry.RequestModuleInterface<IAgentInfoService> ();
        }
Beispiel #19
0
        private void SetUpConsole(IConfigSource config, IRegistryCore registry)
        {
            List<ICommandConsole> Plugins = AuroraModuleLoader.PickupModules<ICommandConsole>();
            foreach (ICommandConsole plugin in Plugins)
            {
                plugin.Initialize(config, registry.RequestModuleInterface<ISimulationBase>());
            }

            if (MainConsole.Instance == null)
            {
                Console.WriteLine("[Console]: No Console located");
                return;
            }

            MainConsole.Instance.Threshold = Level.Info;
            
            MainConsole.Instance.Fatal(String.Format("[Console]: Console log level is {0}",
                                                         MainConsole.Instance.Threshold));

            MainConsole.Instance.Commands.AddCommand("set log level", "set log level [level]",
                                                     "Set the console logging level", HandleLogLevel);

            MainConsole.Instance.Commands.AddCommand("get log level", "get log level",
                                                     "Returns the current console logging level", HandleGetLogLevel);
        }
 public AuroraDataServerPostOSDHandler(string url, string SessionID, IRegistryCore registry) :
     base("POST", url)
 {
     DirectoryHandler = new DirectoryInfoOSDHandler (registry.RequestModuleInterface<ISimulationBase>().ConfigSource);
     m_SessionID = SessionID;
     m_registry = registry;
 }
Beispiel #21
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            ISimulationBase simBase = registry.RequestModuleInterface<ISimulationBase>();
            m_server = simBase.GetHttpServer(0);

            MainConsole.Instance.Commands.AddCommand("CapsService", false, "show presences", "show presences", "Shows all presences in the grid", ShowUsers);
        }
        public void Start (IConfigSource config, IRegistryCore registry)
        {
            if (!m_enabled)
                return;

            m_assetService = registry.RequestModuleInterface<IAssetService> ();
            m_inventoryService = registry.RequestModuleInterface<IInventoryService> ();
            m_avatarService = registry.RequestModuleInterface<IAvatarService> ();
            m_assetService = registry.RequestModuleInterface<IAssetService> ();

            MainConsole.Instance.Commands.AddCommand (
                "bake avatar",
                "bake avatar [firstname lastname]",
                "Bakes an avatar's appearance",
                HandleBakeAvatar, false, true);
        }
 public void Initialize(IConfigSource config, IRegistryCore registry)
 {
     m_config = config;
     m_registry = registry;
     registry.RequestModuleInterface<ISimulationBase>().EventManager.RegisterEventHandler("PreRegisterRegion",
                                                                                          EventManager_OnGenericEvent);
 }
        public void LoadLibrary(ILibraryService service, IConfigSource source, IRegistryCore registry)
        {
            m_service = service;

            IConfig assetConfig = source.Configs["DefaultXMLAssetLoader"];
            if (assetConfig == null){
                return;
            }
            string loaderArgs = assetConfig.GetString("AssetLoaderArgs",
                        String.Empty);
            bool assetLoaderEnabled = !assetConfig.GetBoolean("PreviouslyLoaded", false);

            if (!assetLoaderEnabled)
                return;

            registry.RegisterModuleInterface<DefaultAssetXMLLoader>(this);

            MainConsole.Instance.InfoFormat("[DefaultXMLAssetLoader]: Loading default asset set from {0}", loaderArgs);
            IAssetService assetService = registry.RequestModuleInterface<IAssetService>();
            ForEachDefaultXmlAsset(loaderArgs,
                    delegate(AssetBase a)
                    {
                        if (!assetLoaderEnabled && assetService.GetExists(a.IDString))
                            return;
                        assetService.Store(a);
                    });
        }
        public virtual void Initialize (IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs ["Handlers"];
            if (handlerConfig.GetString ("AssetHandler", "") != "FileBased" + Name)
                return;
            m_enabled = true;
            Configure (config, registry);
            Init (registry, Name, serverPath: "/asset/", serverHandlerName: "AssetServerURI");

            // set defaults
            var simbase = registry.RequestModuleInterface<ISimulationBase> ();
            var defpath = simbase.DefaultDataPath;
            m_assetsDirectory = Path.Combine (defpath, Constants.DEFAULT_FILEASSETS_DIR);
            m_migrateSQL = true;

            IConfig fileConfig = config.Configs ["FileBasedAssetService"];
            if (fileConfig != null)
            {
                var assetsPath = fileConfig.GetString ("AssetFolderPath", m_assetsDirectory);
                if (assetsPath != "")
                    m_assetsDirectory = assetsPath;

                // try and migrate sql assets if they are missing?
                m_migrateSQL = fileConfig.GetBoolean ("MigrateSQLAssets", true);
            }
            SetUpFileBase (m_assetsDirectory);

        }
        public void Start (IConfigSource config, IRegistryCore registry)
        {
            if (!m_enabled)
                return;

            m_registry = registry;
            m_registry.RequestModuleInterface<IGridRegistrationService> ().RegisterModule (this);
        }
 public void Initialize(IGenericData unneeded, IConfigSource source, IRegistryCore simBase, string defaultConnectionString)
 {
     if (source.Configs["AuroraConnectors"].GetString("OfflineMessagesConnector", "LocalConnector") == "SimianConnector")
     {
         m_ServerURIs = simBase.RequestModuleInterface<IConfigurationService>().FindValueOf("RemoteServerURI");
         DataManager.DataManager.RegisterPlugin(Name, this);
     }
 }
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];
            if (handlerConfig.GetString("NeighborInHandler", "") != Name)
                return;

            IHttpServer server = registry.RequestModuleInterface<ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("NeighborInHandlerPort"));
            m_NeighborService = registry.RequestModuleInterface<INeighborService>();
            m_AuthenticationService = registry.RequestModuleInterface<IAuthenticationService>();
            if (m_NeighborService == null)
            {
                m_log.Error("[NEIGHBOR IN CONNECTOR]: neighbor service was not provided");
                return;
            }

            server.AddStreamHandler(new NeighborHandler(m_NeighborService.InnerService, m_AuthenticationService, config));
        }
Beispiel #29
0
        public void FinishedStartup()
        {
            IMoneyModule moneyModule = m_registry.RequestModuleInterface <IMoneyModule>();

            if (moneyModule != null) //Only register if money is enabled
            {
                // Register the GroupPayments Engine
            }
        }
Beispiel #30
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            m_registry = registry;
            //MainConsole.Instance.Commands.AddCommand("UrlNegotiationProcessing", true, "switch servers",
            //    "switch servers", "Moves all regions to use a new URL base", NegotiateUrls);

            //Also look for incoming messages to display
            registry.RequestModuleInterface <IAsyncMessageRecievedService>().OnMessageReceived += OnMessageReceived;
        }
Beispiel #31
0
 public void Init(IRegistryCore registry, string name)
 {
     m_registry = registry;
     m_name = name;
     IConfigSource source = registry.RequestModuleInterface<ISimulationBase>().ConfigSource;
     IConfig config;
     if ((config = source.Configs["AuroraConnectors"]) != null)
         m_doRemoteCalls = config.GetBoolean("DoRemoteCalls", false);
 }
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            if (!m_enabled)
            {
                return;
            }

            m_assetService     = registry.RequestModuleInterface <IAssetService> ();
            m_inventoryService = registry.RequestModuleInterface <IInventoryService> ();
            m_avatarService    = registry.RequestModuleInterface <IAvatarService> ();
            m_assetService     = registry.RequestModuleInterface <IAssetService> ();

            MainConsole.Instance.Commands.AddCommand(
                "bake avatar",
                "bake avatar [firstname lastname]",
                "Bakes an avatar's appearance",
                HandleBakeAvatar, false, true);
        }
 public void Start(IConfigSource config, IRegistryCore registry)
 {
     SceneManager man = registry.RequestModuleInterface<SceneManager>() ;
     if (man != null)
     {
         man.OnAddedScene += Init;
         man.OnCloseScene += RemoveScene;
     }
 }
Beispiel #34
0
        private object CreateUserInformation(string functionname, object parameters)
        {
            UUID userid = (UUID)parameters;
            IUserAccountService userService = m_registry.RequestModuleInterface <IUserAccountService>();
            UserAccount         user        = userService.GetUserAccount(null, userid);

            if (user == null)
            {
                return(null);
            }
            if ((m_options.StipendsPremiumOnly) && ((user.UserFlags & Constants.USER_FLAG_MEMBER) != Constants.USER_FLAG_MEMBER))
            {
                return(null);
            }

            // Don't set a StipendPayment for System Users
            if (Utilities.IsSystemUser(user.PrincipalID))
            {
                return(null);
            }

            SchedulerItem i = m_scheduler.Get(user.PrincipalID.ToString(), "StipendsPayout");

            if (i != null)
            {
                return(null);
            }
            // Scheduler needs to get 1 date/time to set for "PayDay" - Fly 17/11/2014
            RepeatType runevertype = (RepeatType)Enum.Parse(typeof(RepeatType), m_options.StipendsEveryType);
            int        runevery    = m_options.StipendsEvery;

            m_scheduler.Save(new SchedulerItem("StipendsPayout",
                                               OSDParser.SerializeJsonString(
                                                   new StipendsInfo()
            {
                AgentID = user.PrincipalID
            }.ToOSD()),
                                               false, UnixTimeStampToDateTime(user.Created), runevery,
                                               runevertype, user.PrincipalID)
            {
                HistoryKeep = true, HistoryReceipt = true
            });
            return(null);
        }
Beispiel #35
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            SceneManager man = registry.RequestModuleInterface <SceneManager>();

            if (man != null)
            {
                man.OnAddedScene += Init;
                man.OnCloseScene += RemoveScene;
            }
        }
Beispiel #36
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            if (config.Configs["Currency"] == null ||
                config.Configs["Currency"].GetString("Module", "") != "SimpleCurrency")
            {
                return;
            }

            // we only want this if we are local..
            bool    remoteCalls     = false;
            IConfig connectorConfig = config.Configs["UniverseConnectors"];

            if ((connectorConfig != null) && connectorConfig.Contains("DoRemoteCalls"))
            {
                remoteCalls = connectorConfig.GetBoolean("DoRemoteCalls", false);
            }

            if (remoteCalls)
            {
                return;
            }

            m_connector = Framework.Utilities.DataManager.RequestPlugin <ISimpleCurrencyConnector>() as BaseCurrencyConnector;
            var curPort = m_connector.GetConfig().ClientPort;

            if (curPort == 0 && MainServer.Instance == null)
            {
                return;
            }

            IHttpServer server = registry.RequestModuleInterface <ISimulationBase>().GetHttpServer((uint)curPort);

            server.AddXmlRPCHandler("getCurrencyQuote", QuoteFunc);
            server.AddXmlRPCHandler("buyCurrency", BuyFunc);
            server.AddXmlRPCHandler("preflightBuyLandPrep", PreflightBuyLandPrepFunc);
            server.AddXmlRPCHandler("buyLandPrep", LandBuyFunc);
            server.AddXmlRPCHandler("getBalance", GetbalanceFunc);
            server.AddXmlRPCHandler("/currency.php", GetbalanceFunc);
            server.AddXmlRPCHandler("/landtool.php", GetbalanceFunc);

            m_syncMessagePoster = registry.RequestModuleInterface <ISyncMessagePosterService>();
            m_agentInfoService  = registry.RequestModuleInterface <IAgentInfoService>();
        }
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            IConfig hgConfig = config.Configs["HyperGrid"];

            if (hgConfig == null || !hgConfig.GetBoolean("Enabled", false))
            {
                return;
            }

            IConfig friendConfig = config.Configs["HGFriends"];

            if (friendConfig == null || !friendConfig.GetBoolean("Enabled", false))
            {
                return;
            }

            MainServer.Instance.AddStreamHandler(new HGFriendsServerPostHandler(registry.RequestModuleInterface <IFriendsService>(),
                                                                                registry.RequestModuleInterface <IUserAgentService>()));
        }
Beispiel #38
0
        public MuteList[] GetMuteList(UUID PrincipalID)
        {
            Dictionary <string, object> sendData = new Dictionary <string, object>();

            sendData["PRINCIPALID"] = PrincipalID.ToString();
            sendData["METHOD"]      = "getmutelist";

            string          reqString = WebUtils.BuildQueryString(sendData);
            List <MuteList> Mutes     = new List <MuteList>();

            try
            {
                List <string> m_ServerURIs = m_registry.RequestModuleInterface <IConfigurationService>().FindValueOf(PrincipalID.ToString(), "RemoteServerURI");
                foreach (string m_ServerURI in m_ServerURIs)
                {
                    string reply = SynchronousRestFormsRequester.MakeRequest("POST",
                                                                             m_ServerURI + "/auroradata",
                                                                             reqString);
                    if (reply != string.Empty)
                    {
                        Dictionary <string, object> replyData = WebUtils.ParseXmlResponse(reply);

                        foreach (object f in replyData)
                        {
                            KeyValuePair <string, object> value = (KeyValuePair <string, object>)f;
                            if (value.Value is Dictionary <string, object> )
                            {
                                Dictionary <string, object> valuevalue = value.Value as Dictionary <string, object>;
                                MuteList mute = new MuteList();
                                mute.FromKVP(valuevalue);
                                Mutes.Add(mute);
                            }
                        }
                    }
                }
                return(Mutes.ToArray());
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[AuroraRemoteMuteListConnector]: Exception when contacting server: {0}", e.ToString());
            }
            return(Mutes.ToArray());
        }
        public void FinishedStartup()
        {
            if (m_registry != null)
            {
                uint        port   = m_config.Configs["Network"].GetUInt("http_listener_port", 8003);
                IHttpServer server = m_registry.RequestModuleInterface <ISimulationBase>().GetHttpServer(port);

                server.AddStreamHandler(new ServerHandler("/server/", m_registry, null));
            }
        }
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            if (!m_enabled)
            {
                return;
            }

            m_registry = registry;
            m_registry.RequestModuleInterface <IGridRegistrationService>().RegisterModule(this);
        }
 public void Initialize(IGenericData unneeded, IConfigSource source, IRegistryCore simBase,
                        string defaultConnectionString)
 {
     if (source.Configs["AuroraConnectors"].GetString("OfflineMessagesConnector", "LocalConnector") ==
         "SimianConnector")
     {
         m_ServerURIs = simBase.RequestModuleInterface <IConfigurationService>().FindValueOf("RemoteServerURI");
         DataManager.DataManager.RegisterPlugin(this);
     }
 }
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            IConfig externalConfig = config.Configs ["ExternalCaps"];

            if (externalConfig == null)
            {
                return;
            }
            m_allowedCapsModules = Util.ConvertToList(externalConfig.GetString("CapsHandlers"), true);

            ISyncMessageRecievedService service = registry.RequestModuleInterface <ISyncMessageRecievedService> ();

            service.OnMessageReceived += service_OnMessageReceived;
            m_syncPoster = registry.RequestModuleInterface <ISyncMessagePosterService> ();
            m_registry   = registry;
            registry.RegisterModuleInterface <IExternalCapsHandler> (this);

            Init(registry, GetType().Name);
        }
Beispiel #43
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];

            if (handlerConfig.GetString("LLLoginHandler", "") != Name)
            {
                return;
            }

            IHttpServer server =
                registry.RequestModuleInterface <ISimulationBase>().GetHttpServer(
                    (uint)handlerConfig.GetInt("LLLoginHandlerPort"));

            MainConsole.Instance.Debug("[LLLOGIN IN CONNECTOR]: Starting...");
            ReadLocalServiceFromConfig(config);
            m_loginService = registry.RequestModuleInterface <ILoginService>();

            InitializeHandlers(server);
        }
Beispiel #44
0
        public void CacheWearableData(UUID principalID, AvatarWearable wearable)
        {
            if (!m_enableCacheBakedTextures)
            {
                IAssetService service = m_registry.RequestModuleInterface <IAssetService>();
                if (service != null)
                {
                    //Remove the old baked textures then from the DB as we don't want to keep them around
                    foreach (UUID texture in wearable.GetItems().Values)
                    {
                        service.Delete(texture.ToString());
                    }
                }
                return;
            }
            wearable.MaxItems = 0; //Unlimited items

            /*AvatarBaseData baseData = new AvatarBaseData();
             * AvatarBaseData[] av = m_CacheDatabase.Get("PrincipalID", principalID.ToString());
             * foreach (AvatarBaseData abd in av)
             * {
             *  //If we have one already made, keep what is already there
             *  if (abd.Data["Name"] == "CachedWearables")
             *  {
             *      baseData = abd;
             *      OSDArray array = (OSDArray)OSDParser.DeserializeJson(abd.Data["Value"]);
             *      AvatarWearable w = new AvatarWearable();
             *      w.MaxItems = 0; //Unlimited items
             *      w.Unpack(array);
             *      foreach (KeyValuePair<UUID, UUID> kvp in w.GetItems())
             *      {
             *          wearable.Add(kvp.Key, kvp.Value);
             *      }
             *  }
             * }
             * //If we don't have one, set it up for saving a new one
             * if (baseData.Data == null)
             * {
             *  baseData.PrincipalID = principalID;
             *  baseData.Data = new Dictionary<string, string>();
             *  baseData.Data.Add("Name", "CachedWearables");
             * }
             * baseData.Data["Value"] = OSDParser.SerializeJsonString(wearable.Pack());
             * try
             * {
             *  bool store = m_CacheDatabase.Store(baseData);
             *  if (!store)
             *  {
             *      m_log.Warn("[AvatarService]: Issue saving the cached wearables to the database.");
             *  }
             * }
             * catch
             * {
             * }*/
        }
        private bool AddToQueue(OSD ev, UUID avatarID, ulong regionHandle, bool runasync)
        {
            //MainConsole.Instance.DebugFormat("[EVENTQUEUE]: Enqueuing event for {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName);

            if (ev == null)
            {
                return(false);
            }
            try
            {
                OSDMap request = new OSDMap {
                    { "AgentID", avatarID }, { "RegionHandle", regionHandle }
                };
                OSDArray events = new OSDArray {
                    OSDParser.SerializeLLSDXmlString(ev)
                };
                //Note: we HAVE to convert it to xml, otherwise things like byte[] arrays will not be passed through correctly!

                request.Add("Events", events);

                IConfigurationService configService = m_registry.RequestModuleInterface <IConfigurationService>();
                List <string>         serverURIs    = configService.FindValueOf(avatarID.ToString(), regionHandle.ToString(),
                                                                                "EventQueueServiceURI");
                foreach (string serverURI in serverURIs)
                {
                    if (serverURI != "")
                    {
                        if (runasync)
                        {
                            /*AsynchronousRestObjectRequester.MakeRequest("POST", serverURI + "/CAPS/EQMPOSTER",
                             * OSDParser.SerializeJsonString(request),
                             * delegate(string resp)
                             * {
                             *  return RequestHandler(resp, events, avatarID, regionHandle);
                             * });
                             *
                             * return true;*/
                            string resp = SynchronousRestFormsRequester.MakeRequest("POST", serverURI + "/CAPS/EQMPOSTER", OSDParser.SerializeJsonString(request));
                            return(RequestHandler(resp, events, avatarID, regionHandle));
                        }
                        else
                        {
                            string resp = SynchronousRestFormsRequester.MakeRequest("POST", serverURI + "/CAPS/EQMPOSTER", OSDParser.SerializeJsonString(request));
                            return(RequestHandler(resp, events, avatarID, regionHandle));
                        }
                    }
                }
            }
            catch (Exception e)
            {
                MainConsole.Instance.Error("[EVENTQUEUE] Caught exception: " + e);
            }

            return(false);
        }
Beispiel #46
0
        public void FinishedStartup()
        {
            if (m_registry == null)
            {
                return;
            }

            m_registry.RegisterModuleInterface <IMoneyModule>(this);

            ISceneManager manager = m_registry.RequestModuleInterface <ISceneManager>();

            if (manager != null)
            {
                manager.OnAddedScene += (scene) =>
                {
                    m_scenes.Add(scene);
                    scene.EventManager.OnNewClient       += OnNewClient;
                    scene.EventManager.OnClosingClient   += OnClosingClient;
                    scene.EventManager.OnMakeRootAgent   += OnMakeRootAgent;
                    scene.EventManager.OnValidateBuyLand += EventManager_OnValidateBuyLand;
                    scene.RegisterModuleInterface <IMoneyModule>(this);
                };
                manager.OnCloseScene += (scene) =>
                {
                    scene.EventManager.OnNewClient       -= OnNewClient;
                    scene.EventManager.OnClosingClient   -= OnClosingClient;
                    scene.EventManager.OnMakeRootAgent   -= OnMakeRootAgent;
                    scene.EventManager.OnValidateBuyLand -= EventManager_OnValidateBuyLand;
                    scene.RegisterModuleInterface <IMoneyModule>(this);
                    m_scenes.Remove(scene);
                };
            }


            if (!m_connector.DoRemoteCalls)
            {
                if ((m_connector.GetConfig().GiveStipends) && (m_connector.GetConfig().Stipend > 0))
                {
                    new GiveStipends(m_connector.GetConfig(), m_registry, m_connector);
                }
            }
        }
        public void AddAbuseReport(AbuseReport abuse_report)
        {
            try
            {
                List <string> m_ServerURIs = m_registry.RequestModuleInterface <IConfigurationService>().FindValueOf("RemoteServerURI");
                foreach (string m_ServerURI in m_ServerURIs)
                {
                    Dictionary <string, object> ar = abuse_report.ToKeyValuePairs();
                    ar.Add("METHOD", "AddAbuseReport");

                    SynchronousRestFormsRequester.MakeRequest("POST",
                                                              m_ServerURI + "/abusereport",
                                                              WebUtils.BuildQueryString(ar));
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[ABUSEREPORT CONNECTOR]: Exception when contacting friends server: {0}", e.Message);
            }
        }
Beispiel #48
0
 /// <summary>
 ///     Remove the all of the user's CAPS from the system
 /// </summary>
 /// <param name="agentID"></param>
 public void RemoveCAPS(UUID agentID)
 {
     if (m_ClientCapsServices.ContainsKey(agentID))
     {
         IClientCapsService perClient = m_ClientCapsServices [agentID];
         perClient.Close();
         m_ClientCapsServices.Remove(agentID);
         m_registry.RequestModuleInterface <ISimulationBase> ()
         .EventManager.FireGenericEventHandler("UserLogout", agentID);
     }
 }
Beispiel #49
0
        public virtual AssetBase Get(string id)
        {
            IImprovedAssetCache cache = m_registry.RequestModuleInterface <IImprovedAssetCache>();

            if (cache != null)
            {
                AssetBase cachedAsset = cache.Get(id);
                if (cachedAsset != null && cachedAsset.Data.Length != 0)
                {
                    return(cachedAsset);
                }
            }
            AssetBase asset = m_database.GetAsset(UUID.Parse(id));

            if (cache != null && asset != null)
            {
                cache.Cache(asset);
            }
            return(asset);
        }
        public virtual void Start(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];

            if (handlerConfig.GetString("AssetHandler", "") != Name)
            {
                return;
            }

            SetCache(registry.RequestModuleInterface <IImprovedAssetCache>());
        }
        public void FinishedStartup()
        {
            m_accountService = m_registry.RequestModuleInterface <IUserAccountService> ();

            // these are only valid if we are local
            if (m_accountService.IsLocalConnector)
            {
                // check and/or create default RealEstate user
                CheckSystemUserInfo();

                // if this is the initial run, create the grid system user
                var users = m_accountService.NumberOfUserAccounts(null, "");
                if (users == 0)
                {
                    CreateGridOwnerUser();
                }

                AddCommands();
            }
        }
Beispiel #52
0
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            ISimulationBase simBase = registry.RequestModuleInterface <ISimulationBase>();

            m_server = simBase.GetHttpServer(0);

            if (MainConsole.Instance != null)
            {
                MainConsole.Instance.Commands.AddCommand("show presences", "show presences", "Shows all presences in the grid", ShowUsers);
            }
        }
Beispiel #53
0
        private void LoadPreviouslyLoadedArchives(IRegistryCore registry)
        {
            IUserAccountService UserAccountService = registry.RequestModuleInterface <IUserAccountService>();
            UserAccount         uinfo            = UserAccountService.GetUserAccount(UUID.Zero, LibraryOwner);
            IInventoryService   InventoryService = registry.RequestModuleInterface <IInventoryService>();

            //Make the user account for the default IAR
            if (uinfo == null)
            {
                uinfo             = new UserAccount(LibraryOwner);
                uinfo.Name        = LibraryOwnerName;
                uinfo.Email       = "";
                uinfo.ServiceURLs = new Dictionary <string, object>();
                uinfo.UserLevel   = 0;
                uinfo.UserFlags   = 0;
                uinfo.ScopeID     = UUID.Zero;
                uinfo.UserTitle   = "";
                UserAccountService.StoreUserAccount(uinfo);
                InventoryService.CreateUserInventory(uinfo.PrincipalID);
                uinfo = UserAccountService.GetUserAccount(UUID.Zero, LibraryOwner);
                if (uinfo == null)
                {
                    //Grid mode, can't create the user... leave
                    return;
                }
            }
            InventoryCollection col = InventoryService.GetFolderContent(LibraryOwner, UUID.Zero);

            foreach (InventoryFolderBase folder in col.Folders)
            {
                if (folder.Name == "My Inventory")
                {
                    continue;                                //Pass My Inventory by
                }
                InventoryFolderImpl f = new InventoryFolderImpl(folder);

                TraverseFolders(f, folder.ID, InventoryService);
                //This is our loaded folder
                AddToDefaultInventory(f);
            }
        }
        public void FinishedStartup()
        {
            if (m_registry == null)
            {
                return;
            }

            m_registry.RegisterModuleInterface <IMoneyModule>(this);

            ISceneManager manager = m_registry.RequestModuleInterface <ISceneManager> ();

            if (manager != null)
            {
                manager.OnAddedScene += (scene) => {
                    m_scenes.Add(scene);
                    scene.EventManager.OnNewClient       += OnNewClient;
                    scene.EventManager.OnClosingClient   += OnClosingClient;
                    scene.EventManager.OnMakeRootAgent   += OnMakeRootAgent;
                    scene.EventManager.OnValidateBuyLand += EventManager_OnValidateBuyLand;
                    scene.RegisterModuleInterface <IMoneyModule> (this);
                };
                manager.OnCloseScene += (scene) => {
                    scene.EventManager.OnNewClient       -= OnNewClient;
                    scene.EventManager.OnClosingClient   -= OnClosingClient;
                    scene.EventManager.OnMakeRootAgent   -= OnMakeRootAgent;
                    scene.EventManager.OnValidateBuyLand -= EventManager_OnValidateBuyLand;
                    scene.RegisterModuleInterface <IMoneyModule> (this);
                    m_scenes.Remove(scene);
                };
            }


            // these are only valid if we are local
            if (m_connector.IsLocalConnector)
            {
                m_userInfoService    = m_registry.RequestModuleInterface <IAgentInfoService> ();
                m_userAccountService = m_registry.RequestModuleInterface <IUserAccountService> ();

                AddCommands();
            }
        }
Beispiel #55
0
        object EventManager_OnGenericEvent(string FunctionName, object parameters)
        {
            if (FunctionName != "PreRegisterRegion")
            {
                return(null);
            }
            IConfig handlerConfig = m_config.Configs["Handlers"];

            if (handlerConfig.GetString("SimulationInHandler", "") != Name)
            {
                return(null);
            }

            if (m_LocalSimulationService != null)
            {
                return(null);
            }

            bool        secure = handlerConfig.GetBoolean("SecureSimulation", true);
            IHttpServer server = m_registry.RequestModuleInterface <ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("SimulationInHandlerPort"));

            m_LocalSimulationService = m_registry.RequestModuleInterface <ISimulationService>();

            string path = "/" + UUID.Random().ToString() + "/agent/";

            IGridRegisterModule registerModule = m_registry.RequestModuleInterface <IGridRegisterModule>();

            if (registerModule != null && secure)
            {
                registerModule.AddGenericInfo("SimulationAgent", path);
            }
            else
            {
                secure = false;
                path   = "/agent/";
            }

            server.AddHTTPHandler(path, new AgentHandler(m_LocalSimulationService.GetInnerService(), secure).Handler);
            server.AddHTTPHandler("/object/", new ObjectHandler(m_LocalSimulationService.GetInnerService(), m_config).Handler);
            return(null);
        }
        public void FinishedStartup()
        {
            if (!m_enabled)
            {
                return;
            }
            IGridServerInfoService serverInfo = m_registry.RequestModuleInterface <IGridServerInfoService>();

            if (serverInfo != null)
            {
                serverInfo.AddURI("SSAService", ServiceURI);
            }
            else
            {
                IGridInfo gridInfo = m_registry.RequestModuleInterface <IGridInfo>();
                if (gridInfo != null)
                {
                    gridInfo.AgentAppearanceURI = ServiceURI;
                }
            }
        }
        public void Initialize(ILoginService service, IConfigSource config, IRegistryCore registry)
        {
            IConfig loginServerConfig = config.Configs["LoginService"];

            if (loginServerConfig != null)
            {
                m_UseTOS      = loginServerConfig.GetBoolean("UseTermsOfServiceOnFirstLogin", false);
                m_TOSLocation = loginServerConfig.GetString("FileNameOfTOS", "");
            }
            m_AuthenticationService = registry.RequestModuleInterface <IAuthenticationService>();
            m_LoginService          = service;
        }
Beispiel #58
0
        public string GetJsonConfig()
        {
            List <string> serverURIs = m_registry.RequestModuleInterface <IConfigurationService>().FindValueOf("FreeswitchServiceURL");

            foreach (string m_ServerURI in serverURIs)
            {
                m_log.DebugFormat("[FREESWITCH CONNECTOR]: Requesting config from {0}", m_ServerURI);
                return(SynchronousRestFormsRequester.MakeRequest("GET",
                                                                 m_ServerURI, String.Empty));
            }
            return("");
        }
        public void AddExistingUrlForClient(string SessionID, string url, uint port)
        {
            IHttpServer server = m_registry.RequestModuleInterface <ISimulationBase>().GetHttpServer(port);

            server.AddStreamHandler(new EQMEventPoster(url,
                                                       m_registry.RequestModuleInterface <IEventQueueService>().
                                                       InnerService,
                                                       m_registry.RequestModuleInterface <ICapsService>(), SessionID,
                                                       m_registry));
        }
        public void Start(IConfigSource config, IRegistryCore registry)
        {
            IConfig handlerConfig = config.Configs["Handlers"];

            if (handlerConfig.GetString("OpenIdHandler", "") != Name)
            {
                return;
            }
            IHttpServer server = registry.RequestModuleInterface <ISimulationBase>().GetHttpServer((uint)handlerConfig.GetInt("OpenIdHandlerPort"));

            m_AuthenticationService = registry.RequestModuleInterface <IAuthenticationService>();
            m_UserAccountService    = registry.RequestModuleInterface <IUserAccountService>();

            // Handler for OpenID user identity pages
            server.AddStreamHandler(new OpenIdStreamHandler("GET", "/users/", m_UserAccountService, m_AuthenticationService));
            // Handlers for the OpenID endpoint server
            server.AddStreamHandler(new OpenIdStreamHandler("POST", "/openid/server/", m_UserAccountService, m_AuthenticationService));
            server.AddStreamHandler(new OpenIdStreamHandler("GET", "/openid/server/", m_UserAccountService, m_AuthenticationService));

            m_log.Info("[OPENID]: OpenId service enabled");
        }