aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Xbox/Social/SocialManager.cpp
blob: b89fda7094b46a23074148b6538c01766d0581f2 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
//
// Class to handle and manage integration with social networks.
// 4J Studios Ltd, 2011.
// Andy West
//


#include "stdafx.h"
#include "SocialManager.h"
#include <assert.h>
#include <xgraphics.h>
#include "..\Sentient\SentientManager.h"

///////////////////////////////////////////////////////////////////////////
// Constants.
///////////////////////////////////////////////////////////////////////////

// Table of SDK IDs for the social networks.
static const DWORD		kaSocialNetworkIDS[ eNumSocialNetworks ] =
{
	2,					// eFacebook
};

// WESTY : Not sure if we even need to get social access key!
/*
// Table of social network permissions that we will required to post.
static const LPCWSTR	kaSocialNetworkRequiredPermissions[ eNumSocialNetworks ] = 
{
	L"publish_stream",		// eFacebook
};


// Default size to use for social network access key text.
static const DWORD		kDefaultAccessKeyTextSize = 64;
*/


///////////////////////////////////////////////////////////////////////////
// Static members intialisation.
///////////////////////////////////////////////////////////////////////////

// Initialise static instance pointer.
CSocialManager* CSocialManager::m_pInstance = 0;




///////////////////////////////////////////////////////////////////////////
// Class functions.
///////////////////////////////////////////////////////////////////////////

// Get singleton instance.
CSocialManager* CSocialManager::Instance()
{
	if ( m_pInstance == 0 )			// Is this the first time?
	{
		m_pInstance = new CSocialManager;		// Create the singleton instance.
	}
	return m_pInstance;
}

// Default constructor.
CSocialManager::CSocialManager()
{
	m_eCurrState = eStateUnitialised;
	m_dwSocialPostingCapability = 0;

// WESTY : Not sure if we even need to get social access key!
/*
	m_pAccessKeyText = nullptr; 
	m_dwAccessKeyTextSize = 0;
*/

	m_pMainImageBuffer = nullptr;
	m_dwMainImageBufferSize = 0;

	m_PostPreviewImage.pBytes = nullptr;
	m_dwCurrRequestUser = -1;

	ZeroMemory(m_wchTitleA,sizeof(WCHAR)*MAX_SOCIALPOST_CAPTION);
	ZeroMemory(m_wchCaptionA,sizeof(WCHAR)*MAX_SOCIALPOST_CAPTION);
	ZeroMemory(m_wchDescA,sizeof(WCHAR)*MAX_SOCIALPOST_DESC);

}


// To be called once during game init.
void CSocialManager::Initialise()
{
	assert( m_eCurrState == eStateUnitialised );
	m_eCurrState = eStateReady;

}


void CSocialManager::Tick()
{
	switch( m_eCurrState )
	{
		case eStateUnitialised:
			// Nothing to do.
			break;

		case eStateReady:
			// Nothing to do.
			break;

		case eStateGetPostingCapability:
			{
				// Poll for result.
				DWORD dwResult = XGetOverlappedResult( &( m_Overlapped ), &( m_dwOverlappedResultCode ), false );

				switch( dwResult )
				{
					case ERROR_SUCCESS:
						app.DebugPrintf( "XSocialGetCapabilities - SUCCESS - FLAGS = %d\n", m_dwSocialPostingCapability );
						m_eCurrState = eStateReady;
						break;

					case ERROR_IO_INCOMPLETE:
						// Still on going.
						break;

					default:
						// Some kind of error occured.
						app.DebugPrintf( "XSocialGetCapabilities - FAILED\n", m_dwSocialPostingCapability );
						// WESTY: TO DO: Get error code, and possibly extened error code to figure out what went wrong.
						//assert( false );
						m_eCurrState = eStateReady;
						break;
				}
			}
			break;
		

		case eStatePostingImage:
			{ 
				// Poll for result.
				DWORD dwResult = XGetOverlappedResult( &( m_Overlapped ), &( m_dwOverlappedResultCode ), false );

				switch( dwResult )
				{
					case ERROR_SUCCESS:
						TelemetryManager->RecordMediaShareUpload(m_dwCurrRequestUser, ESen_MediaDestination_Facebook, eSen_MediaType_Picture);

						app.DebugPrintf( "Facebook image post success!!!\n" );
						DestroyMainPostImage();
						DestroyPreviewPostImage();

						// Award for successful post.
						ProfileManager.Award( m_dwCurrRequestUser, eAward_socialPost );
						
						m_eCurrState = eStateReady;
						break;

					case ERROR_IO_INCOMPLETE:
						// Still on going.
						break;

					default:
						// For some reason, the operation did not complete.
						// SDK docs give no indication why this may be, but could be user cancelled the operation.
						app.DebugPrintf( "Facebook image post failure!!!\n" );
						DestroyMainPostImage();
						DestroyPreviewPostImage();
						m_eCurrState = eStateReady;
						break;
				}
			}
			break;

		case eStatePostingLink:
			{ 
				// Poll for result.
				DWORD dwResult = XGetOverlappedResult( &( m_Overlapped ), &( m_dwOverlappedResultCode ), false );

				switch( dwResult )
				{
					case ERROR_SUCCESS:
						app.DebugPrintf( "Facebook link post success!!!\n" );

						// Award for successful post.
						ProfileManager.Award( m_dwCurrRequestUser, eAward_socialPost );

						m_eCurrState = eStateReady;
						break;

					case ERROR_IO_INCOMPLETE:
						// Still on going.
						break;

					default:
						// For some reason, the operation did not complete.
						// SDK docs give no indication why this may be, but could be user cancelled the operation.
						app.DebugPrintf( "Facebook link post failure!!!\n" );
						m_eCurrState = eStateReady;
						break;
				}
			}
			break;

		default:
			// Unhandled state!
			assert( false );
			break;
	}
}


