Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
pairing_flow.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <cstdint>
9#include <string>
10#include <string_view>
11
12namespace app {
13
17 enum class PairingStage {
18 idle,
19 pin_ready,
21 paired,
22 failed,
23 };
24
28 struct PairingDraft {
29 std::string targetAddress;
30 uint16_t targetPort;
31 std::string generatedPin;
33 std::string statusMessage;
34 };
35
44 PairingDraft create_pairing_draft(std::string_view targetAddress, uint16_t targetPort, std::string generatedPin);
45
52 bool is_valid_pairing_pin(std::string_view pin);
53
54} // namespace app
@ paired
The client is paired and can issue authenticated requests.
@ failed
The latest app-list request failed.
@ idle
No app-list request is active and no fresh result is pending.
PairingDraft create_pairing_draft(std::string_view targetAddress, uint16_t targetPort, std::string generatedPin)
Create a fresh pairing draft for the provided host.
Definition pairing_flow.cpp:13
bool is_valid_pairing_pin(std::string_view pin)
Return whether a PIN string is a valid Moonlight-style four-digit PIN.
Definition pairing_flow.cpp:24
PairingStage
Reducer-driven stages for the manual pairing shell flow.
Definition pairing_flow.h:17
@ pin_ready
A PIN is available and ready to display to the user.
@ in_progress
A pairing request is currently running.
Controller-friendly state for a client-generated pairing PIN.
Definition pairing_flow.h:28
std::string statusMessage
User-visible progress or error message for the pairing flow.
Definition pairing_flow.h:33
PairingStage stage
Current stage of the reducer-driven pairing flow.
Definition pairing_flow.h:32
std::string targetAddress
Host address currently targeted by pairing.
Definition pairing_flow.h:29
uint16_t targetPort
Effective HTTP port currently targeted by pairing.
Definition pairing_flow.h:30
std::string generatedPin
Client-generated PIN shown to the user.
Definition pairing_flow.h:31