aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Xbox/Sentient/Include/SenClientUser.h
blob: cf3ef0b3e1170a9553d5b00dda8bc17fa38645f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/********************************************************
*                                                       *
* Copyright (C) Microsoft. All rights reserved.         *
*                                                       *
********************************************************/

// Sentient Client User API
//
// Include this to get access to all user-related Sentient features.

#pragma once

#include "SenClientSys.h"


namespace Sentient
{
	//======================//
	//                      //
	//    User Data Types   //
	//                      //
	//======================//

	/// @brief           Roles a user can have in Sentient
	///
	/// @details         Roles are not necessarily mutually exclusive. 
	///				     A single user may be in multiple roles simultaneously.
	///
	enum SenUserRole
	{
		/// The user is a UGC moderator.
		SenUserRole_UGC_Moderator,

		/// The user has been banned from UGC participation.
		SenUserRole_UGC_Banned,
	};


	//======================//
	//                      //
	//    User Functions    //
	//                      //
	//======================//

	/// @brief           Ask Sentient whether a user belongs to the enumerated roles
	///
	/// @param[in]       userIndex
	///                  Local index [0-3] of the user whose role is being checked
	///
	/// @param[in]       role
	///                  Role to check
	///
	/// @param[out]      out_isInRole
	///                  Location to store the output role membership state
	///
	/// @param[in]       userCallback
	///                  If this call returns a success code, the userCallback will be called at the end of the asynchronous process.
	///
	/// @param[in]       userCallbackData
	///                  Data to be passed to the @a userCallback on completion.
	///
	/// @return          Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success.  Specific values include:
	///                  SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first.
	///                  E_POINTER: out_isInRole is NULL.
	///                  E_FAIL: Failed to spawn server call.
	///                  S_OK: Server call spawned successfully.
	///
	HRESULT SenUserIsInRole(
		int userIndex, 
		SenUserRole role,
		bool *out_isInRole, 
		SenSysCompletedCallback userCallback, 
		void *userCallbackData );

	/// @brief           Ask Sentient whether a user belongs to the enumerated roles
	///
	/// @param[in]       xuid
	///                  XUID of user whose role is being checked
	///
	/// @param[in]       role
	///                  Role to check
	///
	/// @param[out]      out_isInRole
	///                  Location to store the output role membership state
	///
	/// @param[in]       userCallback
	///                  If this call returns a success code, the userCallback will be called at the end of the asynchronous process.
	///
	/// @param[in]       userCallbackData
	///                  Data to be passed to the @a userCallback on completion.
	///
	/// @return          Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success.  Specific values include:
	///                  SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first.
	///                  E_POINTER: out_isInRole is NULL.
	///                  E_FAIL: Failed to spawn server call.
	///                  S_OK: Server call spawned successfully.
	///
	HRESULT SenUserIsInRole(
		PlayerUID xuid,
		SenUserRole role,
		bool *out_isInRole, 
		SenSysCompletedCallback userCallback, 
		void *userCallbackData );
}