Пример #1
0
        /// <summary>
        /// Uses a client's stored credentials to verify with Minecraft.net
        /// </summary>
        public bool VerifySession() {
            if (AccessToken == null || ClientToken == null) {
                RaiseError(this, "Credentials are not set!");
                return false;
            }

            var SessionVerifier = new Minecraft_Net_Interaction();
            string[] Response = SessionVerifier.SessionRefresh(AccessToken, ClientToken);

            if (Response[0] == "") {
                RaiseError(this, "Unable to Verify Session!");
                return false;
            }

            RaiseInfo(this, "Credentials verified and refreshed!");

            AccessToken = Response[0];
            ClientToken = Response[1];
            SelectedProfile = "Potato";

            return true;
        }
Пример #2
0
        /// <summary>
        /// Uses a client's stored credentials to verify with Minecraft.net
        /// </summary>
        /// <param name="accessToken">Stored Access Token</param>
        /// <param name="clientToken">Stored Client Token</param>
        public bool VerifySession(string accessToken, string clientToken) {
            AccessToken = accessToken;
            ClientToken = clientToken;

            var SessionVerifier = new Minecraft_Net_Interaction();
            string[] Response = SessionVerifier.SessionRefresh(AccessToken, ClientToken);

            if (Response[0] == "") {
                RaiseError(this, "Unable to Verify Session!");
                return false;
            }

            RaiseInfo(this, "Credentials verified and refreshed!");

            AccessToken = Response[0];
            ClientToken = Response[1];

            return true;
        }