Search Results for

    Show / Hide Table of Contents

    Interface IOnlinePlatform

    Interface for online platform providers for communicating with various multiplayer services such as player info, achievements, game lobby or in-game store.

    Namespace: FlaxEngine.Online
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public interface IOnlinePlatform

    Methods

    Deinitialize()

    Shutdowns the online platform services.

    Declaration
    [Unmanaged]
    void Deinitialize()
    Remarks

    Called only by Online system. Can be used to destroy the object.

    GetAchievements(out OnlineAchievement[], User)

    Gets the list of all achievements for this game.

    Declaration
    [Unmanaged]
    bool GetAchievements(out OnlineAchievement[] achievements, User localUser = null)
    Parameters
    OnlineAchievement[] achievements

    The result achievements list

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetFriends(out OnlineUser[], User)

    Gets the list of friends of the user from the online platform.

    Declaration
    [Unmanaged]
    bool GetFriends(out OnlineUser[] friends, User localUser = null)
    Parameters
    OnlineUser[] friends

    The result local player friends user infos.

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetLeaderboard(String, out OnlineLeaderboard, User)

    Gets the online leaderboard.

    Declaration
    [Unmanaged]
    bool GetLeaderboard(string name, out OnlineLeaderboard value, User localUser = null)
    Parameters
    System.String name

    The leaderboard name.

    OnlineLeaderboard value

    The result value.

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetLeaderboardEntries(OnlineLeaderboard, out OnlineLeaderboardEntry[], Int32, Int32)

    Gets the online leaderboard entries. Allows to specify the range for ranks to gather.

    Declaration
    [Unmanaged]
    bool GetLeaderboardEntries(OnlineLeaderboard leaderboard, out OnlineLeaderboardEntry[] entries, int start = 0, int count = 10)
    Parameters
    OnlineLeaderboard leaderboard

    The leaderboard.

    OnlineLeaderboardEntry[] entries

    The list of result entries.

    System.Int32 start

    The zero-based index to start downloading entries from. For example, to display the top 10 on a leaderboard pass value of 0.

    System.Int32 count

    The amount of entries to read, starting from the first entry at start.

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetLeaderboardEntriesAroundUser(OnlineLeaderboard, out OnlineLeaderboardEntry[], Int32, Int32)

    Gets the online leaderboard entries around the player. Allows to specify the range for ranks to gather around the user rank. The current user's entry is always included.

    Declaration
    [Unmanaged]
    bool GetLeaderboardEntriesAroundUser(OnlineLeaderboard leaderboard, out OnlineLeaderboardEntry[] entries, int start = -4, int count = 10)
    Parameters
    OnlineLeaderboard leaderboard

    The leaderboard.

    OnlineLeaderboardEntry[] entries

    The list of result entries.

    System.Int32 start

    The zero-based index to start downloading entries relative to the user. For example, to display the 4 higher scores on a leaderboard pass value of -4. Value 0 will return current user as the first one.

    System.Int32 count

    The amount of entries to read, starting from the first entry at start.

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetLeaderboardEntriesForFriends(OnlineLeaderboard, out OnlineLeaderboardEntry[])

    Gets the online leaderboard entries for player friends.

    Declaration
    [Unmanaged]
    bool GetLeaderboardEntriesForFriends(OnlineLeaderboard leaderboard, out OnlineLeaderboardEntry[] entries)
    Parameters
    OnlineLeaderboard leaderboard

    The leaderboard.

    OnlineLeaderboardEntry[] entries

    The list of result entries.

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetLeaderboardEntriesForUsers(OnlineLeaderboard, out OnlineLeaderboardEntry[], OnlineUser[])

    Gets the online leaderboard entries for an arbitrary set of users.

    Declaration
    [Unmanaged]
    bool GetLeaderboardEntriesForUsers(OnlineLeaderboard leaderboard, out OnlineLeaderboardEntry[] entries, OnlineUser[] users)
    Parameters
    OnlineLeaderboard leaderboard

    The leaderboard.

    OnlineLeaderboardEntry[] entries

    The list of result entries.

    OnlineUser[] users

    The list of users to read their ranks on the leaderboard.

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetOrCreateLeaderboard(String, OnlineLeaderboardSortModes, OnlineLeaderboardValueFormats, out OnlineLeaderboard, User)

    Gets or creates the online leaderboard. It will not create it if already exists.

    Declaration
    [Unmanaged]
    bool GetOrCreateLeaderboard(string name, OnlineLeaderboardSortModes sortMode, OnlineLeaderboardValueFormats valueFormat, out OnlineLeaderboard value, User localUser = null)
    Parameters
    System.String name

    The leaderboard name.

    OnlineLeaderboardSortModes sortMode

    The leaderboard sorting mode.

    OnlineLeaderboardValueFormats valueFormat

    The leaderboard values formatting.

    OnlineLeaderboard value

    The result value.

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetSaveGame(String, out Byte[], User)

    Gets the online savegame data. Returns empty if savegame slot is unused.

    Declaration
    [Unmanaged]
    bool GetSaveGame(string name, out byte[] data, User localUser = null)
    Parameters
    System.String name

    The savegame slot name.

    System.Byte[] data

    The result data. Empty or null for unused slot name.

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetStat(String, out Single, User)

    Gets the online statistical value.

    Declaration
    [Unmanaged]
    bool GetStat(string name, out float value, User localUser = null)
    Parameters
    System.String name

    The stat name.

    System.Single value

    The result value.

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetUser(out OnlineUser, User)

    Gets the player from the online platform.

    Declaration
    [Unmanaged]
    bool GetUser(out OnlineUser user, User localUser = null)
    Parameters
    OnlineUser user

    The local player user info.

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    GetUserLoggedIn(User)

    Checks if the local user is logged in.

    Declaration
    [Unmanaged]
    bool GetUserLoggedIn(User localUser = null)
    Parameters
    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if user is logged, otherwise false.

    Initialize()

    Initializes the online platform services.

    Declaration
    [Unmanaged]
    bool Initialize()
    Returns
    System.Boolean

    True if failed, otherwise false.

    Remarks

    Called only by Online system.

    ResetAchievements(User)

    Resets the all achievements progress for this game.

    Declaration
    [Unmanaged]
    bool ResetAchievements(User localUser = null)
    Parameters
    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    SetLeaderboardEntry(OnlineLeaderboard, Int32, Boolean)

    Sets the online leaderboard entry for the user.

    Declaration
    [Unmanaged]
    bool SetLeaderboardEntry(OnlineLeaderboard leaderboard, int score, bool keepBest = false)
    Parameters
    OnlineLeaderboard leaderboard

    The leaderboard.

    System.Int32 score

    The score value to set.

    System.Boolean keepBest

    True if store value only if it's better than existing value (if any), otherwise will override any existing score for that user.

    Returns
    System.Boolean

    True if failed, otherwise false.

    SetSaveGame(String, Byte[], User)

    Sets the online savegame data.

    Declaration
    [Unmanaged]
    bool SetSaveGame(string name, byte[] data, User localUser = null)
    Parameters
    System.String name

    The savegame slot name.

    System.Byte[] data

    The data. Empty or null to delete slot (or mark as unused).

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    SetStat(String, Single, User)

    Sets the online statistical value.

    Declaration
    [Unmanaged]
    bool SetStat(string name, float value, User localUser = null)
    Parameters
    System.String name

    The stat name.

    System.Single value

    The value.

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    UnlockAchievement(String, User)

    Unlocks the achievement.

    Declaration
    [Unmanaged]
    bool UnlockAchievement(string name, User localUser = null)
    Parameters
    System.String name

    The achievement name. Specific for a game.

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    UnlockAchievementProgress(String, Single, User)

    Updates the achievement unlocking progress (in range 0-100).

    Declaration
    [Unmanaged]
    bool UnlockAchievementProgress(string name, float progress, User localUser = null)
    Parameters
    System.String name

    The achievement name. Specific for a game.

    System.Single progress

    The achievement unlock progress (in range 0-100).

    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    UserLogin(User)

    Logins the local user into the online platform.

    Declaration
    [Unmanaged]
    bool UserLogin(User localUser = null)
    Parameters
    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    UserLogout(User)

    Logout the local user from the online platform.

    Declaration
    [Unmanaged]
    bool UserLogout(User localUser = null)
    Parameters
    User localUser

    The local user (null if use default one).

    Returns
    System.Boolean

    True if failed, otherwise false.

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat