Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
pairing_flow.h File Reference

Declares the host pairing flow. More...

#include <cstdint>
#include <string>
#include <string_view>
Include dependency graph for pairing_flow.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  app::PairingDraft
 Controller-friendly state for a client-generated pairing PIN. More...
 

Enumerations

enum class  app::PairingStage {
  idle , pin_ready , in_progress , paired ,
  failed
}
 Reducer-driven stages for the manual pairing shell flow. More...
 

Functions

PairingDraft app::create_pairing_draft (std::string_view targetAddress, uint16_t targetPort, std::string generatedPin)
 Create a fresh pairing draft for the provided host.
 
bool app::is_valid_pairing_pin (std::string_view pin)
 Return whether a PIN string is a valid Moonlight-style four-digit PIN.
 

Detailed Description

Declares the host pairing flow.

Enumeration Type Documentation

◆ PairingStage

enum class app::PairingStage
strong

Reducer-driven stages for the manual pairing shell flow.

Enumerator
idle 

Pairing has not started yet.

pin_ready 

A PIN is available and ready to display to the user.

in_progress 

A pairing request is currently running.

paired 

Pairing completed successfully.

failed 

Pairing failed and an error message is available.

Function Documentation

◆ create_pairing_draft()

PairingDraft app::create_pairing_draft ( std::string_view targetAddress,
uint16_t targetPort,
std::string generatedPin )

Create a fresh pairing draft for the provided host.

Parameters
targetAddressHost address being paired.
targetPortEffective host port being paired.
generatedPinClient-generated PIN to show to the user.
Returns
Initialized pairing draft.

◆ is_valid_pairing_pin()

bool app::is_valid_pairing_pin ( std::string_view pin)

Return whether a PIN string is a valid Moonlight-style four-digit PIN.

Parameters
pinCandidate PIN string.
Returns
true when the PIN contains exactly four digits.