Esempio n. 1
0
        public void Initialize()
        {
            // Initalize the base config
            config           = new QuizDuellConfig();
            config.Host      = "qkgermany.feomedia.se";
            config.Plattform = QuizDuellPlattform.ANDROID;
            config.UserAgent = "Quizduell A 1.3.2";
            config.Cookies   = new CookieContainer();

            // MD5-SALT - Different per Country/Plattform
            // qkgermany: SQ2zgOTmQc8KXmBP
            config.Salt = "SQ2zgOTmQc8KXmBP";

            // NOTE: Quizduell uses different HMAC Keys for different locales.
            // IOS: 7GprrSCirEToJjG5
            // APK: irETGpoJjG57rrSC
            if (config.Plattform == QuizDuellPlattform.ANDROID)
            {
                config.Key = "irETGpoJjG57rrSC";
            }
            if (config.Plattform == QuizDuellPlattform.IOS)
            {
                config.Key = "7GprrSCirEToJjG5";
            }

            target = new QuizDuellApi(config);
        }
Esempio n. 2
0
        private bool excludeFriends        = true; // TODO: add functionality to exclude the users on your friend list from gameplay

        public QuizDuellBot()
        {
            Console.WriteLine("Loading Config File.");
            //config = QuizDuellConfig.LoadFromFile("config.json");
            //config = QuizDuellConfig.LoadFromFile("ios-config.json");
            config = QuizDuellConfig.LoadFromFile("apk-config.json");
            client = new QuizDuellApi(config);
            result = new JObject();
        }
Esempio n. 3
0
        public void GameStart()
        {
            // Do we have an auth cookie?
            // Try to login with the authentication Cookie
            result = client.CurrentUserGames();
            Debug.WriteLine("Current User Games Response: ");
            Debug.Write(result.ToString());
            Debug.WriteLine("");

            // Did the cookie login work?
            if (result["access"] != null && (bool)result["access"] == false)
            {
                result = client.CreateUser(config.User, config.Pass, config.Mail);
                Debug.WriteLine("Create User Response: ");
                Debug.Write(result.ToString());
                Debug.WriteLine("");

                result = client.LoginUser(config.User, config.Pass);
                Debug.WriteLine("Login User Response: ");
                Debug.Write(result.ToString());
                Debug.WriteLine("");
            }
            else
            {
                result["logged_in"] = true;
            }

            /// Returns the following JSON structure on success:
            /// {
            /// "logged_in": true,
            /// "settings": {...},
            /// "user": {...}
            /// }
            if (result["logged_in"] != null && (bool)result["logged_in"] == true)
            {
                // TODO: We are logged in so Start the GameLoop - Create a new Thread
                Console.WriteLine("Successfully logged in!");
                GameLoop();

                // TODO: We are done, write the updated Auth Cookie / Config to disk
                QuizDuellConfig.SaveToFile(config);
            }

            // TODO: Remove this Placeholder
            Console.WriteLine("We are done, press any key to exit");
            Console.ReadLine();
        }