示例#1
0
文件: Program.cs 项目: lvyitian1/Alex
        private static async void Test()
        {
            XboxAuthService authService = new XboxAuthService();
            var             authConnect = await authService.StartDeviceAuthConnect();

            Console.WriteLine($"Code: {authConnect.user_code}");

            XboxAuthService.OpenBrowser(authConnect.verification_uri);

            await authService.DoDeviceCodeLogin(Guid.NewGuid().ToString(), authConnect.device_code, CancellationToken.None);
        }
示例#2
0
        public BedrockLoginState(GuiPanoramaSkyBox skyBox, Action <PlayerProfile> readyAction, XboxAuthService xboxAuthService)
        {
            Title = "Bedrock Login";
            AuthenticationService = xboxAuthService;
            _backgroundSkyBox     = skyBox;
            Background            = new GuiTexture2D(_backgroundSkyBox, TextureRepeatMode.Stretch);
            BackgroundOverlay     = Color.Transparent;
            Ready = readyAction;

            CanUseClipboard = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);

            ConnectResponse = AuthenticationService.StartDeviceAuthConnect().Result;

            Initialize();
        }