Beispiel #1
0
        /// <summary>
        /// Executes a console command.
        /// </summary>
        /// <param name="command">Console command to send</param>
        /// <returns>Command return value as string.</returns>
        public String ExecuteCommand(CryConsoleCommand command)
        {
            try
            {
                XmlRPCMethod method = new XmlRPCMethod(Connection, command.Name);
                method.KeepAlive = true;

                return(method.Call <String>(new ArrayList(command.Params)));
            }
            catch (Exception)
            {
                return("");
            }
        }
Beispiel #2
0
        /// <summary>
        /// Requests a challenge from the service.
        /// </summary>
        /// <returns>Challenge value or 0 if failed.</returns>
        public Int64 Challenge()
        {
            try
            {
                XmlRPCMethod method = new XmlRPCMethod(Connection, "challenge");
                method.KeepAlive = true;

                return(method.Call <Int64>(null));
            }
            catch (Exception)
            {
                return(0);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Sends an authentication to the service.
        /// </summary>
        /// <param name="auth">Auth string</param>
        /// <returns>True if authentication succeeded.</returns>
        public bool Authenticate(String auth)
        {
            try
            {
                XmlRPCMethod method = new XmlRPCMethod(Connection, "authenticate");
                method.KeepAlive = true;

                return(method.Call <bool>(new ArrayList()
                {
                    auth
                }));
            }
            catch (Exception)
            {
                return(false);
            }
        }