// Find out if we are allowed to post to social networks.
bool CSocialManager::RefreshPostingCapability()
{
	bool bResult = false;

	if ( m_eCurrState != eStateReady )
	{
		return bResult;
	}

	// Test for titles ability to post to social networks.

	// Test for titles ability to post to social networks.

	XMemSet( &m_Overlapped, 0, sizeof(XOVERLAPPED) );

	DWORD dwResult = XSocialGetCapabilities( &( m_dwSocialPostingCapability ), &( m_Overlapped ) );
	
	switch( dwResult )
	{
		case ERROR_IO_PENDING:
			bResult = true;
			m_eCurrState = eStateGetPostingCapability;
			break;

		case ERROR_FUNCTION_FAILED:
			{
				// Hmm ... why would it fail, and what are we meant to do about it?
				DWORD dwExtendedError = XGetOverlappedExtendedError( &( m_Overlapped ) );
				app.DebugPrintf( "XSocialGetCapabilities ASYNC : FAILED : Extended Error %d\n", dwExtendedError );
				//assert( false );
			}
			break;

		default:
			{
				// Should never get in here.
				DWORD dwExtendedError = XGetOverlappedExtendedError( &( m_Overlapped ) );
				app.DebugPrintf( "XSocialGetCapabilities ASYNC : FAILED : Extended Error %d\n", dwExtendedError );
				//assert( false );
			}
			break;
	}

	return bResult;
}



bool CSocialManager::IsTitleAllowedToPostAnything()
{
	assert( m_eCurrState != eStateUnitialised );

	return( m_dwSocialPostingCapability != 0 );
}


bool CSocialManager::IsTitleAllowedToPostImages()
{
	assert( m_eCurrState != eStateUnitialised );

	return( ( m_dwSocialPostingCapability & XSOCIAL_CAPABILITY_POSTIMAGE ) != 0 );
}


bool CSocialManager::IsTitleAllowedToPostLinks()
{
	assert( m_eCurrState != eStateUnitialised );

	return( ( m_dwSocialPostingCapability & XSOCIAL_CAPABILITY_POSTLINK ) != 0 );
}

bool CSocialManager::AreAllUsersAllowedToPostImages()
{
	// catch no user being signed in to LIVE here too (or a local disconnect)
	BOOL bUserAllowedToPost=FALSE;

	for(int i=0;i<XUSER_MAX_COUNT;i++)
	{
		if(ProfileManager.IsSignedInLive(i)) 
		{
			XUserCheckPrivilege(i,XPRIVILEGE_SOCIAL_NETWORK_SHARING ,&bUserAllowedToPost);
			if(bUserAllowedToPost==FALSE) 
			{
				return false;
			}
		}
	}
	return bUserAllowedToPost?true:false;
}



// Ensure this is only done after posting is complete.
void CSocialManager::DestroyMainPostImage()
{
	delete [] m_PostImageParams.pFullImage;
	m_PostImageParams.pFullImage=nullptr;
	m_dwMainImageBufferSize=0;
 }

