aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Xbox/Sentient/Include/SenClientMain.h
blob: 416d4deafb5145ebc3fadee5f3f77d4ad93fdadc (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
/********************************************************
*                                                       *
* Copyright (C) Microsoft. All rights reserved.         *
*                                                       *
********************************************************/

// Sentient Client Main API
//
// Include this to get access to all core Sentient features.

#pragma once

#include "SenClientTypes.h"


namespace Sentient
{
	//=======================//
	//                       //
	//    Main Data Types    //
	//                       //
	//=======================//

	// None at the moment.


	//======================//
	//                      //
	//    Main Functions    //
	//                      //
	//======================//

	/// @brief           Initialize and start Sentient.
	///
	/// @param[in]       titleID
	///                  Tells Sentient what our titleID is.
	///
	/// @return          Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success.  Specific values include:
	///                  E_FAIL (and other E_* codes): Failed to initialize.
	///                  S_OK: Initialized successfully.
	///
	/// @details         Call this on startup to set up networking system and initialize internal buffers.
	///
	HRESULT SentientInitialize( 
		SenSysTitleID titleID );

	/// @brief           Update Sentient's internal state.
	///
	/// @return          Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine overall success.
	///                  The return code contains information about the status of the connection to sentient, including:
	///                  S_OK: we have a working connection to the Sentient server.
	///                  SENTIENT_S_NOT_SIGNED_IN_TO_LIVE: no live enabled user user is currently signed in to live.
	///                  SENTIENT_S_INITIALIZING_CONNECTION: a user has signed in, and we have started first connection attempt, but we have neither succeeded nor failed yet.
	///                  SENTIENT_S_SERVER_CONNECTION_FAILED: a connection attempt has failed, or that an existing connection was lost.
	///
	/// @details         Call this every frame to handle network message pumping and to trigger asynchronous callbacks on completed ( or failed ) tasks.
	///
	HRESULT SentientUpdate();

	/// @brief           Stop and uninitialize Sentient.
	///
	/// @return          Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success.  Specific values include:
	///                  E_FAIL (and other E_* codes): Failed to shut down.
	///                  S_OK: Shut down successfully.
	///                  Note that one should consider the library shut down even if an error code is returned.
	///
	/// @details         Call this on app/game shutdown. (not necessary on X360)
	///
	HRESULT SentientShutdown();

	/// @brief           Cancel an asynchronous task.
	///
	/// @param[in]       task
	///                  The task to cancel.
	///
	/// @return          Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success.  Specific values include:
	///                  E_FAIL (and other E_* codes): Failed to cancel task.
	///                  S_OK: Task cancelled successfully.
	///
	/// @detail          Call this to immediately cancel any task that exposes a SenHandle.
	///                  The completion callback will be invoked on a successful cancel.
	///
	HRESULT SentientCancel( SenHandle task );

} // namespace Sentient