Beispiel #1
0
 /// <summary>
 /// 验证小区,更新小区信息之前操作
 /// </summary>
 public void AuthCommunity()
 {
     if (this.IsAuth)
     {
         return;
     }
     try
     {
         CommunityClient cc       = new CommunityClient();
         var             response = cc.Create(this.Name, this.Address);
         if (response.Code == "0")
         {
             this.IsAuth   = true;
             this.DepartId = response.Community.DepartID;
         }
         else
         {
             this.IsAuth   = false;
             this.DepartId = string.Empty;
         }
     }
     catch (Exception)
     {
         this.IsAuth = false;
     }
 }
Beispiel #2
0
        public LauncherForm()
        {
            this.InitializeComponent();
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            // Set window title
            this.Text = GameName;

            // Read newer file-based game settings
            this.config = new Config();
            this.config.Read();

            string baseUrl = this.config.GetString(ConfigSections.Network, ConfigKeys.MasterServerHostName);

            this.httpClient = new HttpClient(
                new HttpClientHandler()
            {
                UseProxy = false
            });
            this.versionHttpClient = new VersionClient(this.httpClient)
            {
                BaseUrl = baseUrl
            };
            this.communityHttpClient = new CommunityClient(this.httpClient)
            {
                BaseUrl = baseUrl
            };
        }