void CSocialManager::DestroyPreviewPostImage()
{
	XPhysicalFree( (void *)m_PostPreviewImage.pBytes );
	m_PostPreviewImage.pBytes = nullptr;
}

void CSocialManager::SetSocialPostText(LPCWSTR pwchTitle, LPCWSTR pwchCaption, LPCWSTR pwchDesc)
{
	wstring wTemp;

	ZeroMemory(m_wchTitleA,sizeof(WCHAR)*(MAX_SOCIALPOST_CAPTION+1));
	ZeroMemory(m_wchCaptionA,sizeof(WCHAR)*(MAX_SOCIALPOST_CAPTION+1));
	ZeroMemory(m_wchDescA,sizeof(WCHAR)*(MAX_SOCIALPOST_DESC+1));
	wTemp = pwchTitle;
	memcpy(m_wchTitleA,wTemp.c_str(),wTemp.length()*sizeof(WCHAR));
	wTemp = pwchCaption;
	memcpy(m_wchCaptionA,wTemp.c_str(),wTemp.length()*sizeof(WCHAR));
	wTemp = pwchDesc;
	memcpy(m_wchDescA,wTemp.c_str(),wTemp.length()*sizeof(WCHAR));
}

bool CSocialManager::PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect )
{
	if ( m_eCurrState != eStateReady )
	{
		return false;
	}

	// Ensure title is actually allowed to post links ... should always be the case, but we have to check for TCR.
	if ( IsTitleAllowedToPostLinks() == false )
	{
		//assert( false );
		return false;
	}
	
	// Ensure dwUserIndex is sensible.
	if ( dwUserIndex > 3 )
	{
		//assert( false );
		return false;
	}

	// Store user index for award on successful post.
	m_dwCurrRequestUser = dwUserIndex;

	// Required for kinect only.
	DWORD dwUserTrackingIndex = 0;
	if ( bUsingKinect )
	{
		// WESTY - Will need a method to get this.
		dwUserTrackingIndex = 0;
	}

	bool bResult = false;

//	CreatePreviewImage();

	// SDK social post flags....
	// XSOCIAL_POST_USERGENERATEDCONTENT
	// XSOCIAL_POST_KINECTCONTENT
	// XSOCIAL_POST_GAMECONTENT
	// XSOCIAL_POST_ACHIEVEMENTCONTENT
	// XSOCIAL_POST_MEDIACONTENT

	// 4J Stu - MessageText is not a member of the struct in the header of the latest XDK 20871.6
	// The documentation hasn't changed though...
	//m_PostLinkParams.MessageText = L"This is a test link post.";
	m_PostLinkParams.TitleText = L"Test Title";
	m_PostLinkParams.TitleURL = L"http:\\www.4jstudios.com";
	m_PostLinkParams.PictureCaption = L"Test Picture Caption";
	m_PostLinkParams.PictureDescription = L"Test Picture Description";
	m_PostLinkParams.PictureURL = L"http:\\www.4jstudios.com";
	m_PostLinkParams.PreviewImage = m_PostPreviewImage;
	m_PostLinkParams.Flags = ( XSOCIAL_POST_GAMECONTENT | XSOCIAL_POST_USERGENERATEDCONTENT );	// WESTY: Need to set correct flags for content type.
	m_PostLinkParams.Size = sizeof( m_PostLinkParams );
	

	// BEGIN: Asyncronous function call version
	DWORD dwResult;

	XMemSet( &m_Overlapped, 0, sizeof(XOVERLAPPED) );

	if ( bUsingKinect )
	{
		dwResult = XShowNuiSocialNetworkLinkPostUI( dwUserTrackingIndex, dwUserIndex, &( m_PostLinkParams ), &( m_Overlapped ) );
	}
	else // using normal controller UI
	{
		dwResult = XShowSocialNetworkLinkPostUI( dwUserIndex, &( m_PostLinkParams ), &( m_Overlapped ) );
	}
	
	switch( dwResult )
	{
		case ERROR_IO_PENDING:
			bResult = true;
			m_eCurrState = eStatePostingLink;
			break;

		case ERROR_FUNCTION_FAILED:
			// Hmm ... why would it fail, and what are we meant to do about it? Get extended error code!?
			DestroyMainPostImage();
			DestroyPreviewPostImage();
			//assert( false );
			break;

		default:
			// Should never get in here.
			DestroyMainPostImage();
			DestroyPreviewPostImage();
			assert( false );
			break;
	}
	// END: Asyncronous function call version
	
	return bResult;
}

