共用方式為


XblMultiplayerSessionGetRoleByName

Fetches the XblMultiplayerRole object by role type name and role name.

Syntax

HRESULT XblMultiplayerSessionGetRoleByName(  
         XblMultiplayerSessionHandle handle,  
         const char* roleTypeName,  
         const char* roleName,  
         const XblMultiplayerRole** role  
)  

Parameters

handle   _In_
Type: XblMultiplayerSessionHandle

Handle to the multiplayer session.

roleTypeName   _In_z_
Type: char*

Name of the role type the role belongs to.

roleName   _In_z_
Type: char*

Name of the role.

role   _Out_
Type: XblMultiplayerRole**

Passes back a pointer to the role object with info about the role. The memory for the pointer will remain valid for the life of the XblMultiplayerSessionHandle object until it is closed. If no such role exists, nullptr will be passed back.

Return value

Type: HRESULT

HRESULT return code for this API operation.

Remarks

Note that newly created sessions will not have role info populated until the XblMultiplayerWriteSessionAsync is called.

Requirements

Header: multiplayer_c.h

Library: Microsoft.Xbox.Services.14x.GDK.C.lib

See also

multiplayer_c