Jazz2::Actors::Multiplayer::RemotablePlayer class

Remotable player in online session.

A client-side player whose control can be driven remotely by the server. The server can move it, warp it in and queue respawns, while local input and weapon changes are reconciled with the authoritative server state.

Base classes

class MpPlayer
Player in online session.

Constructors, destructors, conversion operators

RemotablePlayer(std::shared_ptr<PeerDescriptor> peerDesc)
Creates a new instance.

Public functions

void WarpIn(ExitType exitType)
Warps the player in.
void MoveRemotely(Vector2f pos, Vector2f speed, Vector2f externalForce = Vector2f::Zero)
Moves the player remotely.
auto Respawn(Vector2f pos) -> bool override
Respawns the player.

Public variables

bool ChangingWeaponFromServer
Whether current weapon is being changed by the server.
bool RespawnPending
Whether the player should be respawned.
Vector2f RespawnPos
The position at which the player should respawn.

Protected functions

auto OnActivatedAsync(const ActorActivationDetails& details) -> Task<bool> override
Called when the object is created and activated.
auto OnPerish(ActorBase* collider) -> bool override
Called when the object has no health left and should perish.
void OnUpdate(float timeMult) override
Called every frame to update the object state.
void OnWaterSplash(Vector2f pos, bool inwards) override
Called when water should splash.
auto FireCurrentWeapon(WeaponType weaponType) -> bool override
Fires currently equipped weapon.
void SetCurrentWeapon(WeaponType weaponType, SetCurrentWeaponReason reason) override
Sets current weapon.

Function documentation

Jazz2::Actors::Multiplayer::RemotablePlayer::RemotablePlayer(std::shared_ptr<PeerDescriptor> peerDesc)

Creates a new instance.

Parameters
peerDesc Descriptor of the peer this player belongs to