bool CSocialManager::PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect )
{
	if ( m_eCurrState != eStateReady )
	{
		return false;
	}

	// Ensure title is actually allowed to post images ... should always be the case, but we have to check for TCR.
	if ( IsTitleAllowedToPostImages() == false )
	{
		//assert( false );
		return false;
	}
	
	// Ensure dwUserIndex is sensible.
	if ( dwUserIndex > 3 )
	{
		//assert( false );
		return false;
	}

	// Store user index for award on successful post.
	m_dwCurrRequestUser = dwUserIndex;

	// Required for kinect only.
	DWORD dwUserTrackingIndex = 0;
	if ( bUsingKinect )
	{
		// WESTY - Will need a method to get this.
		dwUserTrackingIndex = 0;
	}

	bool bResult = false;

	PBYTE pbData=nullptr;
	DWORD dwDataSize;

	app.GetScreenshot(dwUserIndex,&pbData,&dwDataSize);
	app.GetPreviewImage(dwUserIndex,&m_PostPreviewImage);

	// SDK social post flags....
	// XSOCIAL_POST_USERGENERATEDCONTENT
	// XSOCIAL_POST_KINECTCONTENT
	// XSOCIAL_POST_GAMECONTENT
	// XSOCIAL_POST_ACHIEVEMENTCONTENT
	// XSOCIAL_POST_MEDIACONTENT

	// 4J Stu - MessageText is not a member of the struct in the header of the latest XDK 20871.6
	// The documentation hasn't changed though...
	//m_PostImageParams.MessageText = L"This is a test image post.";
	m_PostImageParams.TitleText = m_wchTitleA;
	m_PostImageParams.PictureCaption = m_wchCaptionA;
	m_PostImageParams.PictureDescription = m_wchDescA;
	m_PostImageParams.PreviewImage = m_PostPreviewImage;
	m_PostImageParams.Flags = ( XSOCIAL_POST_GAMECONTENT | XSOCIAL_POST_USERGENERATEDCONTENT );	// WESTY: Need to set correct flags for content type.
	m_PostImageParams.pFullImage = pbData;//m_pMainImageBuffer;
	m_PostImageParams.FullImageByteCount = dwDataSize;//m_dwMainImageBufferSize;
	m_PostImageParams.Size = sizeof( m_PostImageParams );

	// BEGIN: Asyncronous function call version
	DWORD dwResult;

	XMemSet( &m_Overlapped, 0, sizeof(XOVERLAPPED) );

	if ( bUsingKinect )
	{
		dwResult = XShowNuiSocialNetworkImagePostUI( dwUserTrackingIndex, dwUserIndex, &( m_PostImageParams ), &( m_Overlapped ) );
	}
	else // using normal controller UI
	{
		dwResult = XShowSocialNetworkImagePostUI( dwUserIndex, &( m_PostImageParams ), &( m_Overlapped ) );
	}
	
	switch( dwResult )
	{
		case ERROR_IO_PENDING:
			bResult = true;
			m_eCurrState = eStatePostingImage;
			break;

		case ERROR_FUNCTION_FAILED:
			// Hmm ... why would it fail, and what are we meant to do about it? Get extended error code!?
			DestroyMainPostImage();
			DestroyPreviewPostImage();
			//assert( false );
			break;

		default:
			// Should never get in here.
			DestroyMainPostImage();
			DestroyPreviewPostImage();
			assert( false );
			break;
	}
	// END: Asyncronous function call version

	
	return bResult;
}

