1
0
This commit is contained in:
2020-12-13 18:01:13 +03:00
commit dd42f84140
3764 changed files with 596895 additions and 0 deletions

View File

@ -0,0 +1,52 @@
/**
* This object is responsible for the enumeration of downloadable content bundles on Dingo
*/
class DownloadableContentEnumeratorDingo extends DownloadableContentEnumerator
native;
/**
* Uses the OnlineContentInterface to populate the DLC data for all signed in users
*/
function FindDLC()
{
local OnlineSubsystem OnlineSub;
local array<OnlineContent> FoundBundles;
DLCBundles.Length = 0;
OnlineSub = class'GameEngine'.static.GetOnlineSubsystem();
if (OnlineSub != None && OnlineSub.ContentInterface != None)
{
// Start the read - NOTE this is synchronous and LocalUserNum is ignored on Dingo
if (OnlineSub.ContentInterface.ReadDownloadableContentList(-1))
{
FoundBundles.Length = 0;
OnlineSub.ContentInterface.GetDownloadableContentList(-1, FoundBundles);
// Skip the call if the array is empty
if (FoundBundles.Length > 0)
{
AppendDLC(FoundBundles);
}
}
}
TriggerFindDLCDelegates();
}
/**
* Appends the specified array to the DLCBundles array
*
* @param Bundles the array to append
*/
native function AppendDLC(const out array<OnlineContent> Bundles);
/**
* Can't work, so ignore the call
*
* @param DLCName the name of the DLC bundle to delete
*/
function DeleteDLC(string DLCName)
{
// Purposefully empty and doesn't call super
}

View File

@ -0,0 +1,71 @@
class KFOnlineLobbyDingo extends TWOnlineLobby within OnlineSubsystemDingo
config( Engine )
native;
var OnlineSubsystem OnlineSubsystem;
function bool Initialize()
{
OnlineSubsystem.GameInterface.AddCreateOnlineGameCompleteDelegate( OnCreateOnlineGameComplete );
OnlineSubsystem.GameInterface.AddMultiplayerSessionChangeDelegate( OnMultiplayerSessionChange );
return true;
}
event EmitUIMessage( string Message )
{
class'WorldInfo'.static.GetWorldInfo().GetALocalPlayerController().ClientMessage( Message );
}
event EmitJoinMessage( string Message )
{
class'WorldInfo'.static.GetWorldInfo().GetALocalPlayerController().JoinPlayfabServer( true, Message );
}
function native bool LobbyJoinGame( optional string ServerIP );
function native bool LobbyJoinServer( string ServerIP );
function native SetServerPassword( string password );
function native string GetLobbyURLString();
function native bool IsInLobby();
function native bool IsLobbyOwner();
function native bool GetLobbyAdmin( UniqueNetId LobbyId, out UniqueNetId AdminId );
function native UniqueNetId GetMyId();
function native string GetFriendNickname( UniqueNetId FriendId, optional bool IncludeSelf = true );
function native SetLobbyData( string Key, string Value );
function native string GetLobbyData( int LobbyIndex, string Key );
function native bool SetVisibility( int VisibilityIndex );
function native ShowLobbyInviteInterface( string InviteMessage );
function native bool SendInviteToUsers( array<string> MembersToInvite, string InviteMessage );
function native bool LobbyMessage( string Message );
function native bool GetCurrentLobby( out ActiveLobbyInfo LobbyInfo );
function native int GetCurrentPartySize();
function native UniqueNetId GetCurrentLobbyId();
function native bool GetLobbyFromCommandline( out UniqueNetId LobbyId, optional bool bMarkAsJoined = True );
function native LobbyInvite( UniqueNetId LobbyId, UniqueNetId FriendId, bool bAccepted );
function native bool MakeLobby( int MaxPlayers, ELobbyVisibility Type );
function native bool QuitLobby();
function native OnMultiplayerSessionChange( Name SessionName, SessionUpdateInfo SessionChanges );
function native OnCreateOnlineGameComplete( name SessionName, bool bWasSuccessful );

View File

@ -0,0 +1,286 @@
/**
* Copyright 1998-2012 Epic Games, Inc. All Rights Reserved.
*/
/**
* Class that implements a Dingo version of the game interface
*/
class OnlineCommunityContentInterfaceDingo extends Object within OnlineSubsystemDingo
native
implements(OnlineCommunityContentInterface)
config(Engine);
/** The owning subsystem that this object is providing an implementation for */
var OnlineSubsystemDingo OwningSubsystem;
var array<delegate<OnReadContentListComplete> > ReadContentListCompleteDelegates;
var array<delegate<OnUploadContentComplete> > UploadContentCompleteDelegates;
var array<delegate<OnDownloadContentComplete> > DownloadContentCompleteDelegates;
var array<delegate<OnDeleteContentComplete> > DeleteContentCompleteDelegates;
/**
* Initializes the community content object
*
* @return true if the initialization succeeded, false otherwise
*/
native event bool Init();
/**
* Shuts down the community content object
*/
native event Exit();
/**
* Starts the async task that reads the list of content that this person can download. The resulting
* data includes the information for that file (meta data and rating/download information)
*
* @param PlayerNum the player doing the request
* @param NetId the player who's data will be read
* @param StartAt used to read from a list starting a known offset
* @param NumToRead the number of items to retrieve (0 means all)
*
* @return true if the async task succeeded in starting up, false otherwise
*/
native function bool ReadContentList(byte PlayerNum,UniqueNetId NetId,optional string Path="",optional int StartAt = 0,optional int NumToRead = 0);
/**
* Delegate fired when the async read task has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
*/
delegate OnReadContentListComplete(bool bWasSuccessful, array<CommunityContentFile> ContentFiles);
/**
* Adds the delegate to the list that will be notified when the task completes
*
* @param ReadContentListCompleteDelegate the delegate to use for notifications
*/
function AddReadContentListCompleteDelegate(delegate<OnReadContentListComplete> ReadContentListCompleteDelegate)
{
`AddUniqueItemToArray(ReadContentListCompleteDelegates, ReadContentListCompleteDelegate);
}
/**
* Removes the delegate from the list of notifications
*
* @param ReadContentListCompleteDelegate the delegate to use for notifications
*/
function ClearReadContentListCompleteDelegate(delegate<OnReadContentListComplete> ReadContentListCompleteDelegate)
{
ReadContentListCompleteDelegates.RemoveItem(ReadContentListCompleteDelegate);
}
/**
* Uploads the contents of the blob to the content server(s)
*
* @param PlayerNum the controller number associated with the player
* @param Payload the data that is being uploaded
* @param Metadata metadata describing the content
*
* @return true if the async upload task started successfully, false otherwise
*/
native function bool UploadContent(byte PlayerNum,const out array<byte> Payload,const out CommunityContentMetadata Metadata);
/**
* Delegate fired when the async upload task has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
* @param UploadedFile the corresponding meta data that was associated with the content
*/
delegate OnUploadContentComplete(bool bWasSuccessful,CommunityContentFile UploadedFile);
/**
* Adds the delegate to the list that will be notified when the task completes
*
* @param UploadContentCompleteDelegate the delegate to use for notifications
*/
function AddUploadContentCompleteDelegate(delegate<OnUploadContentComplete> UploadContentCompleteDelegate)
{
`AddUniqueItemToArray(UploadContentCompleteDelegates, UploadContentCompleteDelegate);
}
/**
* Removes the delegate from the list of notifications
*
* @param UploadContentCompleteDelegate the delegate to use for notifications
*/
function ClearUploadContentCompleteDelegate(delegate<OnUploadContentComplete> UploadContentCompleteDelegate)
{
UploadContentCompleteDelegates.RemoveItem(UploadContentCompleteDelegate);
}
/**
* Downloads the contents of the specified file
*
* @param PlayerNum the controller number associated with the player
* @param FileToDownload the file information that tells the system what to download
*
* @return true if the async Download task started successfully, false otherwise
*/
native function bool DownloadContent(byte PlayerNum,const out CommunityContentFile FileToDownload);
/**
* Delegate fired when the async download task has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
* @param FileDownloaded the information for the file that was downloaded
*/
delegate OnDownloadContentComplete(bool bWasSuccessful,CommunityContentFile FileDownloaded, array<byte> Payload);
/**
* Adds the delegate to the list that will be notified when the task completes
*
* @param DownloadContentCompleteDelegate the delegate to use for notifications
*/
function AddDownloadContentCompleteDelegate(delegate<OnDownloadContentComplete> DownloadContentCompleteDelegate)
{
`AddUniqueItemToArray(DownloadContentCompleteDelegates, DownloadContentCompleteDelegate);
}
/**
* Removes the delegate from the list of notifications
*
* @param DownloadContentCompleteDelegate the delegate to use for notifications
*/
function ClearDownloadContentCompleteDelegate(delegate<OnDownloadContentComplete> DownloadContentCompleteDelegate)
{
DownloadContentCompleteDelegates.RemoveItem(DownloadContentCompleteDelegate);
}
/**
* Delete the contents of the blob on the content server(s)
*
* @param PlayerNum the controller number associated with the player
* @param Metadata metadata describing the content
*
* @return true if the async delete task started successfully, false otherwise
*/
native function bool DeleteContent(byte PlayerNum,const out CommunityContentMetadata Metadata);
/**
* Delegate fired when the async delete task has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
* @param UploadedFile the corresponding meta data that was associated with the content
*/
delegate OnDeleteContentComplete(bool bWasSuccessful);
/**
* Adds the delegate to the list that will be notified when the task completes
*
* @param DeleteContentCompleteDelegate the delegate to use for notifications
*/
function AddDeleteContentCompleteDelegate(delegate<OnDeleteContentComplete> DeleteContentCompleteDelegate)
{
`AddUniqueItemToArray(DeleteContentCompleteDelegates, DeleteContentCompleteDelegate);
}
/**
* Removes the delegate from the list of notifications
*
* @param DeleteContentCompleteDelegate the delegate to use for notifications
*/
function ClearDeleteContentCompleteDelegate(delegate<OnDeleteContentComplete> DeleteContentCompleteDelegate)
{
DeleteContentCompleteDelegates.RemoveItem(DeleteContentCompleteDelegate);
}
/**
* Supplies a player defined rating for the specified content
*
* @param PlayerNum the controller number associated with the player
* @param FileToRate the information for the file that is being rated
* @param NewRating the new rating the player has given for this content
*
* @return true if the rating was successfully started, false otherwise (still in progress, can't find, etc.)
*/
function RateContent(byte PlayerNum,const out CommunityContentFile FileToRate,int NewRating);
/**
* Copies the content file information for the specified player
*
* @param PlayerNum the controller number associated with the player
* @param ContentFiles out array that is populated with the file list
*
* @return true if the copy succeeded, false otherwise (still in process, etc.)
*/
function bool GetContentList(byte PlayerNum,out array<CommunityContentFile> ContentFiles);
/**
* Starts the async task that reads the list of content that this person can download. The resulting
* data includes the information for that file (meta data and rating/download information)
*
* @param PlayerNum the controller number associated with the player
* @param Friends the set of friends to read the content files for
* @param StartAt used to read from a list starting a known offset
* @param NumToRead the number of items to retrieve (-1 means all)
*
* @return true if the async task succeeded in starting up, false otherwise
*/
function bool ReadFriendsContentList(byte PlayerNum,const out array<OnlineFriend> Friends,optional int StartAt = 0,optional int NumToRead = -1);
/**
* Delegate fired when the async read task has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
*/
delegate OnReadFriendsContentListComplete(bool bWasSuccessful);
/**
* Adds the delegate to the list that will be notified when the task completes
*
* @param ReadFriendsContentListCompleteDelegate the delegate to use for notifications
*/
function AddReadFriendsContentListCompleteDelegate(delegate<OnReadFriendsContentListComplete> ReadFriendsContentListCompleteDelegate);
/**
* Removes the delegate from the list of notifications
*
* @param ReadFriendsContentListCompleteDelegate the delegate to use for notifications
*/
function ClearReadFriendsContentListCompleteDelegate(delegate<OnReadFriendsContentListComplete> ReadFriendsContentListCompleteDelegate);
/**
* Copies the content file information for the specified player
*
* @param PlayerNum the controller number associated with the player
* @param Friend the friend to copy the file list for
* @param ContentFiles out array that is populated with the file list
*
* @return true if the copy succeeded, false otherwise (still in process, etc.)
*/
function bool GetFriendsContentList(byte PlayerNum,const out OnlineFriend Friend,out array<CommunityContentFile> ContentFiles);
/**
* Copies the contents of the payload into the specified array for the specified file owned
* by the specified player
*
* @param PlayerNum the controller number associated with the player
* @param FileDownloaded the information for the file that was downloaded
*
* @return true if the async Download task started successfully, false otherwise
*/
function bool GetContentPayload(byte PlayerNum,const out CommunityContentFile FileDownloaded);
/**
* Delegate fired when the async get content payload task has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
* @param FileDownloaded the information for the file that was downloaded
* @param Payload the out array that receives contents of the file/blob data that was downloaded
*/
delegate OnGetContentPayloadComplete(bool bWasSuccessful,CommunityContentFile FileDownloaded,const out array<byte> Payload);
/**
* Adds the delegate to the list that will be notified when the task completes
*
* @param GetContentPayloadCompleteDelegate the delegate to use for notifications
*/
function AddGetContentPayloadCompleteDelegate(delegate<OnGetContentPayloadComplete> GetContentPayloadCompleteDelegate);
/**
* Removes the delegate from the list of notifications
*
* @param GetContentPayloadCompleteDelegate the delegate to use for notifications
*/
function ClearGetContentPayloadCompleteDelegate(delegate<OnGetContentPayloadComplete> GetContentPayloadCompleteDelegate);

