Beispiel #1
0
        public void Awake()
        {
            StartConfig startConfig = Game.Scene.GetComponent <StartConfigComponent>().StartConfig;

            this.appType    = startConfig.AppType;
            this.HttpConfig = startConfig.GetComponent <HttpConfig>();

            this.Load();

            try
            {
                this.listener = new HttpListener();

                if (this.HttpConfig.Url == null)
                {
                    this.HttpConfig.Url = "";
                }
                foreach (string s in this.HttpConfig.Url.Split(';'))
                {
                    if (s.Trim() == "")
                    {
                        continue;
                    }
                    this.listener.Prefixes.Add(s);
                }

                this.listener.Start();

                this.Accept();
            }
            catch (HttpListenerException e)
            {
                throw new Exception($"http server error: {e.ErrorCode}", e);
            }
        }
Beispiel #2
0
        public void Awake()
        {
            StartConfigComponent startConfigComponent = Game.Scene.GetComponent <StartConfigComponent>();

            this.AppId = startConfigComponent.StartConfig.AppId;

            StartConfig startConfig = startConfigComponent.LocationConfig;

            this.LocationAddress = startConfig.GetComponent <InnerConfig>().IPEndPoint;
        }
Beispiel #3
0
        public void Awake()
        {
            StartConfig dbStartConfig = Game.Scene.GetComponent <StartConfigComponent>().DBConfig;

            dbAddress = dbStartConfig.GetComponent <InnerConfig>().IPEndPoint;
        }