File size: 1,690 Bytes
24b81cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

//! BiosCheckUpdateResult represent result of the PromptUpdateAsync request.
class BiosCheckUpdateResult
{
	//! Is new update available?
	bool	m_IsUpdate;
	
	//! Is update mandatory?
	bool	m_IsMandatory;
};

class BiosPackageService
{
	//! Async check if exist new update
	/*!
		@return EBiosError indicating if the async operation is pending.
	*/
	proto native EBiosError CheckUpdateAsync();
	
	
	//! Prompt user to accept update with system GUI
	/*!
		@return EBiosError indicating if the async operation is pending.
	*/
	proto native EBiosError PromptUpdateAsync();
	
	
	//! Show store for current title (system GUI). Only on Xbox.
	/*!
		@return EBiosError indicating if the async operation is pending.
	*/
	proto native EBiosError ShowStoreAsync();
	
	//! Callback function for CheckUpdateAsync()
	/*!
		@param checkUpdateResult contain information about availability of new update and if it is mandatory.
		@param error indicating success or fail of the async operation.
	*/
	void OnCheckUpdate(BiosCheckUpdateResult checkUpdateResult, EBiosError error)
	{
		if ( !error && ( checkUpdateResult.m_IsUpdate || checkUpdateResult.m_IsMandatory ) )
		{
			OnlineServices.PromptUpdate();
		}
	}
	
	
	//! Callback function for PromptUpdateAsync()
	/*!
		Show system UI with update.
		On Xbox, game suspend after accept update.

		@param error indicating success or fail of the async operation.
	*/
	void OnPromptUpdate(EBiosError error)
	{
		OnlineServices.ErrorCaught( error );
	}
	
	
	//! Callback function for ShowStoreAsync()
	/*!
		@param error indicating success or fail of the async operation.
	*/
	void OnShowStore(EBiosError error)
	{
		OnlineServices.ErrorCaught( error );
	}
	
};