Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.UIDataProvider_OnlineProfileSettings


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
/**
 * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved.
 */

/**
 * This class is responsible for mapping properties in an OnlineGameSettings
 * object to something that the UI system can consume.
 */
class UIDataProvider_OnlineProfileSettings extends UIDataProvider_OnlinePlayerStorage
	config(Game)
	native(inherit)
	dependson(OnlineSubsystem)
	transient;

 /**
  * Reads the data
  *
  * @param PlayerInterface is the OnlinePlayerInterface used
  * @param LocalUserNum the user that we are reading the data for
  * @param DeviceId device for local read of player data (-1 for no device)
  * @param PlayerStorage the object to copy the results to and contains the list of items to read
  *
  * @return true if the call succeeds, false otherwise
  */
 function bool ReadData(OnlinePlayerInterface PlayerInterface, byte LocalUserNum, int DeviceId, OnlinePlayerStorage PlayerStorage)
 {
 	return PlayerInterface.ReadProfileSettings(LocalUserNum, OnlineProfileSettings(PlayerStorage));
 }
 
 /**
  * Writes the online  data for a given local user to the online data store
  *
  * @param PlayerInterface is the OnlinePlayerInterface used
  * @param LocalUserNum the user that we are writing the data for
  * @param DeviceId device for local write of player data (-1 for no device)
  * @param PlayerStorage the object that contains the list of items to write
  *
  * @return true if the call succeeds, false otherwise
  */
 function bool WriteData(OnlinePlayerInterface PlayerInterface, byte LocalUserNum, int DeviceId, OnlinePlayerStorage PlayerStorage)
 {
 	return PlayerInterface.WriteProfileSettings(LocalUserNum,OnlineProfileSettings(PlayerStorage));
 }
 
/**
 * Fetches the requested object from the online layer's cache
 *
 * @param PlayerInterface is the OnlinePlayerInterface used
 * @param LocalUserNum the user that we are writing the data for
 * @param PlayerStorage the object that contains the list of items to write
 *
 * @return true if the call succeeds, false otherwise
 */
function bool GetData(OnlinePlayerInterface PlayerInterface, byte LocalUserNum)
{
	local OnlineProfileSettings CachedProfile;

	CachedProfile = PlayerInterface.GetProfileSettings(LocalUserNum);
	if (CachedProfile != None)
	{
		Profile = CachedProfile;
		// If there is one in the cache, the read will return immediately
		return PlayerInterface.ReadProfileSettings(LocalUserNum,OnlineProfileSettings(Profile));
	}
	return false;
}

/**
 * Sets the delegate used to notify the gameplay code that the last read request has completed 
 *
 * @param PlayerInterface is the OnlinePlayerInterface used
 * @param LocalUserNum which user to watch for read complete notifications
 */
function AddReadCompleteDelegate(OnlinePlayerInterface PlayerInterface, byte LocalUserNum)
{
	PlayerInterface.AddReadProfileSettingsCompleteDelegate(LocalUserNum,OnReadStorageComplete);
}
 
/**
 * Clears the delegate used to notify the gameplay code that the last read request has completed 
 *
 * @param PlayerInterface is the OnlinePlayerInterface used
 * @param LocalUserNum which user to stop watching for read complete notifications
 */
function ClearReadCompleteDelegate(OnlinePlayerInterface PlayerInterface, byte LocalUserNum)
{
	PlayerInterface.ClearReadProfileSettingsCompleteDelegate(LocalUserNum,OnReadStorageComplete);
}
 
/**
 * Reads this user's storage data from the online subsystem.
 */
function RefreshStorageData()
{
	local OnlineSubsystem OnlineSub;
	local OnlinePlayerInterface PlayerInterface;

	// Figure out if we have an online subsystem registered
	OnlineSub = class'GameEngine'.static.GetOnlineSubsystem();
	if (OnlineSub != None)
	{
		// Grab the player interface to verify the subsystem supports it
		PlayerInterface = OnlineSub.PlayerInterface;
		if (PlayerInterface != None)
		{
			// Start the async task
			if (!ReadData(PlayerInterface,PlayerControllerId,Profile.DeviceId,Profile))
			{
				// Notify any owner data stores that we have changed data
				NotifyPropertyChanged();
			}
		}
	}
}

defaultproperties
{
	ProviderName=ProfileData
	WriteAccessType=ACCESS_WriteAll
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: to 10-2-2011 17:06:02.000 - Creation time: ti 22-3-2011 19:57:12.749 - Created with UnCodeX