PartyNetwork::GetNetworkDescriptor
Gets the network descriptor for this network.
Syntax
PartyError GetNetworkDescriptor(
PartyNetworkDescriptor* networkDescriptor
)
Parameters
networkDescriptor
PartyNetworkDescriptor*
output
The output network descriptor.
Return value
PartyError
c_partyErrorSuccess
if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via PartyManager::GetErrorMessage().
Remarks
A network descriptor contains all the information required for a device to connect to the network to which the descriptor is associated. PartyManager::SerializeNetworkDescriptor() can be used to get the serialized form of the descriptor, which is safe to exchange over title and platform-specific communication channels. However, the network descriptor provided by this call is not serializable until the asynchronous creation operation associated with this network successfully completes, signaled by a PartyCreateNewNetworkCompletedStateChange with a success result code.
PartyNetworkDescriptors work in tandem with PartyInvitations to facilitate inviting remote users to join the network. First, obtain the network descriptor via GetNetworkDescriptor() and serialize it via PartyManager::SerializeNetworkDescriptor(). Next, create an invitation via CreateInvitation() or query for a preexisting invitation via GetInvitations() and obtain the invitation's identifier from its configuration via PartyInvitation::GetInvitationConfiguration(). Last, include both the serialized network descriptor and the invitation identifier in the payload of the platform-specific invite mechanism. When the remote user receives the invite, they deserialize the network descriptor from the platform-invite payload via PartyManager::DeserializeNetworkDescriptor() and pass the deserialized descriptor to PartyManager::ConnectToNetwork(). After connecting, the remote user joins by authenticating into the network via AuthenticateLocalUser() with the invitation identifier in the platform-invite payload.
Requirements
Header: Party.h
See also
PartyNetwork
PartyCreateNewNetworkCompletedStateChange
PartyManager::CreateNewNetwork
PartyManager::SerializeNetworkDescriptor
PartyManager::DeserializeNetworkDescriptor
PartyManager::ConnectToNetwork
PartyInvitation
PartyNetwork::CreateInvitation
PartyNetwork::GetInvitations
PartyInvitation::GetInvitationConfiguration
PartyNetwork::AuthenticateLocalUser
Comentarios
https://aka.ms/ContentUserFeedback.
Próximamente: A lo largo de 2024 iremos eliminando gradualmente las Cuestiones de GitHub como mecanismo de retroalimentación para el contenido y lo sustituiremos por un nuevo sistema de retroalimentación. Para más información, consulta:Enviar y ver comentarios de