Class MultiplayerSystem
Defined in File MultiplayerSystem.h
Inheritance Relationships
Base Type
public csp::systems::SystemBase(Class SystemBase)
Class Documentation
-
class MultiplayerSystem : public csp::systems::SystemBase
Public facing system that allows interfacing with Magnopus Connected Services’ multiplayer api.
Offers methods for managing realtime state via REST calls.
Public Functions
-
MultiplayerSystem(csp::web::WebClient *WebClient, csp::systems::SpaceSystem &SpaceSystem, csp::common::LogSystem &LogSystem)
-
MultiplayerSystem()
-
~MultiplayerSystem()
-
void GetScopesBySpace(const csp::common::String &SpaceId, ScopesResultCallback Callback)
Gets all scopes associated with the given space id.
Note: These functions are currently not exported, as they are only used for testing, as we haven’t fully implemented scopes within csp.
- Parameters
SpaceId – const csp::common::String& : The id of the space we want to get scopes for.
Callback – csp::systems::ScopesResultCallback : Callback when the scopes are retrieved, or on failure.
- Pre
Must already have entered the space of the SpaceId parameter. A CSP error will be sent to the LogSystem if this condition is not met, with a EResultCode::Failed response.
-
void UpdateScopeById(const csp::common::String &ScopeId, const csp::systems::Scope &Scope, ScopeResultCallback Callback)
Updates Data on a scope.
Note: These functions are currently not exported, as they are only used for testing, as we haven’t fully implemented scopes within csp.
- Parameters
ScopeId – const csp::common::String& : The id of the scope we want to update.
Scope – const csp::systems::Scope& : Scope containing new values for the given id.
Callback – csp::systems::ScopesResultCallback : Callback when asynchronous task finishes.
-
void GetScopeLeader(const csp::common::String &ScopeId, ScopeLeaderResultCallback Callback)
Gets details about a scope leader.
Note: These functions are currently not exported, as they are only used for testing, as we haven’t fully implemented scopes within csp.
- Parameters
ScopeId – const csp::common::String& : The id of the scope we want to get scope leader details about.
Callback – csp::systems::ScopesResultCallback : Callback when asynchronous task finishes.
- Pre
“ManagedLeaderElection” should be set to true on the scope, otherwise this function will fail with a EResultCode::Failed response.
- Pre
Must already have entered the space of the SpaceId parameter.
-
void __PerformLeaderElectionInScope(const csp::common::String &ScopeId, const csp::common::Optional<csp::common::Array<csp::common::String>> &UserIdsToExclude, NullResultCallback Callback)
Starts leader election for the given scope.
Note: These functions are currently not exported, as they are only used for testing, as we haven’t fully implemented scopes within csp. This should not need to be called outside of testing, as leader election is done automatically.
- Parameters
ScopeId – const csp::common::String& : The id of the scope we want to start leader election for.
UserIdsToExclude – const csp::common::Optional<csp::common::Array<csp::common::String>>& : A list of user ids we don’t want to consider for election.
Callback – csp::systems::ScopesResultCallback : Callback when asynchronous task finishes.
- Pre
“ManagedLeaderElection” should be set to true on the scope, otherwise this function will fail with a EResultCode::Failed response.
- Pre
Must already have entered the space of the SpaceId parameter.
-
MultiplayerSystem(csp::web::WebClient *WebClient, csp::systems::SpaceSystem &SpaceSystem, csp::common::LogSystem &LogSystem)