Example #1
0
        public void FinishedStartup()
        {
            if (!m_enabled)
            {
                return;
            }
            IGridServerInfoService serverInfo = m_registry.RequestModuleInterface <IGridServerInfoService>();

            if (serverInfo != null)
            {
                serverInfo.AddURI("MapService", MapServiceURL);
                serverInfo.AddURI("MapAPIService", MapServiceAPIURL);
            }
        }
Example #2
0
        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));

                IGridServerInfoService gridServers = m_registry.RequestModuleInterface <IGridServerInfoService>();
                if (gridServers != null)
                {
                    gridServers.AddURI("ServerURI", server.ServerURI + "/server/");
                }
                //AddUDPConector(8008);
            }
        }
Example #3
0
        public Dictionary <string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                                OSHttpResponse httpResponse, Dictionary <string, object> requestParameters,
                                                ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary <string, object>();

            IGridServerInfoService infoService = webInterface.Registry.RequestModuleInterface <IGridServerInfoService>();

            string mapService    = infoService.GetGridURI("MapService");
            string mapAPIService = infoService.GetGridURI("MapAPIService");

            vars.Add("WorldMapServiceURL", mapService.Remove(mapService.Length - 1));
            vars.Add("WorldMapAPIServiceURL", mapAPIService.Remove(mapAPIService.Length - 1));

            return(vars);
        }
        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 UpdateGridInfo()
        {
            IConfig gridCfg = m_config.Configs["GridInfoService"];

            if (gridCfg == null)
            {
                return;
            }
            _info["platform"] = "WhiteCore";
            try
            {
                IConfig                configCfg         = m_config.Configs["Handlers"];
                IWebInterfaceModule    webInterface      = m_registry.RequestModuleInterface <IWebInterfaceModule>();
                IMoneyModule           moneyModule       = m_registry.RequestModuleInterface <IMoneyModule>();
                IGridServerInfoService serverInfoService = m_registry.RequestModuleInterface <IGridServerInfoService>();

                // grid details
                _info["gridname"] = GridName = GetConfig(m_config, "gridname");
                _info["gridnick"] = GridNick = GetConfig(m_config, "gridnick");

                // login
                GridLoginURI = GetConfig(m_config, "login");
                if (GridLoginURI == "")
                {
                    GridLoginURI = MainServer.Instance.ServerURI + "/";

                    if (configCfg != null && configCfg.GetString("LLLoginHandlerPort", "") != "")
                    {
                        var port = configCfg.GetString("LLLoginHandlerPort", "");
                        if (port == "" || port == "0")
                        {
                            port = MainServer.Instance.Port.ToString();
                        }
                        GridLoginURI = MainServer.Instance.FullHostName + ":" + port + "/";
                    }
                }
                _info["login"] = GridLoginURI;

                // welcome
                GridWelcomeURI = GetConfig(m_config, "welcome");
                if (GridWelcomeURI == "" && webInterface != null)
                {
                    GridWelcomeURI = webInterface.LoginScreenURL;
                }
                _info["welcome"] = CheckServerHost(GridWelcomeURI);

                // registration
                GridRegisterURI = GetConfig(m_config, "register");
                if (GridRegisterURI == "" && webInterface != null)
                {
                    GridRegisterURI = webInterface.RegistrationScreenURL;
                }
                _info["register"] = CheckServerHost(GridRegisterURI);

                GridAboutURI = GetConfig(m_config, "about");
                if (GridAboutURI == "" && webInterface != null)
                {
                    GridAboutURI = webInterface.HomeScreenURL;
                }
                _info["about"] = CheckServerHost(GridAboutURI);

                GridHelpURI = GetConfig(m_config, "help");
                if (GridHelpURI == "" && webInterface != null)
                {
                    GridHelpURI = webInterface.HelpScreenURL;
                }
                _info["help"] = CheckServerHost(GridHelpURI);

                GridForgotPasswordURI = GetConfig(m_config, "forgottenpassword");
                if (GridForgotPasswordURI == "" && webInterface != null)
                {
                    GridForgotPasswordURI = webInterface.ForgotPasswordScreenURL;
                }
                _info["password"] = CheckServerHost(GridForgotPasswordURI);

                // mapping
                GridMapTileURI = GetConfig(m_config, "map");
                if (GridMapTileURI == "" && serverInfoService != null)
                {
                    GridMapTileURI = serverInfoService.GetGridURI("MapService");
                }

                // Agent
                AgentAppearanceURI = GetConfig(m_config, "AgentAppearanceURI");
                if (AgentAppearanceURI == "" && serverInfoService != null)
                {
                    AgentAppearanceURI = serverInfoService.GetGridURI("SSAService");
                }

                // profile
                GridWebProfileURI = GetConfig(m_config, "webprofile");
                if (GridWebProfileURI == "" && webInterface != null)
                {
                    GridWebProfileURI = webInterface.WebProfileURL;
                }

                // economy
                GridEconomyURI = GetConfig(m_config, "economy");
                if (GridEconomyURI == "")
                {
                    GridEconomyURI = MainServer.Instance.ServerURI + "/";           // assume default...

                    if (moneyModule != null)
                    {
                        int port = moneyModule.ClientPort;
                        if (port == 0)
                        {
                            port = (int)MainServer.Instance.Port;
                        }

                        GridEconomyURI = MainServer.Instance.FullHostName + ":" + port + "/";
                    }
                }
                _info["economy"] = _info["helperuri"] = CheckServerHost(GridEconomyURI);


                // misc.. these must be set to be used
                GridSearchURI   = GetConfig(m_config, "search");
                _info["search"] = CheckServerHost(GridSearchURI);

                GridDestinationURI   = GetConfig(m_config, "destination");
                _info["destination"] = CheckServerHost(GridDestinationURI);

                GridMarketplaceURI   = GetConfig(m_config, "marketplace");
                _info["marketplace"] = CheckServerHost(GridMarketplaceURI);

                GridTutorialURI   = GetConfig(m_config, "tutorial");
                _info["tutorial"] = CheckServerHost(GridTutorialURI);

                GridSnapshotConfigURI   = GetConfig(m_config, "snapshotconfig");
                _info["snapshotconfig"] = CheckServerHost(GridSnapshotConfigURI);
            }
            catch (Exception)
            {
                MainConsole.Instance.Warn(
                    "[Grid Info Service]: Cannot get grid info from config source, using minimal defaults");
            }

            MainConsole.Instance.DebugFormat("[Grid Info Service]: Grid info service initialized with {0} keys",
                                             _info.Count);
        }
