| UObjectBase
|
Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerState.h |
Include |
#include "GameFramework/PlayerState.h" |
class APlayerState : public AInfo
A PlayerState is created for every player on a server (or in a standalone game). PlayerStates are replicated to all clients, and contain network game relevant information about the player, such as playername, score, etc.
Name | Description | ||
---|---|---|---|
|
uint8: 1 |
bHasBeenWelcomed |
Client side flag - whether this player has been welcomed or not (player entered message) |
|
uint8: 1 |
bUseCustomPlayerNames |
If set, GetPlayerName() will call virtual GetPlayerNameCustom() to allow custom access |
|
TSubclassOf< cl... |
EngineMessageClass |
This is used for sending game agnostic messages that can be localized |
|
float |
ExactPing |
Exact ping as float (rounded and compressed in replicated Ping) |
|
float |
ExactPingV2 |
|
|
SavedNetworkAddress |
Used to match up InactivePlayerState with rejoining playercontroller. |
|
|
SessionName |
The session that the player needs to join/remove from as it is created/leaves |
Name | Description | |
---|---|---|
|
APlayerState ( |
Name | Description | |
---|---|---|
|
~APlayerState() |
Destructor for handling property deprecation, please remove after all deprecated properties are gone |
Name | Description | ||
---|---|---|---|
|
ClientInitialize ( |
Called by Controller when its PlayerState is initially replicated. |
|
|
CopyProperties ( |
Copy properties which need to be saved in inactive PlayerState |
|
|
DispatchCopyProperties ( |
||
|
DispatchOverrideWith ( |
Calls OverrideWith and triggers OnOverrideWith for BP extension |
|
|
APlayerState... |
Duplicate() |
Create duplicate PlayerState (for saving Inactive PlayerState) |
|
GetOldPlayerName() |
Returns previous player name |
|
|
T * |
GetPawn() |
Convenience helper to return a cast version of the pawn controlled by this Player State. |
|
APawn * |
GetPawn() |
Return the pawn controlled by this Player State. |
|
GetPing() |
Gets the literal value of Ping. |
|
|
GetPlayerId() |
Gets the literal value of PlayerId. |
|
|
GetPlayerName() |
Returns current player name |
|
|
GetPlayerNameCustom() |
Custom access to player name, called only when bUseCustomPlayerNames is set |
|
|
float |
GetScore() |
Gets the literal value of Score. |
|
GetStartTime() |
Gets the literal value of StartTime. |
|
|
const FUniqu... |
GetUniqueId() |
Gets the literal value of UniqueId. |
|
HandleWelcomeMessage() |
Called after receiving player name |
|
|
IsABot() |
Gets the literal value of bIsABot. |
|
|
IsFromPreviousLevel() |
Gets the literal value of bFromPreviousLevel. |
|
|
IsInactive() |
Gets the literal value of bIsInactive. |
|
|
IsOnlyASpectator() |
Gets the literal value of bOnlySpectator. |
|
|
IsPrimaryPlayer() |
Return true if PlayerState is primary (ie. non-splitscreen) player |
|
|
IsSpectator() |
Gets the literal value of bIsSpectator. |
|
|
OnDeactivated() |
Called on the server when the owning player has disconnected, by default this method destroys this player state |
|
|
OnReactivated() |
Called on the server when the owning player has reconnected and this player state is added to the active players array |
|
|
OnRep_bIsInactive() |
||
|
OnRep_PlayerId() |
||
|
OnRep_PlayerName() |
||
|
OnRep_Score() |
Replication Notification Callbacks |
|
|
OnRep_UniqueId() |
||
|
OverrideWith ( |
||
|
RecalculateAvgPing() |
Recalculates the replicated Ping value once per second (both clientside and serverside), based upon collected ping data |
|
|
ReceiveCopyProperties ( |
Can be implemented in Blueprint Child to move more properties from old to new PlayerState when traveling to a new level |
|
|
ReceiveOverrideWith ( |
Can be implemented in Blueprint Child to move more properties from old to new PlayerState when reconnecting |
|
|
RegisterPlayerWithSession ( |
Register a player with the online subsystem |
|
|
SeamlessTravelTo ( |
Called by seamless travel when initializing a player on the other side - copy properties to the new PlayerState that should persist |
|
|
SetIsABot ( |
Sets the value of bIsABot without causing other side effects to this instance. |
|
|
SetIsFromPreviousLevel ( |
Sets the value of bFromPreviousLevel without causing other side effects to this instance. |
|
|
SetIsInactive ( |
Sets the value of bIsInactive without causing other side effects to this instance. |
|
|
SetIsOnlyASpectator ( |
Sets the value of bOnlySpectator without causing other side effects to this instance. |
|
|
SetIsSpectator ( |
Sets the value of bIsSpectator without causing other side effects to this instance. |
|
|
SetOldPlayerName ( |
Set the player name to S |
|
|
SetPing ( |
Sets the value of Ping without causing other side effects to this instance. |
|
|
SetPlayerId ( |
Sets the value of PlayerId without causing other side effects to this instance. |
|
|
SetPlayerName ( |
Set the player name to S |
|
|
SetPlayerNameInternal ( |
Set the player name to S locally, does not trigger net updates |
|
|
SetScore ( |
Sets the value of Score without causing other side effects to this instance. |
|
|
SetShouldUpdateReplicatedPing ( |
Sets whether or not the replicated ping value is updated automatically. |
|
|
SetStartTime ( |
Sets the value of StartTime without causing other side effects to this instance. |
|
|
SetUniqueId ( |
Sets the value of UniqueId without causing other side effects to this instance. |
|
|
SetUniqueId ( |
Associate an online unique id with this player |
|
|
SetUniqueId ( |
Associate an online unique id with this player |
|
|
ShouldBroadCastWelcomeMessage ( |
Returns true if should broadcast player welcome/left messages. |
|
|
UnregisterPlayerWithSession() |
Unregister a player with the online subsystem |
|
|
UpdatePing ( |
Receives ping updates for the client (both clientside and serverside), from the net driver |
Name | Description | ||
---|---|---|---|
|
Destroyed() |
Called when this actor is explicitly being destroyed during gameplay or in the editor, not called during level streaming or gameplay ending |
|
|
GetHumanReadableName() |
Returns the human readable string representation of an object. |
|
|
PostInitializeComponents() |
Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay |
|
|
Reset() |
Reset actor to initial state - used when restarting level without reloading. |
Name | Description | ||
---|---|---|---|
|
GetLifetimeReplicatedProps ( |
Returns the properties used for network replication, this needs to be overridden by all actor classes with native replicated properties |
Name | Description | ||
---|---|---|---|
|
uint8: 1 |
bFromPreviousLevel |
This member will be made private. Use IsFromPreviousLevel or SetIsFromPreviousLevel instead. |
|
uint8: 1 |
bIsABot |
This member will be made private. Use IsABot or SetIsABot instead. |
|
uint8: 1 |
bIsInactive |
This member will be made private. Use IsInactive or SetIsInactive instead. |
|
uint8: 1 |
bIsSpectator |
This member will be made private. Use IsSpectator or SetIsSpectator instead. |
|
uint8: 1 |
bOnlySpectator |
This member will be made private. Use IsOnlyASpectator or SetIsOnlyASpectator instead. |
|
Ping |
This member will be made private. Use GetPing or SetPing instead. |
|
|
PlayerId |
This member will be made private. Use GetPlayerId or SetPlayerId instead. |
|
|
float |
Score |
This member will be made private. Use GetScore or SetScore instead. |
|
StartTime |
This member will be made private. Use GetStartTime or SetStartTime instead. |
|
|
UniqueId |
This member will be made private. Use GetUniqueId or SetUniqueId instead. |