View File

@ -0,0 +1,769 @@
/**
* Class that implements a Dingo version of the Content interface
*/
class OnlineContentInterfaceDingo extends Object within OnlineSubsystemDingo
native
implements(OnlineContentInterface);
/** The owning subsystem that this object is providing an implementation for */
var OnlineSubsystemDingo OwningSubsystem;
struct native OnlineSaveGame extends OnlineSubsystem.OnlineContent
{
/** The data of the save game */
var init array<byte> SaveGameData;
/** The Read/Write state of this content */
var EOnlineEnumerationReadState ReadWriteState;
};
struct native OnlineDownloadableContent extends OnlineSubsystem.OnlineContent
{
/** The native WinRT Package pointer used for mounting/unmounting */
var native hatpointer DLCPackage{Windows::Xbox::Management::Deployment::IDownloadableContentPackage};
/** The event token key for the LicenseTerminated event */
var native QWORD LicenseTerminatedTokenKey;
/** Have we enumerated the files in the package? */
var native bool bHasEnumeratedContent;
};
struct native OnlineCrossTitleDownloadableContent extends OnlineSubsystem.OnlineCrossTitleContent
{
/** The native WinRT Package pointer used for mounting/unmounting */
var native hatpointer DLCPackage{Windows::Xbox::Management::Deployment::IDownloadableContentPackage};
/** The event token key for the LicenseTerminated event */
var native QWORD LicenseTerminatedTokenKey;
/** Have we enumerated the files in the package? */
var native bool bHasEnumeratedContent;
};
/** Holds all the cached online content for a user */
struct native OnlineContentCache
{
/** ConnectedStorageSpace for this user */
var native hatpointer UserConnectedStorageSpace{Windows::Xbox::Storage::ConnectedStorageSpace};
/** The list of returned savegame content */
var init array<OnlineSaveGame> SaveGameContent;
structcpptext
{
FOnlineContentCache()
: UserConnectedStorageSpace(nullptr) {}
}
};
/** Maps from user id to that user's OnlineContentCache */
var native map{QWORD, FOnlineContentCache} ContentCache;
/** The list of available DLC content */
var init array<OnlineDownloadableContent> DLCContent;
/** The list of cross-title DLC content */
var init array<OnlineCrossTitleDownloadableContent> CrossTitleDLCContent;
var init array<OnlineCrossTitleContent> CrossTitleContent;
/** the array of delegates for notifying when content has changed */
var array<delegate<OnContentChange> > ContentChangeDelegates;
var array<delegate<OnReadCrossTitleContentComplete> > CrossTitleContentChangeDelegates;
var bool bHasEnumeratedCrossTitleContent;
/** Since the static array of dynamic array syntax appears to be broken */
struct native PerUserOnlineContentDelegates
{
/** the array of delegates for notifying when content has changed */
var array<delegate<OnContentChange> > ContentChangeDelegates;
/** the array of delegates for notifying when a downloadable content read has completed */
var array<delegate<OnReadDownloadableContentComplete> > ReadDLCDelegates;
/** the array of delegates for notifying when a cross-title downloadable content read has completed */
var array<delegate<OnReadCrossTitleDownloadableContentComplete> > ReadCrossTitleDLCDelegates;
/** the array of delegates for notifying when a save game read has completed */
var array<delegate<OnReadSaveGameDataComplete> > ReadSaveGameDelegates;
/** the array of delegates for notifying when a save game write has completed */
var array<delegate<OnWriteSaveGameDataComplete> > WriteSaveGameDelegates;
/** the array of delegates for notifying when a save game delete has been completed */
var array<delegate<OnDeleteSaveGameDataComplete> > DeleteSaveGameDelegates;
};
/** Per user array of array of delegates */
var PerUserOnlineContentDelegates PerUserDelegates[`MAX_NUM_PLAYERS];
/**
* Delegate used in content change (add or deletion) notifications
* for any user
*/
delegate OnContentChange();
/**
* Adds the delegate used to notify the gameplay code that (downloaded) content changed
*
* @param Content Delegate the delegate to use for notifications
* @param LocalUserNum whether to watch for changes on a specific slot or all slots
*/
function AddContentChangeDelegate(delegate<OnContentChange> ContentDelegate, optional byte LocalUserNum = 255)
{
if (LocalUserNum == 255)
{
`AddUniqueItemToArray(ContentChangeDelegates, ContentDelegate);
}
else
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].ContentChangeDelegates, ContentDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddContentChangeDelegate()");
}
}
}
/**
* Removes the delegate from the set of delegates that are notified
*
* @param Content Delegate the delegate to use for notifications
* @param LocalUserNum whether to watch for changes on a specific slot or all slots
*/
function ClearContentChangeDelegate(delegate<OnContentChange> ContentDelegate, optional byte LocalUserNum = 255)
{
if (LocalUserNum == 255)
{
ContentChangeDelegates.RemoveItem(ContentDelegate);
}
else
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].ContentChangeDelegates.RemoveItem(ContentDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearContentChangeDelegate()");
}
}
}
/**
* Delegate used when the content read request has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
*/
delegate OnReadDownloadableContentComplete(bool bWasSuccessful);
/**
* Adds the delegate used to notify the gameplay code that the downloadable content read request has completed
*
* @param LocalUserNum The user to read the content list of
* @param ReadContentCompleteDelegate the delegate to use for notifications
*/
function AddReadDownloadableContentComplete(byte LocalUserNum, delegate<OnReadDownloadableContentComplete> ReadDLCCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].ReadDLCDelegates, ReadDLCCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddReadDownloadableContentComplete()");
}
}
/**
* Clears the delegate used to notify the gameplay code that the downloadable content read request has completed
*
* @param LocalUserNum The user to read the content list of
* @param ReadContentCompleteDelegate the delegate to use for notifications
*/
function ClearReadDownloadableContentComplete(byte LocalUserNum, delegate<OnReadDownloadableContentComplete> ReadDLCCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].ReadDLCDelegates.RemoveItem(ReadDLCCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearReadDownloadableContentComplete()");
}
}
/**
* Starts an async task that retrieves the list of downloaded content for the player.
*
* @param LocalUserNum The user to read the content list of
*
* @return true if the read request was issued successfully, false otherwise
*/
native function bool ReadDownloadableContentList(byte LocalUserNum);
/**
* Starts an async task that frees any downloaded content resources for that player
*
* @param LocalUserNum The user to clear the content list for
*/
native function ClearDownloadableContentList(byte LocalUserNum);
/**
* Retrieve the list of content the given user has downloaded
* to the local console.
* @param LocalUserNum The user to read the content list of
* @param ContentList The out array that receives the list of all content
*
* @return OERS_Done if the read has completed, otherwise one of the other states
*/
native function EOnlineEnumerationReadState GetDownloadableContentList(byte LocalUserNum, out array<OnlineContent> ContentList);
/**
* Starts an async task that retrieves the list of downloaded content for the player across all titles
*
* @param LocalUserNum The user to read the content list of
* @param TitleId the title id to filter on. Zero means all titles
*
* @return true if the read request was issued successfully, false otherwise
*/
native function bool ReadCrossTitleDownloadableContentList(byte LocalUserNum, optional int TitleId = 0);
/**
* Starts an async task that frees any downloaded content resources for that player
*
* @param LocalUserNum The user to clear the content list for
*/
native function ClearCrossTitleDownloadableContentList(byte LocalUserNum);
/**
* Retrieve the list of content the given user has downloaded
* to the local console.
* @param LocalUserNum The user to read the content list of
* @param ContentList The out array that receives the list of all content
*
* @return OERS_Done if the read has completed, otherwise one of the other states
*/
native function EOnlineEnumerationReadState GetCrossTitleDownloadableContentList(byte LocalUserNum, out array<OnlineCrossTitleContent> ContentList);
/**
* Delegate used when the content read request has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
*/
delegate OnReadCrossTitleDownloadableContentComplete(bool bWasSuccessful);
/**
* Adds the delegate used to notify the gameplay code that the content read request has completed
*
* @param LocalUserNum The user to read the content list of
* @param ReadContentCompleteDelegate the delegate to use for notifications
*/
function AddReadCrossTitleDownloadableContentComplete(byte LocalUserNum, delegate<OnReadCrossTitleDownloadableContentComplete> ReadCrossTitleDLCCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].ReadCrossTitleDLCDelegates, ReadCrossTitleDLCCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddReadCrossTitleContentCompleteDelegate()");
}
}
/**
* Clears the delegate used to notify the gameplay code that the content read request has completed
*
* @param LocalUserNum The user to read the content list of
* @param ReadContentCompleteDelegate the delegate to use for notifications
*/
function ClearReadCrossTitleDownloadableContentComplete(byte LocalUserNum, delegate<OnReadCrossTitleDownloadableContentComplete> ReadCrossTitleDLCCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].ReadCrossTitleDLCDelegates.RemoveItem(ReadCrossTitleDLCCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearReadCrossTitleContentCompleteDelegate()");
}
}
/**
* Reads a player's cross title save game data from the specified content bundle
*
* @param LocalUserNum the user that is initiating the data read (also used in validating ownership of the data)
* @param DeviceId the device to read the same game from
* @param TitleId the title id the save game is from
* @param FriendlyName the friendly name of the save game that was returned by enumeration
* @param FileName the file to read from inside of the content package
* @param SaveFileName the file name of the save game inside the content package
*
* @return true if the async read was started successfully, false otherwise
*/
function bool ReadCrossTitleSaveGameData(byte LocalUserNum,int DeviceId,int TitleId,string FriendlyName,string FileName,string SaveFileName);
/**
* Copies a player's cross title save game data from the cached async read data
*
* @param LocalUserNum the user that is initiating the data read (also used in validating ownership of the data)
* @param DeviceId the device to read the same game from
* @param TitleId the title id the save game is from
* @param FriendlyName the friendly name of the save game that was returned by enumeration
* @param FileName the file to read from inside of the content package
* @param SaveFileName the file name of the save game inside the content package
* @param bIsValid out value indicating whether the save is corrupt or not
* @param SaveGameData the array that is filled with the save game data
*
* @return true if the async read was started successfully, false otherwise
*/
function bool GetCrossTitleSaveGameData(byte LocalUserNum,int DeviceId,int TitleId,string FriendlyName,string FileName,string SaveFileName,out byte bIsValid,out array<byte> SaveGameData);
/**
* Delegate used when the cross title content read request has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
* @param LocalUserNum the user that was initiating the data read
* @param DeviceId the device that the read was on
* @param TitleId the title id the save game is from
* @param FriendlyName the friendly name of the save game that was returned by enumeration
* @param FileName the file to read from inside of the content package
* @param SaveFileName the file name of the save game inside the content package
*/
delegate OnReadCrossTitleSaveGameDataComplete(bool bWasSuccessful,byte LocalUserNum,int DeviceId,int TitleId,string FriendlyName,string FileName,string SaveFileName);
/**
* Adds the delegate used to notify the gameplay code that a cross title save game read request has completed
*
* @param LocalUserNum The user that was reading a save game
* @param ReadSaveGameDataCompleteDelegate the delegate to use for notifications
*/
function AddReadCrossTitleSaveGameDataComplete(byte LocalUserNum,delegate<OnReadCrossTitleSaveGameDataComplete> ReadSaveGameDataCompleteDelegate);
/**
* Clears the delegate used to notify the gameplay code that a cross title save game read request has completed
*
* @param LocalUserNum The user that was reading a save game
* @param ReadSaveGameDataCompleteDelegate the delegate to use for notifications
*/
function ClearReadCrossTitleSaveGameDataComplete(byte LocalUserNum,delegate<OnReadCrossTitleSaveGameDataComplete> ReadSaveGameDataCompleteDelegate);
/**
* Clears any cached save games
*
* @param LocalUserNum the user that is deleting data
*
* @return true if the clear succeeded, false otherwise
*/
function bool ClearCrossTitleSaveGames(byte LocalUserNum);
/**
* Asks the online system for the number of new and total content downloads
*
* @param LocalUserNum the user to check the content download availability for
* @param CategoryMask the bitmask to use to filter content by type
*
* @return TRUE if the call succeeded, FALSE otherwise
*/
function bool QueryAvailableDownloads(byte LocalUserNum,optional int CategoryMask = -1);
/**
* Called once the download query completes
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
*/
delegate OnQueryAvailableDownloadsComplete(bool bWasSuccessful);
/**
* Adds the delegate used to notify the gameplay code that the content download query has completed
*
* @param LocalUserNum the user to check the content download availability for
* @param ReadContentCompleteDelegate the delegate to use for notifications
*/
function AddQueryAvailableDownloadsComplete(byte LocalUserNum,delegate<OnQueryAvailableDownloadsComplete> QueryDownloadsDelegate);
/**
* Clears the delegate used to notify the gameplay code that the content download query has completed
*
* @param LocalUserNum the user to check the content download availability for
* @param ReadContentCompleteDelegate the delegate to use for notifications
*/
function ClearQueryAvailableDownloadsComplete(byte LocalUserNum,delegate<OnQueryAvailableDownloadsComplete> QueryDownloadsDelegate);
/**
* Returns the number of new and total downloads available for the user
*
* @param LocalUserNum the user to check the content download availability for
* @param NewDownloads out value of the number of new downloads available
* @param TotalDownloads out value of the number of total downloads available
*/
function GetAvailableDownloadCounts(byte LocalUserNum,out int NewDownloads,out int TotalDownloads);
/**
* Reads a player's save game data from the specified content bundle
*
* @param LocalUserNum the user that is initiating the data read (also used in validating ownership of the data)
* @param SaveFileName the file name of the save game inside the content package
*
* @return true if the async read was started successfully, false otherwise
*/
native function bool ReadSaveGameData(byte LocalUserNum,int DeviceId,string FriendlyName,string FileName,string SaveFileName);
/**
* Copies a player's save game data from the cached async read data
*
* @param LocalUserNum the user that is initiating the data read (also used in validating ownership of the data)
* @param SaveFileName the file name of the save game inside the content package
* @param bIsValid out value indicating whether the save is corrupt or not
* @param SaveGameData the array that is filled with the save game data
*
* @return true if the async read was started successfully, false otherwise
*/
native function bool GetSaveGameData(byte LocalUserNum,int DeviceId,string FriendlyName,string FileName,string SaveFileName,out byte bIsValid,out array<byte> SaveGameData);
/**
* Delegate used when the content read request has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
* @param LocalUserNum the user that was initiating the data read
* @param SaveFileName the file name of the save game inside the content package
*/
delegate OnReadSaveGameDataComplete(bool bWasSuccessful,byte LocalUserNum,int DeviceId,string FriendlyName,string FileName,string SaveFileName);
/**
* Adds the delegate used to notify the gameplay code that a save game read request has completed
*
* @param LocalUserNum The user that was reading a save game
* @param ReadSaveGameDataCompleteDelegate the delegate to use for notifications
*/
function AddReadSaveGameDataComplete(byte LocalUserNum,delegate<OnReadSaveGameDataComplete> ReadSaveGameDataCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].ReadSaveGameDelegates, ReadSaveGameDataCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddReadSaveGameDataComplete()");
}
}
/**
* Clears the delegate used to notify the gameplay code that a save game read request has completed
*
* @param LocalUserNum The user that was reading a save game
* @param ReadSaveGameDataCompleteDelegate the delegate to use for notifications
*/
function ClearReadSaveGameDataComplete(byte LocalUserNum,delegate<OnReadSaveGameDataComplete> ReadSaveGameDataCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].ReadSaveGameDelegates.RemoveItem(ReadSaveGameDataCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearReadSaveGameDataComplete()");
}
}
/**
* Writes a player's save game data to the specified content bundle and file
*
* @param LocalUserNum the user that is initiating the data write
* @param SaveFileName the file name of the save game inside the content package
* @param SaveGameData the data to write to the save game file
*
* @return true if the async write was started successfully, false otherwise
*/
native function bool WriteSaveGameData(byte LocalUserNum,int DeviceId,string FriendlyName,string FileName,string SaveFileName,const out array<byte> SaveGameData);
/**
* Delegate used when the content write request has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
* @param LocalUserNum the user that was initiating the data write
* @param SaveFileName the file to write to inside of the content package
*/
delegate OnWriteSaveGameDataComplete(bool bWasSuccessful,byte LocalUserNum,int DeviceId,string FriendlyName,string FileName,string SaveFileName);
/**
* Adds the delegate used to notify the gameplay code that a save game write request has completed
*
* @param LocalUserNum The user that was writing a save game
* @param WriteSaveGameDataCompleteDelegate the delegate to use for notifications
*/
function AddWriteSaveGameDataComplete(byte LocalUserNum,delegate<OnWriteSaveGameDataComplete> WriteSaveGameDataCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].WriteSaveGameDelegates, WriteSaveGameDataCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddWriteSaveGameDataComplete()");
}
}
/**
* Clears the delegate used to notify the gameplay code that a save game write request has completed
*
* @param LocalUserNum The user that was writing a save game
* @param WriteSaveGameDataCompleteDelegate the delegate to use for notifications
*/
function ClearWriteSaveGameDataComplete(byte LocalUserNum,delegate<OnWriteSaveGameDataComplete> WriteSaveGameDataCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].WriteSaveGameDelegates.RemoveItem(WriteSaveGameDataCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearWriteSaveGameDataComplete()");
}
}
/**
* Deletes a player's save game data
*
* @param LocalUserNum the user that is deleting data
* @param SaveFileName the file name of the content package to delete
*
* @return true if the delete succeeded, false otherwise
*/
native function bool DeleteSaveGameData(byte LocalUserNum,string SaveFileName);
/**
* Delegate used when the content delete request has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
* @param LocalUserNum the user that was initiating the data write
* @param FileName the save file that was deleted
*/
delegate OnDeleteSaveGameDataComplete(bool bWasSuccessful,byte LocalUserNum,string SaveFileName);
/**
* Adds the delegate used to notify the gameplay code that a save game delete request has completed
*
* @param LocalUserNum The user that was writing a save game
* @param DeleteSaveGameDataCompleteDelegate the delegate to use for notifications
*/
function AddDeleteSaveGameDataCompleteDelegate(byte LocalUserNum,delegate<OnDeleteSaveGameDataComplete> DeleteSaveGameDataCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].DeleteSaveGameDelegates, DeleteSaveGameDataCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddDeleteSaveGameDataComplete()");
}
}
/**
* Clears the delegate used to notify the gameplay code that a save game delete request has completed
*
* @param LocalUserNum The user that was writing a save game
* @param DeleteSaveGameDataCompleteDelegate the delegate to use for notifications
*/
function ClearDeleteSaveGameDataCompleteDelegate(byte LocalUserNum,delegate<OnDeleteSaveGameDataComplete> DeleteSaveGameDataCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].DeleteSaveGameDelegates.RemoveItem(DeleteSaveGameDataCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearDeleteSaveGameDataComplete()");
}
}
/**
* Deletes a player's save game data
*
* @param LocalUserNum the user that is deleting data
* @param DeviceId the device to delete the same game from
* @param FriendlyName the friendly name of the save game that was returned by enumeration
* @param FileName the file name of the content package to delete
*
* @return true if the delete succeeded, false otherwise
*/
function bool DeleteSaveGame(byte LocalUserNum,int DeviceId,string FriendlyName,string FileName)
{
return DeleteSaveGameData( LocalUserNum, FileName );
}
/**
* Clears any cached save games
*
* @param LocalUserNum the user that is deleting data
*
* @return true if the clear succeeded, false otherwise
*/
function bool ClearSaveGames(byte LocalUserNum);
/**
* Clears any cached save games
*
* @param LocalUserNum the user that is deleting data
*
* @return true if the clear succeeded, false otherwise
*/
native function bool ClearCachedSaveGames(byte LocalUserNum);
/**
* Delegate used when the content read request has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
*/
delegate OnReadContentComplete(bool bWasSuccessful);
/**
* Adds the delegate used to notify the gameplay code that the content read request has completed
*
* @param LocalUserNum The user to read the content list of
* @param ContentType the type of content being read
* @param ReadContentCompleteDelegate the delegate to use for notifications
*/
function AddReadContentComplete(byte LocalUserNum,EOnlineContentType ContentType,delegate<OnReadContentComplete> ReadContentCompleteDelegate);
/**
* Clears the delegate used to notify the gameplay code that the content read request has completed
*
* @param LocalUserNum The user to read the content list of
* @param ContentType the type of content being read
* @param ReadContentCompleteDelegate the delegate to use for notifications
*/
function ClearReadContentComplete(byte LocalUserNum,EOnlineContentType ContentType,delegate<OnReadContentComplete> ReadContentCompleteDelegate);
/**
* Starts an async task that retrieves the list of downloaded/savegame content for the player.
*
* @param LocalUserNum The user to read the content list of
* @param ContentType the type of content being read
* @param DeviceId optional value to restrict the enumeration to a particular device
*
* @return true if the read request was issued successfully, false otherwise
*/
function bool ReadContentList(byte LocalUserNum,EOnlineContentType ContentType,optional int DeviceId = -1);
/**
* Starts an async task that frees any downloaded content resources for that player
*
* @param LocalUserNum The user to clear the content list for
* @param ContentType the type of content being read
*/
function ClearContentList(byte LocalUserNum,EOnlineContentType ContentType);
/**
* Retrieve the list of content the given user has downloaded or otherwise retrieved
* to the local console.
* @param LocalUserNum The user to read the content list of
* @param ContentType the type of content being read
* @param ContentList The out array that receives the list of all content
*
* @return OERS_Done if the read has completed, otherwise one of the other states
*/
function EOnlineEnumerationReadState GetContentList(byte LocalUserNum,EOnlineContentType ContentType,out array<OnlineContent> ContentList);
/**
* Starts an async task that retrieves the list of downloaded/savegame content for the player across all titles
*
* @param LocalUserNum The user to read the content list of
* @param ContentType the type of content being read
* @param TitleId the title id to filter on. Zero means all titles
* @param DeviceId optional value to restrict the enumeration to a particular device
*
* @return true if the read request was issued successfully, false otherwise
*/
native function bool ReadCrossTitleContentList(byte LocalUserNum,EOnlineContentType ContentType,optional int TitleId = 0,optional int DeviceId = -1);
/**
* Starts an async task that frees any downloaded content resources for that player
*
* @param LocalUserNum The user to clear the content list for
* @param ContentType the type of content being read
*/
native function ClearCrossTitleContentList(byte LocalUserNum,EOnlineContentType ContentType);
/**
* Retrieve the list of content the given user has downloaded or otherwise retrieved
* to the local console.
* @param LocalUserNum The user to read the content list of
* @param ContentType the type of content being read
* @param ContentList The out array that receives the list of all content
*
* @return OERS_Done if the read has completed, otherwise one of the other states
*/
native function EOnlineEnumerationReadState GetCrossTitleContentList(byte LocalUserNum,EOnlineContentType ContentType,out array<OnlineCrossTitleContent> ContentList);
/**
* Delegate used when the content read request has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
*/
delegate OnReadCrossTitleContentComplete(bool bWasSuccessful);
/**
* Adds the delegate used to notify the gameplay code that the content read request has completed
*
* @param LocalUserNum The user to read the content list of
* @param ContentType the type of content being read
* @param ReadContentCompleteDelegate the delegate to use for notifications
*/
function AddReadCrossTitleContentCompleteDelegate(byte LocalUserNum, EOnlineContentType ContentType, delegate<OnReadCrossTitleContentComplete> ReadContentCompleteDelegate)
{
`AddUniqueItemToArray(CrossTitleContentChangeDelegates, ReadContentCompleteDelegate);
}
/**
* Clears the delegate used to notify the gameplay code that the content read request has completed
*
* @param LocalUserNum The user to read the content list of
* @param ContentType the type of content being read
* @param ReadContentCompleteDelegate the delegate to use for notifications
*/
function ClearReadCrossTitleContentCompleteDelegate(byte LocalUserNum, EOnlineContentType ContentType, delegate<OnReadCrossTitleContentComplete> ReadContentCompleteDelegate)
{
CrossTitleContentChangeDelegates.RemoveItem(ReadContentCompleteDelegate);
}
cpptext
{
void Init();
/**
* Handles updating of any async tasks that need to be performed
*
* @param DeltaTime the amount of time that has passed since the last tick
*/
virtual void Tick(FLOAT DeltaTime);
FOnlineContentCache& GetOnlineContentCache(QWORD PlayerUid);
UBOOL HasCachedSaveGameContent(QWORD PlayerUid, const FString& ContentFilename);
FOnlineSaveGame& GetCachedSaveGameContent(QWORD PlayerUid, const FString& ContentFilename);
void ClearCachedSaveGameContent(QWORD PlayerUid, const FString& ContentFilename);
private:
static Windows::Xbox::Management::Deployment::DownloadableContentPackageManager^ DLCPackageManager;
static FCriticalSection ContentChangeCriticalSection;
static UBOOL bDLCContentStatusUpdated;
static void OnPackageInstallCompleted();
void OnLicenseTerminated(const FString& PackageFullname, INT Reason, const FString& UserXuid);
}

View File

@ -0,0 +1,184 @@
/**
* Class that implements a Dingo version of the GameDVR interface
*/
class OnlineGameDVRInterfaceDingo extends Object within OnlineSubsystemDingo
native
implements(OnlineGameDVRInterface)
config(Engine);
/** The owning subsystem that this object is providing an implementation for */
var OnlineSubsystemDingo OwningSubsystem;
/** Is the game rendering a Kinect RGB stream to the screen? */
var transient bool bIsRenderingKinectRGB;
/** Is recording enabled? */
var transient bool bIsEventRecordingEnabled;
struct native DVRClip
{
var init string ClipName;
var bool bDidEndCapture;
var native hatpointer ClipCapture{Windows::Xbox::Media::Capture::ApplicationClipCapture};
var native hatpointer CachedClip{Windows::Xbox::Media::Capture::ApplicationClip};
structcpptext
{
FDVRClip(const FString& InClipName)
: ClipName(InClipName), bDidEndCapture(FALSE), ClipCapture(nullptr), CachedClip(nullptr) {}
}
};
struct native DVRClipCache
{
/** Indicates the state of the async read */
var EOnlineEnumerationReadState ReadState;
var init array<DVRClip> DVRClips;
structcpptext
{
FDVRClipCache() : ReadState(OERS_NotStarted) {}
FDVRClip& FindOrAddClip(const FString& ClipName)
{
// Find an existing entry for this clip
for (INT ClipIdx = 0; ClipIdx < DVRClips.Num(); ++ClipIdx)
{
if (DVRClips(ClipIdx).ClipName == ClipName)
{
return DVRClips(ClipIdx);
}
}
// Add a new entry
FDVRClip NewClip(ClipName);
return DVRClips(DVRClips.AddItem(NewClip));
}
}
};
/** Cache of user's DVR clips */
var native map{QWORD, FDVRClipCache} UserDVRClipCache;
/** Since the static array of dynamic array syntax appears to be broken */
struct native PerUserGameDVRDelegates
{
/** the array of delegates for notifying when the read of a user's recorded clips has completed */
var array<delegate<OnReadRecordedClipsComplete> > ReadRecordedClipsDelegates;
/** the array of delegates for notifying when the read of a user's recorded clips has completed */
var array<delegate<OnRecordEventComplete> > RecordEventCompleteDelegates;
};
/** Per user array of array of delegates */
var PerUserGameDVRDelegates PerUserDelegates[`MAX_NUM_PLAYERS];
/** Enable recording events */
native function EnableRecording();
/** Disable recording events */
native function DisableRecording();
/** Read a player's list of recorded clips */
native function bool ReadRecordedClips(byte LocalUserNum);
/**
* Called when the async read of a user's recorded clips completes
*/
delegate OnReadRecordedClipsComplete(bool bWasSuccessful, byte LocalUserNum);
/*
* Clears out all cached clips that have been recorded or read
*/
native function ClearCachedRecordedClips(byte LocalUserNum);
/**
* Sets the delegate used to notify the gameplay code that the read of a user's recorded clips has completed
*/
function AddReadRecordedClipsCompleteDelegate(byte LocalUserNum, delegate<OnReadRecordedClipsComplete> ReadRecordedClipsCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].ReadRecordedClipsDelegates, ReadRecordedClipsCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddReadRecordedClipsCompleteDelegate()");
}
}
/**
* Clears the delegate used to notify the gameplay code that the read of a user's recorded clips has completed
*/
function ClearReadRecordedClipsCompleteDelegate(byte LocalUserNum, delegate<OnReadRecordedClipsComplete> ReadRecordedClipsCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].ReadRecordedClipsDelegates.RemoveItem(ReadRecordedClipsCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearReadRecordedClipsCompleteDelegate()");
}
}
/** Begin recording an event with the given name */
native function bool BeginRecordingEvent(byte LocalUserNum,string EventName);
/**
* Called when the async storage of a recorded clip completes
*/
delegate OnRecordEventComplete(bool bWasSuccessful, byte LocalUserNum, string EventName);
/**
* Sets the delegate used to notify the gameplay code that the async storage of a recorded clip completes
*/
function AddRecordEventCompleteDelegate(byte LocalUserNum, delegate<OnRecordEventComplete> RecordEventCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].RecordEventCompleteDelegates, RecordEventCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddRecordEventCompleteDelegate()");
}
}
/**
* Clears the delegate used to notify the gameplay code that the async storage of a recorded clip completes
*/
function ClearRecordEventCompleteDelegate(byte LocalUserNum, delegate<OnRecordEventComplete> RecordEventCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].RecordEventCompleteDelegates.RemoveItem(RecordEventCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearRecordEventCompleteDelegate()");
}
}
/** End recording an event with the given name */
native function bool EndRecordingEvent(byte LocalUserNum,string EventName);
/** Record an event that just finished, capturing the the timespan given by the duration parameter */
native function bool RecordPreviousTimespan(byte LocalUserNum,string EventName, float Duration);
/** Cancels the recording of an event with the given name */
native function bool CancelRecordingEvent(byte LocalUserNum,string EventName);
event SetIsRenderingKinectRGB(bool bInIsRenderingKinectRGB)
{
bIsRenderingKinectRGB = bInIsRenderingKinectRGB;
}
defaultproperties
{
bIsRenderingKinectRGB=FALSE
bIsEventRecordingEnabled=TRUE
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,354 @@
/**
* Class that implements a Dingo version of the Marketplace interface
*/
class OnlineMarketplaceInterfaceDingo extends Object within OnlineSubsystemDingo
native
implements(OnlineMarketplaceInterface);
/** The owning subsystem that this object is providing an implementation for */
var OnlineSubsystemDingo OwningSubsystem;
/** Since the static array of dynamic array syntax appears to be broken */
struct native PerUserMarketplaceDelegates
{
/** the array of delegates for notifying when an available product read has completed */
var array<delegate<OnReadAvailableProductsComplete> > AvailableProductReadDelegates;
/** the array of delegates for notifying when an additional product detail read has completed */
var array<delegate<OnReadAdditionalProductDetailsComplete> > AdditionalProductDetailsReadDelegates;
/** the array of delegates for notifying when an inventory read has completed */
var array<delegate<OnReadInventoryItemsComplete> > InventoryItemReadDelegates;
/** the array of delegates for notifying when an inventory consume request has completed */
var array<delegate<OnConsumeInventoryItemComplete> > ConsumeInventoryItemDelegates;
};
/** Per user array of array of delegates */
var PerUserMarketplaceDelegates PerUserDelegates[`MAX_NUM_PLAYERS];
/** Holds the cached marketplace products for a single player */
struct native CachedMarketplaceProducts
{
/** The list of products for this player */
var init array<MarketplaceProductDetails> Products;
/** Indicates the state of the async read */
var EOnlineEnumerationReadState ReadState;
structcpptext
{
FCachedMarketplaceProducts () : ReadState(OERS_NotStarted) {}
}
};
struct native UserMarketplaceCache
{
var CachedMarketplaceProducts ProductCaches[EMediaItemType.MIT_MAX];
};
/** Holds the cached list of marketplace products that have been read */
var native map{QWORD, FUserMarketplaceCache} MarketplaceProductsCache;
/** Holds the cached inventory items for a single player */
struct native CachedInventoryItems
{
/** The inventory for this player */
var init array<MarketplaceInventoryItem> Items;
/** The native WinRT items used to consume inventory items */
var native pointer PlatformItems{TWinRTObject<Windows::Foundation::Collections::IVectorView<Microsoft::Xbox::Services::Marketplace::InventoryItem^> >};
/** Indicates the state of the async read */
var EOnlineEnumerationReadState ReadState;
structcpptext
{
FCachedInventoryItems ()
: PlatformItems(NULL)
, ReadState(OERS_NotStarted) {}
~FCachedInventoryItems()
{
if (PlatformItems != NULL)
{
delete PlatformItems;
}
}
}
};
struct native UserInventoryCache
{
var CachedInventoryItems InventoryCaches[EMediaItemType.MIT_MAX];
};
/** Holds the cached player inventories that have been read */
var native map{QWORD, FUserInventoryCache} InventoryItemsCache;
var array<delegate<OnMarketplaceItemPurchased> > OnMarketplaceItemPurchasedDelegates;
/** How many consumables and durables are for sale. MUST BE UPDATED EACH UPDATE. */
var int ConsumablesCount;
var int DurablesCount;
/**
* Starts an async read of all available products
*
* @param LocalUserNum - the controller number of the associated user
* @param ParentId - if not empty, read products who are children of this product id
* @param ParentMediaType - if set, read products who are children of products of this type
* @param ChildMediaType - if set, read products who are parents of products of this type
* @param SortOrder - what order to sort the returned products in
*/
native function bool ReadAvailableProducts(byte LocalUserNum, string ParentId, optional EMediaItemType ParentMediaType = MIT_Game, optional EMediaItemType ChildMediaType = MIT_Game, optional ECatalogSortOrder SortOrder = CSO_FreeAndPaidCountDaily);
/**
* Called when the async product read for the given media type has completed
*/
delegate OnReadAvailableProductsComplete(EMediaItemType MediaType);
/**
* Sets the delegate used to notify the gameplay code that the product read request has completed
*/
function AddReadAvailableProductsCompleteDelegate(byte LocalUserNum, delegate<OnReadAvailableProductsComplete> ReadAvailableProductsCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].AvailableProductReadDelegates, ReadAvailableProductsCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddReadAvailableProductsCompleteDelegate()");
}
}
/**
* Clears the delegate used to notify the gameplay code that the product read request has completed
*/
function ClearReadAvailableProductsCompleteDelegate(byte LocalUserNum, delegate<OnReadAvailableProductsComplete> ReadAvailableProductsCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].AvailableProductReadDelegates.RemoveItem(ReadAvailableProductsCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearReadAvailableProductsCompleteDelegate()");
}
}
/**
* Copies the list of available products for the specified player
*
* @param LocalUserNum - the user to read the available products for
* @param MediaType - the type of media to return products for
* @param AvailableProducts - the out array that receives the copied data
*
* @return OERS_Done if the read has completed, otherwise one of the other states
*/
native function EOnlineEnumerationReadState GetAvailableProducts(byte LocalUserNum, EMediaItemType MediaType, out array<MarketplaceProductDetails> AvailableProducts);
/**
* Resets the list of available products for the specified player
*
* @param LocalUserNum - the user to reset available products for
* @param MediaType - the type of media to reset products for
*
*/
native function ResetAvailableProducts(byte LocalUserNum, EMediaItemType MediaType);
/**
* Starts an async read of additional product details
*
* @param LocalUserNum - the controller number of the associated user
* @param MediaType - the type of media items to retrieve additional details for
*/
native function bool ReadAdditionalDetailsForProducts(byte LocalUserNum, EMediaItemType MediaType);
/**
* Called when the async additional detail read for the given media type has completed
*/
delegate OnReadAdditionalProductDetailsComplete(EMediaItemType MediaType);
/**
* Sets the delegate used to notify the gameplay code that the product additional detail read request has completed
*/
function AddReadAdditionalProductDetailsCompleteDelegate(byte LocalUserNum, delegate<OnReadAdditionalProductDetailsComplete> ReadAdditionalProductDetailsCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].AdditionalProductDetailsReadDelegates, ReadAdditionalProductDetailsCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddReadAdditionalProductDetailsCompleteDelegate()");
}
}
/**
* Clears the delegate used to notify the gameplay code that the product additional detail read request has completed
*/
function ClearReadAdditionalProductDetailsCompleteDelegate(byte LocalUserNum, delegate<OnReadAdditionalProductDetailsComplete> ReadAdditionalProductDetailCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].AdditionalProductDetailsReadDelegates.RemoveItem(ReadAdditionalProductDetailCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearReadAdditionalProductDetailsCompleteDelegate()");
}
}
/**
* Starts an async read of all inventory items for a given user and media type
*
* @param LocalUserNum - the controller number of the associated user
* @param MediaType - media type of the inventory items to retrieve
*/
native function bool ReadInventoryItems(byte LocalUserNum, optional EMediaItemType MediaType = MIT_GameConsumable);
/**
* Called when the async inventory read has completed
*/
delegate OnReadInventoryItemsComplete(EMediaItemType MediaType);
/**
* Sets the delegate used to notify the gameplay code that the inventory read request has completed
*/
function AddReadInventoryItemsCompleteDelegate(byte LocalUserNum, delegate<OnReadInventoryItemsComplete> ReadInventoryItemsCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].InventoryItemReadDelegates, ReadInventoryItemsCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddReadInventoryItemsCompleteDelegate()");
}
}
/**
* Clears the delegate used to notify the gameplay code that the inventory read request has completed
*/
function ClearReadInventoryItemsCompleteDelegate(byte LocalUserNum, delegate<OnReadInventoryItemsComplete> ReadInventoryItemsCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].InventoryItemReadDelegates.RemoveItem(ReadInventoryItemsCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearReadInventoryItemsCompleteDelegate()");
}
}
/**
* Copies the list of inventory items for the specified player
*
* @param LocalUserNum - the user to read the inventory for
* @param MediaType - the type of inventory item to read
* @param AvailableProducts - the out array that receives the copied data
*
* @return OERS_Done if the read has completed, otherwise one of the other states
*/
native function EOnlineEnumerationReadState GetInventoryItems(byte LocalUserNum, EMediaItemType MediaType, out array<MarketplaceInventoryItem> InventoryItems);
/**
* Resets the list of inventory items for the specified player
*
* @param LocalUserNum - the user to reset inventory items for
* @param MediaType - the type of inventory items to reset
*
*/
native function ResetInventoryItems(byte LocalUserNum, EMediaItemType MediaType);
/**
* Consumes the given number of inventory items, if able
*
* @param LocalUserNum - the user to consume items for
* @param ProductId - the product identifier of the item to consume
* @param Quantity - the number of items to consume
* @param TransactionId - the transaction id of this consume request (NOTE: this needs to be unique to this request)
*/
native function bool ConsumeInventoryItem(byte LocalUserNum, string ProductId, int Quantity, string TransactionId);
/*
* Called when the async consume request completes
*/
delegate OnConsumeInventoryItemComplete(string ProductId, bool bDidSucceed, int NewQuantity);
/**
* Sets the delegate used to notify the gameplay code that the inventory consume request has completed
*/
function AddConsumeInventoryItemCompleteDelegate(byte LocalUserNum, delegate<OnConsumeInventoryItemComplete> ConsumeInventoryItemCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
`AddUniqueItemToArray(PerUserDelegates[LocalUserNum].ConsumeInventoryItemDelegates, ConsumeInventoryItemCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to AddConsumeInventoryItemCompleteDelegate()");
}
}
/**
* Clears the delegate used to notify the gameplay code that the inventory consume request has completed
*/
function ClearConsumeInventoryItemCompleteDelegate(byte LocalUserNum, delegate<OnConsumeInventoryItemComplete> ConsumeInventoryItemCompleteDelegate)
{
// Make sure the user is valid
if (LocalUserNum >= 0 && LocalUserNum < ArrayCount(PerUserDelegates))
{
PerUserDelegates[LocalUserNum].ConsumeInventoryItemDelegates.RemoveItem(ConsumeInventoryItemCompleteDelegate);
}
else
{
`warn("Invalid index ("$LocalUserNum$") passed to ClearConsumeInventoryItemCompleteDelegate()");
}
}
delegate OnMarketplaceItemPurchased();
function AddMarketplaceItemPurchasedDelegate( delegate<OnMarketplaceItemPurchased> InDelegate )
{
`AddUniqueItemToArray(OnMarketplaceItemPurchasedDelegates, InDelegate);
}
function ClearMarketplaceItemPurchasedDelegate( delegate<OnMarketplaceItemPurchased> InDelegate )
{
OnMarketplaceItemPurchasedDelegates.RemoveItem(InDelegate);
}
cpptext
{
/* Finds the cached marketplace products for this player. If not found,
* it creates an empty one with the state to OERS_NotStarted
*
* @param PlayerNum the number of the player that the products are cached for
* @param MediaType the type of media item to retrieve
*
* @return The set of cached products for the player
*/
FCachedMarketplaceProducts& GetCachedMarketplaceProducts(DWORD PlayerNum, EMediaItemType MediaType);
/* Finds the cached inventory items for this player. If not found,
* it creates an empty one with the state to OERS_NotStarted
*
* @param PlayerNum the number of the player that the inventory is cached for
* @param MediaType the type of inventory item to retrieve
*
* @return The set of cached inventory items for the player
*/
FCachedInventoryItems& GetCachedInventoryItems(DWORD PlayerNum, EMediaItemType MediaType);
}
defaultproperties
{
// as of August 2020
ConsumablesCount=80
DurablesCount=49
}

View File

@ -0,0 +1,382 @@
/**
* Copyright 1998-2012 Epic Games, Inc. All Rights Reserved.
*/
/**
* Class that implements a Dingo version of the game interface
*/
class OnlineStatsInterfaceDingo extends Object within OnlineSubsystemDingo
native
implements(OnlineStatsInterface)
config(Engine);
`include(KFGame\KFOnlineStats.uci);
/** The owning subsystem that this object is providing an implementation for */
var OnlineSubsystemDingo OwningSubsystem;
/** The stats interface will cancel any profile read that takes longer than this timeout */
var config float ReadProfileAsyncTimeout;
/** Track the current stats read so we don't allow more than one in-flight at a time */
var init array<native pointer> CurrentStatsRead{class FDingoAsyncTaskReadOnlineStats};
/** This is the list of delegates requesting notification when a stats read finishes */
var array<delegate<OnReadOnlineStatsComplete> > ReadOnlineStatsCompleteDelegates;
/** Used to initialize ETW events for stats */
var bool EventsRegistered;
enum RealTimeActivityConnectionStatus
{
RTA_NotConnected,
RTA_Connecting,
RTA_Connected
};
struct native RealTimeActivitySubscriptionData
{
var UniqueNetId PlayerNetId;
var name StatName;
var delegate<OnStatisticChanged> OnStatisticChanged;
//var native hatpointer RTAStatisticChangeSubscription{Microsoft::Xbox::Services::RealTimeActivity::RealTimeActivityStatisticChangeSubscription};
};
struct native XboxLiveContextPlayerData
{
var native hatpointer LiveContext{Microsoft::Xbox::Services::XboxLiveContext};
var UniqueNetId PlayerNetId;
var Guid PlayerSessionGuid;
var RealTimeActivityConnectionStatus MultiplayerSubscriptionStatus;
var RealTimeActivityConnectionStatus RTAConnectionStatus;
var array<RealTimeActivitySubscriptionData> RTASubscriptions;
//var native array<hatpointer> QueuedRTAChangeEvents {Microsoft::Xbox::Services::RealTimeActivity::RealTimeActivityStatisticChangeEventArgs};
var qword StatisticChangedTokenKey;
var qword WebSocketClosedTokenKey;
structcpptext
{
FXboxLiveContextPlayerData()
{
appMemzero(this, sizeof(FXboxLiveContextPlayerData));
}
void SubscribeToStatisticEvent(FUniqueNetId PlayerNetId, FName StatName, FScriptDelegate EventDelegate);
void UnsubscribeToStatisticEvent(FUniqueNetId PlayerNetId, FName StatName);
void Update();
private:
void ConnectToRTAService();
void OnRTAConnect();
void OnRTADisconnect();
//void OnRTAStatisticChanged(Microsoft::Xbox::Services::RealTimeActivity::RealTimeActivityStatisticChangeEventArgs^ args);
void OnRTAWebSocketClosed(Windows::Networking::Sockets::WebSocketClosedEventArgs^ args);
void SubscribeToRTA(FRealTimeActivitySubscriptionData& SubscriptionData);
void UnsubscribeToRTA(FRealTimeActivitySubscriptionData& SubscriptionData);
static FCriticalSection RTACriticalSection;
public:
}
};
var native map{QWORD, FXboxLiveContextPlayerData} PlayerXboxLiveContextMap;
/**
* Notifies the interested party that the last stats read has completed
*
* @param bWasSuccessful true if the async action completed without error, false if there was an error
*/
delegate OnReadOnlineStatsComplete(bool bWasSuccessful);
/**
* Reads a set of stats for a player
*
* @param LocalUserNum the local player having their stats queried
* @param StatsRead holds the names of the stats to be queried and
* results are copied into the specified object
*
* @return TRUE if the call is successful, FALSE otherwise
*/
native function bool ReadOnlineStatsForPlayer(byte LocalUserNum, OnlineStatsRead StatsRead);
/**
* Reads a set of stats for the specified list of players
*
* @param Players the array of unique ids to read stats for
* @param StatsRead holds the definitions of the tables to read the data from and
* results are copied into the specified object
*
* @return TRUE if the call is successful, FALSE otherwise
*/
native function bool ReadOnlineStats(byte LocalUserNum, const out array<UniqueNetId> Players,OnlineStatsRead StatsRead);
/**
* Reads a player's stats and all of that player's friends stats for the
* specified set of stat views. This allows you to easily compare a player's
* stats to their friends.
*
* @param LocalUserNum the local player having their stats and friend's stats read for
* @param StatsRead holds the definitions of the tables to read the data from and
* results are copied into the specified object
*
* @return TRUE if the call is successful, FALSE otherwise
*/
native function bool ReadOnlineStatsForFriends(byte LocalUserNum,OnlineStatsRead StatsRead, optional bool FavoriteFriendsOnly=false, optional int NumToRead = 100);
/**
* Reads stats by ranking. This grabs the rows starting at StartIndex through
* NumToRead and places them in the StatsRead object.
*
* @param StatsRead holds the definitions of the tables to read the data from and
* results are copied into the specified object
* @param StartIndex the starting rank to begin reads at (1 for top)
* @param NumToRead the number of rows to read (clamped at 100 underneath)
*
* @return TRUE if the call is successful, FALSE otherwise
*/
native function bool ReadOnlineStatsByRank(byte LocalUserNum, OnlineStatsRead StatsRead,optional int StartIndex = 1,optional int NumToRead = 100);
/**
* Reads stats by ranking centered around a player. This grabs a set of rows
* above and below the player's current rank
*
* @param LocalUserNum the local player having their stats being centered upon
* @param StatsRead holds the definitions of the tables to read the data from and
* results are copied into the specified object
* @param NumRows the number of rows to read above and below the player's rank
*
* @return TRUE if the call is successful, FALSE otherwise
*/
native function bool ReadOnlineStatsByRankAroundPlayer(byte LocalUserNum,OnlineStatsRead StatsRead,optional int NumRows = 10);
/**
* Adds the delegate to a list used to notify the gameplay code that the stats read has completed
*
* @param ReadOnlineStatsCompleteDelegate the delegate to use for notifications
*/
function AddReadOnlineStatsCompleteDelegate(delegate<OnReadOnlineStatsComplete> ReadOnlineStatsCompleteDelegate)
{
if (ReadOnlineStatsCompleteDelegates.Find(ReadOnlineStatsCompleteDelegate) == INDEX_NONE)
{
ReadOnlineStatsCompleteDelegates.AddItem(ReadOnlineStatsCompleteDelegate);
}
}
/**
* Removes the delegate from the notify list
*
* @param ReadOnlineStatsCompleteDelegate the delegate to use for notifications
*/
function ClearReadOnlineStatsCompleteDelegate(delegate<OnReadOnlineStatsComplete> ReadOnlineStatsCompleteDelegate)
{
local int RemoveIndex;
// Find it in the list
RemoveIndex = ReadOnlineStatsCompleteDelegates.Find(ReadOnlineStatsCompleteDelegate);
// Only remove if found
if (RemoveIndex != INDEX_NONE)
{
ReadOnlineStatsCompleteDelegates.Remove(RemoveIndex,1);
}
}
/**
* Cleans up any platform specific allocated data contained in the stats data
*
* @param StatsRead the object to handle per platform clean up on
*/
native function FreeStats(OnlineStatsRead StatsRead);
/**
* Writes out the stats contained within the stats write object to the online
* subsystem's cache of stats data. Note the new data replaces the old. It does
* not write the data to the permanent storage until a FlushOnlineStats() call
* or a session ends. Stats cannot be written without a session or the write
* request is ignored. No more than 5 stats views can be written to at a time
* or the write request is ignored.
*
* @param SessionName the name of the session to write stats for
* @param Player the player to write stats for
* @param StatsWrite the object containing the information to write
*
* @return TRUE if the call is successful, FALSE otherwise
*/
native function bool WriteOnlineStats(name SessionName, UniqueNetId Player, OnlineStatsWrite StatsWrite);
/**
* Commits any changes in the online stats cache to the permanent storage
*
* @param SessionName the name of the session having stats flushed
*
* @return TRUE if the call is successful, FALSE otherwise
*/
function bool FlushOnlineStats(name SessionName)
{
}
/**
* Delegate called when the stats flush operation has completed
*
* @param SessionName the name of the session having stats flushed
* @param bWasSuccessful true if the async action completed without error, false if there was an error
*/
delegate OnFlushOnlineStatsComplete(name SessionName,bool bWasSuccessful);
/**
* Adds the delegate used to notify the gameplay code that the stats flush has completed
*
* @param FlushOnlineStatsCompleteDelegate the delegate to use for notifications
*/
function AddFlushOnlineStatsCompleteDelegate(delegate<OnFlushOnlineStatsComplete> FlushOnlineStatsCompleteDelegate)
{
}
/**
* Clears the delegate used to notify the gameplay code that the stats flush has completed
*
* @param FlushOnlineStatsCompleteDelegate the delegate to use for notifications
*/
function ClearFlushOnlineStatsCompleteDelegate(delegate<OnFlushOnlineStatsComplete> FlushOnlineStatsCompleteDelegate)
{
}
/**
* Writes the score data for the match
*
* @param SessionName the name of the session to write scores for
* @param LeaderboardId the leaderboard to write the score information to
* @param PlayerScores the list of players, teams, and scores they earned
*
* @return TRUE if the call is successful, FALSE otherwise
*/
function bool WriteOnlinePlayerScores(name SessionName,int LeaderboardId,const out array<OnlinePlayerScore> PlayerScores)
{
}
/**
* Reads the host's stat guid for synching up stats. Only valid on the host.
*
* @return the host's stat guid
*/
function string GetHostStatGuid();
/**
* Registers the host's stat guid with the client for verification they are part of
* the stat. Note this is an async task for any backend communication that needs to
* happen before the registration is deemed complete
*
* @param HostStatGuid the host's stat guid
*
* @return TRUE if the call is successful, FALSE otherwise
*/
function bool RegisterHostStatGuid(const out string HostStatGuid);
/**
* Called when the host stat guid registration is complete
*
* @param bWasSuccessful whether the registration has completed or not
*/
delegate OnRegisterHostStatGuidComplete(bool bWasSuccessful);
/**
* Adds the delegate for notifying when the host guid registration is done
*
* @param RegisterHostStatGuidCompleteDelegate the delegate to use for notifications
*/
function AddRegisterHostStatGuidCompleteDelegate(delegate<OnRegisterHostStatGuidComplete> RegisterHostStatGuidCompleteDelegate);
/**
* Clears the delegate used to notify the gameplay code
*
* @param RegisterHostStatGuidCompleteDelegate the delegate to use for notifications
*/
function ClearRegisterHostStatGuidCompleteDelegateDelegate(delegate<OnRegisterHostStatGuidComplete> RegisterHostStatGuidCompleteDelegate);
/**
* Reads the client's stat guid that was generated by registering the host's guid
* Used for synching up stats. Only valid on the client. Only callable after the
* host registration has completed
*
* @return the client's stat guid
*/
function string GetClientStatGuid();
/**
* Registers the client's stat guid on the host to validate that the client was in the stat.
* Used for synching up stats. Only valid on the host.
*
* @param PlayerId the client's unique net id
* @param ClientStatGuid the client's stat guid
*
* @return TRUE if the call is successful, FALSE otherwise
*/
function bool RegisterStatGuid(UniqueNetId PlayerId,const out string ClientStatGuid);
/**
* Calculates the aggregate skill from an array of skills.
*
* @param Mus - array that holds the mu values
* @param Sigmas - array that holds the sigma values
* @param OutAggregateMu - aggregate Mu
* @param OutAggregateSigma - aggregate Sigma
*/
function CalcAggregateSkill(array<double> Mus, array<double> Sigmas, out double OutAggregateMu, out double OutAggregateSigma);
/**
* Delegate used when an event subscription is notified
*
* @param PlayerNetId: the player whos stat change caused the event to occur
* @param StatName: the name of the stat that changed
* @param NewStatValue: the new value of that stat
*/
delegate OnStatisticChanged(UniqueNetId PlayerNetId, name StatName, string NewStatValue);
/**
* Subscribe and unsubscribe from RTA events.
* Unfortunately these need to be tied to a User on the recieving end too since that is how the API is defined.
*
* @param LocalUserNum: the user that will be subscribed to listen for stat-event changes
* @param PlayerNetId: the (probably remote) player whos events we want to listen for
* @param StatName: the name of the stat that we want to get events for
* @param EventDelegate: the delegate that will be notified when a stat event occurs
*/
native function SubscribeToStatisticEvent(byte LocalUserNum, UniqueNetId PlayerNetId, name StatName, delegate<OnStatisticChanged> EventDelegate);
native function UnsubscribeToStatisticEvent(byte LocalUserNum, UniqueNetId PlayerNetId, name StatName);
//@HSL_BEGIN_XBOX - JRO - 1/23/2015 - Adding game events to update stats
function bool SendPlayerSessionStart(byte LocalUserNum, string MultiplayerCorrelationId, int GameplayModeId, int DifficultyLevelId);
function bool SendPlayerSessionEnd(byte LocalUserNum, string MultiplayerCorrelationId, int GameplayModeId, int DifficultyLevelId, int ExitStatusId);
function bool SendPlayerSessionPause(byte LocalUserNum, string MultiplayerCorrelationId);
function bool SendPlayerSessionResume(byte LocalUserNum, string MultiplayerCorrelationId, int GameplayModeId, int DifficultyLevelId);
function bool SendTestEvent(byte LocalUserNum, string TestStatInstancing, int TestStatParameter);
//@HSL_END_XBOX
cpptext
{
/**
* Handles updating of any async tasks that need to be performed
*
* @param DeltaTime the amount of time that has passed since the last tick
*/
virtual void Tick(FLOAT DeltaTime);
/**
* Retrieves or creates the LiveContextUserData for a particular player
*/
FXboxLiveContextPlayerData* GetLiveContextDataForLocalPlayer(BYTE LocalUserNum);
void RemoveXboxLiveContextPlayerData(QWORD Xuid);
/**
* Updates each XboxLiveContextPlayerData so that they can handle messages from callbacks received on other threads
*/
void TickXboxLiveContextDatas();
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,147 @@
/**
* Copyright 1998-2012 Epic Games, Inc. All Rights Reserved.
*/
/**
* Class that implements a Dingo version of the game interface
*/
class OnlineTitleFileInterfaceDingo extends Object within OnlineSubsystemDingo
native
implements(OnlineTitleFileInterface)
config(Engine);
/** The owning subsystem that this object is providing an implementation for */
var OnlineSubsystemDingo OwningSubsystem;
var array<delegate<OnReadTitleFileComplete> > ReadTitleFileCompleteDelegates;
var array<delegate<OnRequestTitleFileListComplete> > RequestTitleFileListCompleteDelegates;
/** Add the file size for our tracking purposes */
struct native TitleFileDingo extends OnlineSubsystem.TitleFile
{
var int FileSize;
};
var array<TitleFileDingo> TitleManagedFiles;
/**
* Delegate fired when a file read from the network platform's title specific storage is complete
*
* @param bWasSuccessful whether the file read was successful or not
* @param FileName the name of the file this was for
*/
delegate OnReadTitleFileComplete(bool bWasSuccessful,string FileName);
/**
* Starts an asynchronous read of the specified file from the network platform's
* title specific file store
*
* @param FileToRead the name of the file to read
*
* @return true if the calls starts successfully, false otherwise
*/
native function bool ReadTitleFile(string FileToRead, optional EOnlineFileType FileType = OFT_Binary);
/**
* Adds the delegate to the list to be notified when a requested file has been read
*
* @param ReadTitleFileCompleteDelegate the delegate to add
*/
function AddReadTitleFileCompleteDelegate(delegate<OnReadTitleFileComplete> ReadTitleFileCompleteDelegate)
{
`AddUniqueItemToArray(ReadTitleFileCompleteDelegates, ReadTitleFileCompleteDelegate);
}
/**
* Removes the delegate from the notify list
*
* @param ReadTitleFileCompleteDelegate the delegate to remove
*/
function ClearReadTitleFileCompleteDelegate(delegate<OnReadTitleFileComplete> ReadTitleFileCompleteDelegate)
{
ReadTitleFileCompleteDelegates.RemoveItem(ReadTitleFileCompleteDelegate);
}
/**
* Copies the file data into the specified buffer for the specified file
*
* @param FileName the name of the file to read
* @param FileContents the out buffer to copy the data into
*
* @return true if the data was copied, false otherwise
*/
native function bool GetTitleFileContents(string FileName,out array<byte> FileContents);
/**
* Determines the async state of the tile file read operation
*
* @param FileName the name of the file to check on
*
* @return the async state of the file read
*/
function EOnlineEnumerationReadState GetTitleFileState(string FileName)
{
local int FileIndex;
FileIndex = TitleManagedFiles.Find('FileName',FileName);
if (FileIndex != INDEX_NONE)
{
return TitleManagedFiles[FileIndex].AsyncState;
}
return OERS_Failed;
}
/**
* Empties the set of downloaded files if possible (no async tasks outstanding)
*
* @return true if they could be deleted, false if they could not
*/
native function bool ClearDownloadedFiles();
/**
* Empties the cached data for this file if it is not being downloaded currently
*
* @param FileName the name of the file to remove from the cache
*
* @return true if it could be deleted, false if it could not
*/
native function bool ClearDownloadedFile(string FileName);
/**
* Async call to request a list of files (returned as string) from EMS
*/
native function bool RequestTitleFileList();
/**
* Delegate fired when the request for a list of files completes
*
* @param bWasSuccessful whether the request completed successfully
* @param ResultStr contains the list of files and associated meta data
*/
delegate OnRequestTitleFileListComplete(bool bWasSuccessful, array<string> FilePaths);
/**
* Adds the delegate to the list to be notified when the list of requested files has been received
*
* @param RequestTitleFileListDelegate the delegate to add
*/
function AddRequestTitleFileListCompleteDelegate(delegate<OnRequestTitleFileListComplete> RequestTitleFileListDelegate)
{
`AddUniqueItemToArray(RequestTitleFileListCompleteDelegates, RequestTitleFileListDelegate);
}
/**
* Removes the delegate from the notify list
*
* @param RequestTitleFileListDelegate the delegate to remove
*/
function ClearRequestTitleFileListCompleteDelegate(delegate<OnRequestTitleFileListComplete> RequestTitleFileListDelegate)
{
RequestTitleFileListCompleteDelegates.RemoveItem(RequestTitleFileListDelegate);
}
cpptext
{
Microsoft::Xbox::Services::XboxLiveContext^ GetContext();
UBOOL TitleFileExists(const FString& FileName, FTitleFileDingo*& TitleFileData);
FTitleFileDingo& GetOrCreateTitleFileData(const FString& FileName);
}