Example #6
0
        public void UpdateGridInfo()
        {
            IConfig gridCfg = m_config.Configs["GridInfoService"];

            if (gridCfg == null)
            {
                return;
            }
            _info["platform"] = "Aurora";
            try
            {
                IConfig                configCfg         = m_config.Configs["Handlers"];
                IWebInterfaceModule    webInterface      = m_registry.RequestModuleInterface <IWebInterfaceModule>();
                IMoneyModule           moneyModule       = m_registry.RequestModuleInterface <IMoneyModule>();
                IGridServerInfoService serverInfoService = m_registry.RequestModuleInterface <IGridServerInfoService>();

                GridEconomyURI = GetConfig(m_config, "economy");
                if (GridEconomyURI == "")
                {
                    if (moneyModule != null)
                    {
                        int port = moneyModule.ClientPort;
                        if (port == 0)
                        {
                            port = (int)MainServer.Instance.Port;
                        }
                        GridEconomyURI = MainServer.Instance.FullHostName + ":" + port + "/";
                    }
                    else
                    {
                        GridEconomyURI = MainServer.Instance.FullHostName + ":" + 9000 + "/"; //Fallback... we dunno
                    }
                }
                if (GridEconomyURI != "" && !GridEconomyURI.EndsWith("/"))
                {
                    GridEconomyURI += "/";
                }
                _info["economy"] = _info["helperuri"] = GridEconomyURI;

                GridLoginURI = GetConfig(m_config, "login");
                if (GridLoginURI == "")
                {
                    if (configCfg != null && configCfg.GetString("LLLoginHandlerPort", "") != "")
                    {
                        var port = configCfg.GetString("LLLoginHandlerPort", "");
                        if (port == "" || port == "0")
                        {
                            port = MainServer.Instance.Port.ToString();
                        }
                        GridLoginURI = MainServer.Instance.FullHostName +
                                       ":" + port + "/";
                    }
                    else
                    {
                        GridLoginURI = MainServer.Instance.ServerURI + "/";
                    }
                }
                else if (!GridLoginURI.EndsWith("/"))
                {
                    GridLoginURI += "/";
                }
                _info["login"] = GridLoginURI;

                _info["welcome"] = GridWelcomeURI = GetConfig(m_config, "welcome");
                if (GridWelcomeURI == "" && webInterface != null)
                {
                    _info["welcome"] = GridWelcomeURI = webInterface.LoginScreenURL;
                }

                _info["register"] = GridRegisterURI = GetConfig(m_config, "register");
                if (GridRegisterURI == "" && webInterface != null)
                {
                    _info["register"] = GridRegisterURI = webInterface.RegistrationScreenURL;
                }

                _info["gridname"] = GridName = GetConfig(m_config, "gridname");
                _info["gridnick"] = GridNick = GetConfig(m_config, "gridnick");

                _info["about"]    = GridAboutURI = GetConfig(m_config, "about");
                _info["help"]     = GridHelpURI = GetConfig(m_config, "help");
                _info["password"] = GridForgotPasswordURI = GetConfig(m_config, "forgottenpassword");
                GridMapTileURI    = GetConfig(m_config, "map");

                if (GridMapTileURI == "" && serverInfoService != null)
                {
                    GridMapTileURI = serverInfoService.GetGridURI("MapService");
                }
                AgentAppearanceURI = GetConfig(m_config, "AgentAppearanceURI");
                if (AgentAppearanceURI == "" && serverInfoService != null)
                {
                    AgentAppearanceURI = serverInfoService.GetGridURI("SSAService");
                }
                GridWebProfileURI = GetConfig(m_config, "webprofile");
                if (GridWebProfileURI == "" && webInterface != null)
                {
                    GridWebProfileURI = webInterface.WebProfileURL;
                }
                GridSearchURI         = GetConfig(m_config, "search");
                GridDestinationURI    = GetConfig(m_config, "destination");
                GridMarketplaceURI    = GetConfig(m_config, "marketplace");
                GridTutorialURI       = GetConfig(m_config, "tutorial");
                GridSnapshotConfigURI = GetConfig(m_config, "snapshotconfig");
            }
            catch (Exception)
            {
                MainConsole.Instance.Warn(
                    "[GRID INFO SERVICE]: Cannot get grid info from config source, using minimal defaults");
            }

            MainConsole.Instance.DebugFormat("[GRID INFO SERVICE]: Grid info service initialized with {0} keys",
                                             _info.Count);
        }