// WESTY : Not sure if we even need to get social access key!
/*
// It is unclear from the sdk docs what this is actually used for.
// So far we have only created a syncronous version of this function, and the xbox functionality does not seem to work yet!
bool CSocialManager::GetSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect, DWORD dwUserTrackingIndex, bool bShowNetworkSignin )
{
	bool bReturn = false;

	DWORD dwResult;

	// Ensure that we free any previously used access key buffer.
	if ( m_pAccessKeyText != nullptr )
	{
		delete [] m_pAccessKeyText;
		m_pAccessKeyText = nullptr;
	}

	// Get social network ID and permissions.
	DWORD dwSocialNetworkID = kaSocialNetworkIDS[ eSocialNetwork ];
	LPCWSTR	pRequiredPermissions = kaSocialNetworkRequiredPermissions[ eSocialNetwork ]; 

	// Allocate buffer for social network access key text.
	m_dwAccessKeyTextSize = kDefaultAccessKeyTextSize;
	m_pAccessKeyText = new wchar_t [ m_dwAccessKeyTextSize ];

	if ( bShowNetworkSignin )
	{
		if ( bUsingKinect )
		{
			dwResult = XShowNuiSocialGetUserToken( dwUserTrackingIndex, dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );

			// If buffer for key text was not large enough, reallocate buffer that is large enough and try again.
			if ( dwResult == ERROR_INSUFFICIENT_BUFFER )
			{
				delete [] m_pAccessKeyText;
				m_pAccessKeyText = new wchar_t[ m_dwAccessKeyTextSize ];
				dwResult = XShowNuiSocialGetUserToken( dwUserTrackingIndex, dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );
			}
		}
		else // using standard controller interface.
		{
			dwResult = XShowSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );

			// If buffer for key text was not large enough, reallocate buffer that is large enough and try again.
			if ( dwResult == ERROR_INSUFFICIENT_BUFFER )
			{
				delete [] m_pAccessKeyText;
				m_pAccessKeyText = new wchar_t[ m_dwAccessKeyTextSize ];
				dwResult = XShowSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );
			}
		}
	}
	else // we are trying to obtain cached user access key.
	{
		dwResult = XSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );

		// If buffer for key text was not large enough, reallocate buffer that is large enough and try again.
		if ( dwResult == ERROR_INSUFFICIENT_BUFFER )
		{
			delete [] m_pAccessKeyText;
			m_pAccessKeyText = new wchar_t[ m_dwAccessKeyTextSize ];
			dwResult = XSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );
		}
	}

	// Check result.
	if ( dwResult != ERROR_SUCCESS )
	{
		switch( dwResult )
		{
			// ERROR_OUT_MEMORY does not seem to exist, despite being mentioned in the XDK docs.
			//case ERROR_OUT_MEMORY:			
			//	// Not much we can do about this?!
			//	assert( false );
			//	break;

			case ERROR_INVALID_PARAMETER:
				// dwUserIndex or dwSocialNetworkID are incorrect!
				assert( false );
				break;

			case ERROR_ACCESS_DENIED:
				// Either no user is signed in, or title not allowed to use social posting (the latter should never occur!).
				break;

			case ERROR_FUNCTION_FAILED:
				// dwTrackingID is not valid. Kinect only. Not sure what we would do about this one?
				assert( false );
				break;

			case ERROR_INSUFFICIENT_BUFFER:
				// This should not be possible, we already resized the buffer and retried if it was too small.
				assert( false );
				break;

			case ERROR_GRACEFUL_DISCONNECT:
				// User disconnected before process was complete.
				break;

			case ERROR_CANCELLED:
				// User cancelled the request.
				break;

			case ERROR_BAD_NET_RESP:
				// Error in access, or some kind of network related error.
				// Need to display warning??
				assert( false );
				break;

			default:
				// Should never get here.
				assert( false );
				break;
		}
	}
	else // success
	{
		bReturn = true;
	}

	return bReturn;
}
*/

// WESTY : Not sure if we even need to get social access key!
/*

// It is unclear from the sdk docs what this is actually used for.
// So far we have only created a syncronous version of this function, and the xbox functionality does not seem to work yet!
bool CSocialManager::ObtainSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect )
{
	if ( m_eCurrState != eStateReady )
	{
		return false;
	}
	
	// Ensure dwUserIndex is sensible.
	if ( dwUserIndex > 3 )
	{
		assert( false );
		return false;
	}

	// Kinect user tracking index.
	DWORD dwUserTrackingIndex = 0;
	if ( bUsingKinect )
	{
		// WESTY - Will need a method to get this.
		dwUserTrackingIndex = 0;
	}
	
	// Try first of all to obtain cached user key.
	bool bSocialNetworkAccessKeyAvailable = GetSocialNetworkAccessKey( eSocialNetwork, dwUserIndex, bUsingKinect, dwUserTrackingIndex, false );

	if ( bSocialNetworkAccessKeyAvailable == false )
	{
		// No chached user key, so we will try the UI version to signin to social network?
		bSocialNetworkAccessKeyAvailable = GetSocialNetworkAccessKey( eSocialNetwork, dwUserIndex, bUsingKinect, dwUserTrackingIndex, true );
	}

	return bSocialNetworkAccessKeyAvailable;
}
*/