Jazz2::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 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, Auth, LevelReady, ChatMessage, PlayerReady = 30, PlayerUpdate, PlayerKeyPress, PlayerChangeWeaponRequest }
Packet type going from client to server.
enum class ServerPacketType { Null, Pong, Reserved, PeerStateChanged, LoadLevel = 10, LevelSetProperty, LevelResetProperties, ShowInGameLobby, FadeOut, PlaySfx, PlayCommonSfx, ShowAlert, ChatMessage, SyncTileMap, SetTrigger, AdvanceTileAnimation, RevertTileAnimation, CreateControllablePlayer = 30, CreateRemoteActor, CreateMirroredActor, DestroyRemoteActor, UpdateAllActors, MarkRemoteActorAsPlayer, PlayerSetProperty = 50, PlayerResetProperties, PlayerRespawn, PlayerMoveInstantly, PlayerAckWarped, PlayerActivateForce, PlayerEmitWeaponFlare, PlayerChangeWeapon, PlayerTakeDamage, PlayerActivateSpring, PlayerWarpIn }
Packet type going from server to client.
enum class LevelPropertyType { Unknown, State = 1, GameMode, LevelText = 10, Count }
Level property type from ServerPacketType::LevelSetProperty.
enum class PlayerPropertyType { Unknown, Lives = 1, Health, Controllable, Invulnerable, Modifier, DizzyTime, WeaponAmmo = 10, WeaponUpgrades, Coins = 20, Gems, Points = 30, Deaths, Kills, Laps, TreasureCollected, Count }
Player property type from ServerPacketType::PlayerSetProperty.
enum class PeerLevelState { Unknown, LevelLoaded, LevelSynchronized, PlayerReady, PlayerSpawned }
Peer state in a level.
enum class Reason : std::uint32_t { Unknown, Disconnected, InvalidParameter, IncompatibleVersion, AuthFailed, InvalidPassword, InvalidPlayerName, NotInWhitelist, Requires3rdPartyAuthProvider, ServerIsFull, ServerNotReady, ServerStopped, ServerStoppedForMaintenance, ServerStoppedForReconfiguration, ServerStoppedForUpdate, ConnectionLost, ConnectionTimedOut, Kicked, Banned, CheatingDetected }
Client disconnect reason.

Variables

AllPeersT AllPeers constexpr
All connected peers tag.

Enum documentation

enum class Jazz2::Multiplayer::MpGameMode

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

Connecting

Connecting to server

Connected

Connected to server

enum class Jazz2::Multiplayer::BroadcastPacketType

Packet type broadcasted on the local network.

enum class Jazz2::Multiplayer::ClientPacketType

Packet type going from client to server.

enum class Jazz2::Multiplayer::ServerPacketType

Packet type going from server to client.

enum class Jazz2::Multiplayer::LevelPropertyType

Level property type from ServerPacketType::LevelSetProperty.

enum class Jazz2::Multiplayer::PlayerPropertyType

Player property type from ServerPacketType::PlayerSetProperty.

enum class Jazz2::Multiplayer::PeerLevelState

Peer state in a level.

Enumerators
Unknown

Unknown

LevelLoaded

Peer finished loading of the level

LevelSynchronized

Peer finished synchronized entities in the level

PlayerReady

Player is ready to spawn

PlayerSpawned

Player is spawned

enum class Jazz2::Multiplayer::Reason : std::uint32_t

Client disconnect reason.

Enumerators
Unknown

Unspecified

Disconnected

Client disconnected by user

InvalidParameter

Invalid parameter specified

IncompatibleVersion

Incompatible client version

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

Variable documentation

AllPeersT Jazz2::Multiplayer::AllPeers constexpr

All connected peers tag.

Use in NetworkManagerBase::SendTo() to send to all connected peers or the remote server peer.