Multiplayer namespace
Multiplayer-related classes, compiled only if WITH_MULTIPLAYER.
Classes
- struct AllPeersT
- All connected peers tag type.
- struct ConnectionResult
- Describes a connection result of INetworkHandler::
OnPeerConnected(). - class INetworkHandler
- Interface to handle incomming network requests.
- class IServerObserver
- Interface to observe publicly-listed running servers.
- class IServerStatusProvider
- Interface to provide current status of the server.
- struct LocalPeerT
- Local peer tag type.
- class MpLevelHandler
- Level handler of an online multiplayer game session.
- class NetworkManager
- Manages game-specific network connections.
- class NetworkManagerBase
- Allows to create generic network clients and servers.
- struct Peer
- Remote peer as opaque handle.
- struct PeerDescriptor
- Peer descriptor.
- struct PlaylistEntry
- Playlist entry in ServerConfiguration.
- struct ServerConfiguration
- Server configuration.
- struct ServerDescription
- Server description.
- class ServerDiscovery
- Allows to monitor publicly-listed running servers for server listing.
- struct ServerInitialization
- Server initialization parameters.
Enums
- enum class MpGameMode { Unknown = 0, Battle, TeamBattle, Race, TeamRace, TreasureHunt, TeamTreasureHunt, CaptureTheFlag, Cooperation }
- Multiplayer game mode.
-
enum class NetworkChannel : std::
uint8_t { Main, UnreliableUpdates, Count } - Network packet channel.
- enum class NetworkState { None, Listening, Connecting, Connected }
- State of network connection.
- enum class BroadcastPacketType { Null, DiscoveryRequest, DiscoveryResponse }
- Packet type broadcasted on the local network.
- enum class ClientPacketType { Null, Ping, Reserved, Rpc, Auth = 10, LevelReady, ChatMessage, ValidateAssetsResponse, ForceResyncActors = 20, PlayerReady = 30, PlayerUpdate, PlayerKeyPress, PlayerChangeWeaponRequest, PlayerSpectateRequest, PlayerAckWarped, PlayerChangeCharacter }
- Packet type going from client to server.
- enum class ServerPacketType { Null, Pong, Reserved, Rpc, AuthResponse = 70, PeerSetProperty, ValidateAssets, StreamAsset, LoadLevel = 80, LevelSetProperty, LevelResetProperties, ShowInGameLobby, FadeOut, PlaySfx, PlayCommonSfx, ShowAlert, ChatMessage, SyncTileMap, SetTrigger, AdvanceTileAnimation, RevertTileAnimation, CreateDebris, CreateControllablePlayer = 110, CreateRemoteActor, CreateMirroredActor, DestroyRemoteActor, UpdateAllActors, ChangeRemoteActorMetadata, MarkRemoteActorAsPlayer, UpdatePositionsInRound, PlayerSetProperty = 130, PlayerResetProperties, PlayerRespawn, PlayerMoveInstantly, PlayerAckWarped, PlayerActivateForce, PlayerEmitWeaponFlare, PlayerChangeWeapon, PlayerTakeDamage, PlayerPush, PlayerActivateSpring, PlayerWarpIn }
- Packet type going from server to client.
- enum class PeerPropertyType { Unknown, Connected, Disconnected, Roasted, Count }
- Peer property type from ServerPacketType::
PeerSetProperty. - enum class LevelPropertyType { Unknown, State = 1, GameMode, LevelText = 10, Music, Count }
- Level property type from ServerPacketType::
LevelSetProperty. - enum class PlayerPropertyType { Unknown, PlayerType = 1, Lives, Health, Controllable, Invulnerable, Modifier, Dizzy, Freeze, Shield, LimitCameraView, OverrideCameraView, ShakeCameraView, Spectate, WeaponAmmo = 30, WeaponUpgrades, Coins = 60, Gems, Score, Points = 90, PositionInRound, Deaths, Kills, Laps, TreasureCollected, Count }
- Player property type from ServerPacketType::
PlayerSetProperty. - enum class PeerLevelState { Unknown, ValidatingAssets, StreamingMissingAssets, LevelLoaded, LevelSynchronized, Spectating, PlayerReady, PlayerSpawned }
- Peer state in a level.
-
enum class SpectateMode : std::
uint8_t { None, Forced, Requested, FreeCamera = 0x10, Mask = 0x0F } - Spectate mode flags.
-
enum class Reason : std::
uint32_t { Unknown, Disconnected, InvalidParameter, IncompatibleVersion, ProtocolViolation, SecurityPolicyViolation, AuthFailed, InvalidPassword, InvalidPlayerName, NotInWhitelist, Requires3rdPartyAuthProvider, ServerIsFull, ServerNotReady, ServerStopped, ServerStoppedForMaintenance, ServerStoppedForReconfiguration, ServerStoppedForUpdate, ConnectionLost, ConnectionTimedOut, Kicked, Banned, CheatingDetected, AssetStreamingNotAllowed, Idle } - Client disconnect reason.
Variables
- AllPeersT AllPeers constexpr
- All connected peers tag.
- LocalPeerT LocalPeer constexpr
- Local peer tag.
Enum documentation
enum class Jazz2:: Multiplayer:: MpGameMode
#include <Jazz2/Multiplayer/MpGameMode.h>
Multiplayer game mode.
| Enumerators | |
|---|---|
| Unknown |
Unspecified |
| Battle |
Battle |
| TeamBattle |
Team Battle |
| Race |
Race |
| TeamRace |
Team Race |
| TreasureHunt |
Treasure Hunt |
| TeamTreasureHunt |
Team Treasure Hunt |
| CaptureTheFlag |
Capture The Flag |
| Cooperation |
Cooperation |
enum class Jazz2:: Multiplayer:: NetworkChannel : std:: uint8_t
Network packet channel.
| Enumerators | |
|---|---|
| Main |
Main |
| UnreliableUpdates |
Unreliable updates |
| Count |
Count of supported channels |
enum class Jazz2:: Multiplayer:: NetworkState
State of network connection.
| Enumerators | |
|---|---|
| None |
Disconnected |
| Listening |
Listening as server |
| Connecting |
Connecting to server as client |
| Connected |
Connected to server as client |
enum class Jazz2:: Multiplayer:: BroadcastPacketType
#include <Jazz2/Multiplayer/PacketTypes.h>
Packet type broadcasted on the local network.
| Enumerators | |
|---|---|
| Null |
Empty packet |
| DiscoveryRequest |
Request to discover servers on the local network |
| DiscoveryResponse |
Response of a server to a discovery request |
enum class Jazz2:: Multiplayer:: ClientPacketType
#include <Jazz2/Multiplayer/PacketTypes.h>
Packet type going from client to server.
| Enumerators | |
|---|---|
| Null |
Empty packet |
| Ping |
Ping request to measure round trip time |
| Reserved |
Reserved |
| Rpc |
Remote procedure call forwarded to a scripted actor |
| Auth |
Authentication request |
| LevelReady |
Notifies the server that the level finished loading |
| ChatMessage |
Chat message sent to the server |
| ValidateAssetsResponse |
Response to a server request to validate required assets |
| ForceResyncActors |
Requests the server to resynchronize all actors |
| PlayerReady |
Notifies the server that the player is ready to spawn |
| PlayerUpdate |
Periodic update of the local player state |
| PlayerKeyPress |
Player input state |
| PlayerChangeWeaponRequest |
Requests a weapon change |
| PlayerSpectateRequest |
Requests to enable or disable spectate mode |
| PlayerAckWarped |
Acknowledges that the player has been warped |
| PlayerChangeCharacter |
Requests to change the player character |
enum class Jazz2:: Multiplayer:: ServerPacketType
#include <Jazz2/Multiplayer/PacketTypes.h>
Packet type going from server to client.
| Enumerators | |
|---|---|
| Null |
Empty packet |
| Pong |
Response to a ping request |
| Reserved |
Reserved |
| Rpc |
Remote procedure call forwarded to a scripted actor |
| AuthResponse |
Response to an authentication request |
| PeerSetProperty |
Sets a property of a peer |
| ValidateAssets |
Requests the client to validate its required assets |
| StreamAsset |
Streams a missing asset to the client |
| LoadLevel |
Requests the client to load a level |
| LevelSetProperty |
Sets a property of the current level |
| LevelResetProperties |
|
| ShowInGameLobby |
Requests the client to show the in-game lobby |
| FadeOut |
Requests the client to fade out the screen |
| PlaySfx |
Plays a sound effect attached to an actor |
| PlayCommonSfx |
Plays a common sound effect at a position |
| ShowAlert |
|
| ChatMessage |
Chat message broadcasted to the client |
| SyncTileMap |
Synchronizes the state of the tile map |
| SetTrigger |
Sets the state of a trigger |
| AdvanceTileAnimation |
Advances a destructible tile animation |
| RevertTileAnimation |
|
| CreateDebris |
Creates particle or sprite debris |
| CreateControllablePlayer |
Creates a player controllable by the client |
| CreateRemoteActor |
Creates a remote actor on the client |
| CreateMirroredActor |
Creates a mirrored actor on the client |
| DestroyRemoteActor |
Destroys a remote actor on the client |
| UpdateAllActors |
Periodic update of all remote actors |
| ChangeRemoteActorMetadata |
Changes metadata of a remote actor |
| MarkRemoteActorAsPlayer |
Marks a remote actor as another player |
| UpdatePositionsInRound |
Updates player positions in the current round |
| PlayerSetProperty |
Sets a property of a player |
| PlayerResetProperties |
Resets all properties of a player |
| PlayerRespawn |
Respawns a player |
| PlayerMoveInstantly |
Moves a player instantly to a position |
| PlayerAckWarped |
|
| PlayerActivateForce |
|
| PlayerEmitWeaponFlare |
Emits a weapon flare from a player |
| PlayerChangeWeapon |
Changes the current weapon of a player |
| PlayerTakeDamage |
Applies damage to a player |
| PlayerPush |
Pushes a player |
| PlayerActivateSpring |
Activates a spring under a player |
| PlayerWarpIn |
Warps a player into the level |
enum class Jazz2:: Multiplayer:: PeerPropertyType
#include <Jazz2/Multiplayer/PacketTypes.h>
Peer property type from ServerPacketType::
| Enumerators | |
|---|---|
| Unknown |
Unknown |
| Connected |
Peer connected |
| Disconnected |
Peer disconnected |
| Roasted |
Peer was roasted (killed) |
| Count |
Count of supported property types |
enum class Jazz2:: Multiplayer:: LevelPropertyType
#include <Jazz2/Multiplayer/PacketTypes.h>
Level property type from ServerPacketType::
| Enumerators | |
|---|---|
| Unknown |
Unknown |
| State |
Level state |
| GameMode |
Game mode |
| LevelText |
|
| Music |
Currently playing music |
| Count |
Count of supported property types |
enum class Jazz2:: Multiplayer:: PlayerPropertyType
#include <Jazz2/Multiplayer/PacketTypes.h>
Player property type from ServerPacketType::
| Enumerators | |
|---|---|
| Unknown |
Unknown |
| PlayerType |
Player type (character) |
| Lives |
Remaining lives |
| Health |
Current health |
| Controllable |
Whether the player is controllable |
| Invulnerable |
Invulnerability state |
| Modifier |
Active modifier (e.g. copter, frog) |
| Dizzy |
Dizziness state |
| Freeze |
Freeze state |
| Shield |
Active shield |
| LimitCameraView |
Camera view limit |
| OverrideCameraView |
Camera view override |
| ShakeCameraView |
Camera shake |
| Spectate |
Spectate mode state |
| WeaponAmmo |
Ammo of a weapon |
| WeaponUpgrades |
Upgrades of a weapon |
| Coins |
Collected coins |
| Gems |
Collected gems |
| Score |
Current score |
| Points |
Earned points in the session |
| PositionInRound |
|
| Deaths |
Deaths in the current round |
| Kills |
Kills in the current round |
| Laps |
Completed laps in the current round |
| TreasureCollected |
Treasure collected in the current round |
| Count |
Count of supported property types |
enum class Jazz2:: Multiplayer:: PeerLevelState
#include <Jazz2/Multiplayer/PeerDescriptor.h>
Peer state in a level.
| Enumerators | |
|---|---|
| Unknown |
Unknown |
| ValidatingAssets |
Peer received list of required assets, the server is waiting for response |
| StreamingMissingAssets |
Missing assets are being streamed to peer |
| LevelLoaded |
Peer finished loading of the level |
| LevelSynchronized |
Peer finished synchronized entities in the level |
| Spectating |
Peer is spectating |
| PlayerReady |
Player is ready to spawn |
| PlayerSpawned |
Player is spawned |
enum class Jazz2:: Multiplayer:: SpectateMode : std:: uint8_t
#include <Jazz2/Multiplayer/PeerDescriptor.h>
Spectate mode flags.
| Enumerators | |
|---|---|
| None |
Not spectating |
| Forced |
Spectate mode is forced by the server, the client cannot disable it |
| Requested |
Spectate mode is requested by the client, the server can accept or reject it |
| FreeCamera |
Spectate with free camera, otherwise spectate with player camera |
| Mask |
Mask for spectate mode flags |
enum class Jazz2:: Multiplayer:: Reason : std:: uint32_t
#include <Jazz2/Multiplayer/Reason.h>
Client disconnect reason.
| Enumerators | |
|---|---|
| Unknown |
Unspecified |
| Disconnected |
Client disconnected by user |
| InvalidParameter |
Invalid parameter specified |
| IncompatibleVersion |
Incompatible client version |
| ProtocolViolation |
Protocol violation (e.g., received malformed packet) |
| SecurityPolicyViolation |
Security policy violation (e.g., "ws://" from "https://") |
| AuthFailed |
Authentication failed |
| InvalidPassword |
Invalid password specified |
| InvalidPlayerName |
Invalid player name specified |
| NotInWhitelist |
Client is not in server whitelist |
| Requires3rdPartyAuthProvider |
Server requires 3rd party authentication provider (e.g., Discord) |
| ServerIsFull |
Server is full or busy |
| ServerNotReady |
Server is not ready yet |
| ServerStopped |
Server is stopped for unknown reason |
| ServerStoppedForMaintenance |
Server is stopped for maintenance |
| ServerStoppedForReconfiguration |
Server is stopped for reconfiguration |
| ServerStoppedForUpdate |
Server is stopped for update |
| ConnectionLost |
Connection lost |
| ConnectionTimedOut |
Connection timed out |
| Kicked |
Kicked by server |
| Banned |
Banned by server |
| CheatingDetected |
Cheating detected |
| AssetStreamingNotAllowed |
Downloading of assets is not allowed, but some assets are missing |
| Idle |
Inactivity |
Variable documentation
AllPeersT Jazz2:: Multiplayer:: AllPeers constexpr
All connected peers tag.
Use in NetworkManagerBase::
LocalPeerT Jazz2:: Multiplayer:: LocalPeer constexpr
Local peer tag.