Always snap to grid

UE3:OnlineStatsInterface (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UDK Interface >> OnlineStatsInterface
Package: 
Engine
Known implementing classes:
OnlineSubsystemPC
This interface in other games:
UT3

This interface deals with reading & writing stats to the online subsytem.

Delegates[edit]

OnFlushOnlineStatsComplete[edit]

delegate OnFlushOnlineStatsComplete (name SessionName, bool bWasSuccessful)

Delegate called when the stats flush operation has completed

Parameters:

  • SessionName - the name of the session having stats flushed for
  • bWasSuccessful - true if the async action completed without error, false if there was an error

OnReadOnlineStatsComplete[edit]

delegate OnReadOnlineStatsComplete (bool bWasSuccessful)

Notifies the interested party that the last stats read has completed

Parameters:

  • bWasSuccessful - true if the async action completed without error, false if there was an error

OnRegisterHostStatGuidComplete[edit]

delegate OnRegisterHostStatGuidComplete (bool bWasSuccessful)

Called when the host stat guid registration is complete

Parameters:

  • bWasSuccessful - whether the registration has completed or not

Instance functions[edit]

AddFlushOnlineStatsCompleteDelegate[edit]

function AddFlushOnlineStatsCompleteDelegate (delegate<OnFlushOnlineStatsCompleteFlushOnlineStatsCompleteDelegate)

Adds the delegate used to notify the gameplay code that the stats flush has completed

Parameters:

  • FlushOnlineStatsCompleteDelegate - the delegate to use for notifications

AddReadOnlineStatsCompleteDelegate[edit]

function AddReadOnlineStatsCompleteDelegate (delegate<OnReadOnlineStatsCompleteReadOnlineStatsCompleteDelegate)

Adds the delegate to a list used to notify the gameplay code that the stats read has completed

Parameters:

  • ReadOnlineStatsCompleteDelegate - the delegate to use for notifications

AddRegisterHostStatGuidCompleteDelegate[edit]

function AddRegisterHostStatGuidCompleteDelegate (delegate<OnRegisterHostStatGuidCompleteRegisterHostStatGuidCompleteDelegate)

Adds the delegate for notifying when the host guid registration is done

Parameters:

  • RegisterHostStatGuidCompleteDelegate - the delegate to use for notifications

ClearFlushOnlineStatsCompleteDelegate[edit]

function ClearFlushOnlineStatsCompleteDelegate (delegate<OnFlushOnlineStatsCompleteFlushOnlineStatsCompleteDelegate)

Clears the delegate used to notify the gameplay code that the stats flush has completed

Parameters:

  • FlushOnlineStatsCompleteDelegate - the delegate to use for notifications

ClearReadOnlineStatsCompleteDelegate[edit]

function ClearReadOnlineStatsCompleteDelegate (delegate<OnReadOnlineStatsCompleteReadOnlineStatsCompleteDelegate)

Removes the delegate from the notify list

Parameters:

  • ReadOnlineStatsCompleteDelegate - the delegate to use for notifications

ClearRegisterHostStatGuidCompleteDelegateDelegate[edit]

function ClearRegisterHostStatGuidCompleteDelegateDelegate (delegate<OnRegisterHostStatGuidCompleteRegisterHostStatGuidCompleteDelegate)

Clears the delegate used to notify the gameplay code

Parameters:

  • RegisterHostStatGuidCompleteDelegate - the delegate to use for notifications

FlushOnlineStats[edit]

function bool FlushOnlineStats (name SessionName)

Commits any changes in the online stats cache to the permanent storage

Parameters:

  • SessionName - the name of the session having stats flushed for

Returns:

TRUE if the call is successful, FALSE otherwise

FreeStats[edit]

function FreeStats (OnlineStatsRead StatsRead)

Cleans up any platform specific allocated data contained in the stats data

Parameters:

  • StatsRead - the object to handle per platform clean up on

GetClientStatGuid[edit]

function string GetClientStatGuid ()

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

Returns:

the client's stat guid

GetHostStatGuid[edit]

function string GetHostStatGuid ()

Reads the host's stat guid for synching up stats. Only valid on the host.

Returns:

the host's stat guid

ReadOnlineStats[edit]

function bool ReadOnlineStats (const out array<OnlineSubsystem.UniqueNetIdPlayers, OnlineStatsRead StatsRead)

Reads a set of stats for the specified list of players

Parameters:

  • Players - the array of unique ids to read stats for
  • StatsRead - holds the definitions of the tables to read the data from and results are copied into the specified object

Returns:

TRUE if the call is successful, FALSE otherwise

ReadOnlineStatsByRank[edit]

function bool ReadOnlineStatsByRank (OnlineStatsRead StatsRead, optional int StartIndex, optional int NumToRead)

Reads stats by ranking. This grabs the rows starting at StartIndex through NumToRead and places them in the StatsRead object.

Parameters:

  • StatsRead - holds the definitions of the tables to read the data from and results are copied into the specified object
  • StartIndex - the starting rank to begin reads at (1 for top)
  • NumToRead - the number of rows to read (clamped at 100 underneath)

Returns:

TRUE if the call is successful, FALSE otherwise

ReadOnlineStatsByRankAroundPlayer[edit]

function bool ReadOnlineStatsByRankAroundPlayer (byte LocalUserNum, OnlineStatsRead StatsRead, optional int NumRows)

Reads stats by ranking centered around a player. This grabs a set of rows above and below the player's current rank

Parameters:

  • LocalUserNum - the local player having their stats being centered upon
  • StatsRead - holds the definitions of the tables to read the data from and results are copied into the specified object
  • NumRows - the number of rows to read above and below the player's rank

Returns:

TRUE if the call is successful, FALSE otherwise

ReadOnlineStatsForFriends[edit]

function bool ReadOnlineStatsForFriends (byte LocalUserNum, 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.

Parameters:

  • LocalUserNum - the local player having their stats and friend's stats read for
  • StatsRead - holds the definitions of the tables to read the data from and results are copied into the specified object

Returns:

TRUE if the call is successful, FALSE otherwise

RegisterHostStatGuid[edit]

function bool RegisterHostStatGuid (const out string HostStatGuid)

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

Parameters:

  • HostStatGuid - the host's stat guid

Returns:

TRUE if the call is successful, FALSE otherwise

RegisterStatGuid[edit]

function bool RegisterStatGuid (OnlineSubsystem.UniqueNetId PlayerId, const out string ClientStatGuid)

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.

Parameters:

  • PlayerId - the client's unique net id
  • ClientStatGuid - the client's stat guid

Returns:

TRUE if the call is successful, FALSE otherwise

WriteOnlinePlayerScores[edit]

function bool WriteOnlinePlayerScores (name SessionName, int LeaderboardId, const out array<OnlineSubsystem.OnlinePlayerScorePlayerScores)

Writes the score data for the match

Parameters:

  • SessionName - the name of the session the player stats are being recorded for
  • LeaderboardId - the leaderboard to write the score information to
  • PlayerScores - the list of players, teams, and scores they earned

Returns:

TRUE if the call is successful, FALSE otherwise

WriteOnlineStats[edit]

function bool WriteOnlineStats (name SessionName, OnlineSubsystem.UniqueNetId Player, OnlineStatsWrite StatsWrite)

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.

Parameters:

  • SessionName - the name of the session the stats are being written to
  • Player - the player to write stats for
  • StatsWrite - the object containing the information to write

Returns:

TRUE if the call is successful, FALSE otherwise