示例#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 MinecraftNetInteraction();
            var 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 MinecraftNetInteraction();
            var 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);
        }