コード例 #1
0
        public static void print_equ8_status_code(equ8.equ8_err err)
        {
            if (err.is_ok())
            {
                return;
            }

            var rc = err.get_full();

            switch (err.get_code())
            {
            case equ8.equ8_err.EQU8_ERR_STATUS_DRIVER_START_FAILURE:
                notify_and_exit("EQU8 failed to install vital component (err: {0})", rc);
                break;

            case equ8.equ8_err.EQU8_ERR_STATUS_DRIVER_REQUIRE_REBOOT:
                notify_and_exit("Your system has a pending reboot which prevents the Anti-Cheat system from initializing. Please restart your computer.");
                break;

            case equ8.equ8_err.EQU8_ERR_STATUS_SYSTEM_IN_TEST_SIGNING_MODE:
                notify_and_exit("For security reasons, EQU8 Anti-Cheat will not run in test-signing mode.");
                break;

            case equ8.equ8_err.EQU8_ERR_STATUS_CLIENT_AGENT_PROTOCOL_MISMATCH:
                notify_and_exit("Parts of the Anti-Cheat solution use different version; please re-run the launcher.");
                break;

            case equ8.equ8_err.EQU8_ERR_STATUS_BAD_API:
                notify_and_exit("Failed to load EQU8 library.");
                break;

            case equ8.equ8_err.EQU8_ERR_STATUS_AGENT_TERMINATED:
                notify_and_exit("An integral Anti-Cheat service was terminated, exiting.");
                break;

            case equ8.equ8_err.EQU8_ERR_STATUS_CORRUPT_CONFIGURATION:
                notify_and_exit("EQU8 detected a corrupt configuration (err: 0x{0:X8}).\n", rc);
                break;

            case equ8.equ8_err.EQU8_ERR_STATUS_AC_CONNECTION_FAILURE:
                notify_and_exit("EQU8 failed to connect to ant-cheat backend (err: 0x{0:X8}).\n", rc);
                break;

            default:
                notify_and_exit("Internal EQU8 error: {0}", rc);
                break;
            }
        }
コード例 #2
0
        static void Main(string[] args)
        {
            //
            // Initialize the EQU8 client library and exit on failure.
            //
            int production_mode = 0;

            equ8.equ8_err err = equ8.client.initialize(@"equ8_client",
                                                       production_mode);
            if (!err.is_ok())
            {
                Console.WriteLine("EQU8 err {0}", err.get_full());
                return;
            }

            string name = "";

            while (String.IsNullOrEmpty(name))
            {
                Console.Write("Enter your name: ");
                name = Console.ReadLine().Trim();
            }
            Console.Write("Server IP address [127.0.0.1]: ");
            string ip = Console.ReadLine().Trim();

            if (0 == ip.Length)
            {
                ip = "127.0.0.1";
            }

            Console.Clear();
            new Client(name, ip).run();
            //
            // Deinitialize the EQU8 client library.
            //
            equ8.client.deinitialize();
        }