Ejemplo n.º 1
0
        /// <summary>
        /// Updates the settings of the server.
        /// </summary>
        /// <param name="input">JSON string with the appropriately formatted server information.</param>
        public void server_information(string input)
        {
            ServerConnectorServerInformation info = deserializeJson <ServerConnectorServerInformation>(input);

            if (info == null)
            {
                Client.form_Login.Invoke((MethodInvoker)Client.form_Login.serverInvalid);
            }

            connector.server_info.server_name             = info.server_name;
            connector.server_info.maintenance_mode        = info.maintenance_mode;
            connector.server_info.is_key_required         = info.is_key_required;
            connector.server_info.is_registration_allowed = info.is_registration_allowed;
            connector.server_info.max_upload_filesize     = info.max_upload_filesize;
            connector.server_info.maintenance_mode        = info.maintenance_mode;
            connector.server_info.allowed_filetypes       = info.allowed_filetypes;
            connector.server_info.upload_base_url         = info.upload_base_url;
            connector.server_info.server_logo             = info.server_logo;

            Client.form_Login.Invoke((MethodInvoker)Client.form_Login.serverOnline);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Uses custom connection information to authenticate and communicate with the server and defines tag.
        /// </summary>
        /// <param name="server">Server information to use.</param>
        /// <param name="user">User connection information to use.</param>
        /// <param name="tag">User defined data associated with the ClientActions class.</param>
        public ServerConnector(ServerConnectorServerInformation server, ServerConnectorUserInformation user, object tag)
        {
            if (Client.config == null)            // NullReferenceException with designer...  This is to prevent errors/crashes.
            {
                return;
            }

            this.actions     = new ClientActions(this, tag);
            this.server_info = server;
            this.user_info   = user;
            this.tag         = tag;

            Client.config.addValueChangedEvent("connector.max_download_kbps", config_changed_max_download_kbps);
            Client.config.addValueChangedEvent("connector.max_upload_kbps", config_changed_max_upload_kbps);
            Client.config.addValueChangedEvent("connector.max_download_enabled", config_changed_max_download_enabled);
            Client.config.addValueChangedEvent("connector.max_upload_enabled", config_changed_max_upload_enabled);

            // Go ahead and fix the upload values.
            config_changed_max_upload_kbps();
            config_changed_max_download_kbps();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Uses custom connection information to authenticate and communicate with the server and defines tag.
        /// </summary>
        /// <param name="server">Server information to use.</param>
        /// <param name="user">User connection information to use.</param>
        /// <param name="tag">User defined data associated with the ClientActions class.</param>
        public ServerConnector(ServerConnectorServerInformation server, ServerConnectorUserInformation user, object tag)
        {
            if(Client.config == null) // NullReferenceException with designer...  This is to prevent errors/crashes.
                return;

            this.actions = new ClientActions(this, tag);
            this.server_info = server;
            this.user_info = user;
            this.tag = tag;

            Client.config.addValueChangedEvent("connector.max_download_kbps", config_changed_max_download_kbps);
            Client.config.addValueChangedEvent("connector.max_upload_kbps", config_changed_max_upload_kbps);
            Client.config.addValueChangedEvent("connector.max_download_enabled", config_changed_max_download_enabled);
            Client.config.addValueChangedEvent("connector.max_upload_enabled", config_changed_max_upload_enabled);

            // Go ahead and fix the upload values.
            config_changed_max_upload_kbps();
            config_changed_max_download_kbps();
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Uses custom connection information to authenticate and communicate with the server.
 /// </summary>
 /// <param name="server">Server information to use.</param>
 /// <param name="user">User connection information to use.</param>
 public ServerConnector(ServerConnectorServerInformation server, ServerConnectorUserInformation user)
     : this(server, user, null)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Uses custom connection information to authenticate and communicate with the server.
 /// </summary>
 /// <param name="server">Server information to use.</param>
 /// <param name="user">User connection information to use.</param>
 public ServerConnector(ServerConnectorServerInformation server, ServerConnectorUserInformation user) : this(server, user, null)
 {
 }