| 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 in milliseconds as float (rounded and compressed in replicated CompressedPing) |
|
OnPawnSet |
Broadcast whenever this player's possessed pawn is set |
|
|
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 | ||
---|---|---|---|
|
FUniqueNetId... |
BP_GetUniqueId() |
Gets the online unique id for a player. |
|
void |
ClientInitialize ( |
Called by Controller when its PlayerState is initially replicated. |
|
void |
CopyProperties ( |
Copy properties which need to be saved in inactive PlayerState |
|
void |
DispatchCopyProperties ( |
|
|
void |
DispatchOverrideWith ( |
Calls OverrideWith and triggers OnOverrideWith for BP extension |
|
APlayerState... |
Duplicate() |
Create duplicate PlayerState (for saving Inactive PlayerState) |
|
uint8 |
GetCompressedPing() |
Gets the literal value of the compressed Ping value (Ping = PingInMS / 4). |
|
GetOldPlayerName() |
Returns previous player name |
|
|
AController ... |
GetOwningController() |
Returns the AI or player controller that created this player state, or null for remote clients |
|
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. |
|
float |
GetPingInMilliseconds() |
Returns the ping (in milliseconds) |
|
APlayerContr... |
GetPlayerController() |
Return the player controller that created this player state, or null for remote clients |
|
int32 |
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. |
|
int32 |
GetStartTime() |
Gets the literal value of StartTime. |
|
const FUniqu... |
GetUniqueId() |
Gets the literal value of UniqueId. |
|
void |
HandleWelcomeMessage() |
Called after receiving player name |
|
bool |
IsABot() |
Gets the literal value of bIsABot. |
|
bool |
IsFromPreviousLevel() |
Gets the literal value of bFromPreviousLevel. |
|
bool |
IsInactive() |
Gets the literal value of bIsInactive. |
|
bool |
IsOnlyASpectator() |
Gets the literal value of bOnlySpectator. |
|
bool |
IsSpectator() |
Gets the literal value of bIsSpectator. |
|
void |
OnDeactivated() |
Called on the server when the owning player has disconnected, by default this method destroys this player state |
|
void |
OnReactivated() |
Called on the server when the owning player has reconnected and this player state is added to the active players array |
|
void |
OnRep_bIsInactive() |
|
|
void |
OnRep_PlayerId() |
|
|
void |
OnRep_PlayerName() |
|
|
void |
OnRep_Score() |
Replication Notification Callbacks |
|
void |
OnRep_UniqueId() |
|
|
void |
OnSetUniqueId() |
Called on both the client and server when unique ID has been modified |
|
void |
OverrideWith ( |
|
|
void |
RecalculateAvgPing() |
Recalculates the replicated Ping value once per second (both clientside and serverside), based upon collected ping data |
|
void |
ReceiveCopyProperties ( |
Can be implemented in Blueprint Child to move more properties from old to new PlayerState when traveling to a new level |
|
void |
ReceiveOverrideWith ( |
Can be implemented in Blueprint Child to move more properties from old to new PlayerState when reconnecting |
|
void |
RegisterPlayerWithSession ( |
Register a player with the online subsystem |
|
void |
SeamlessTravelTo ( |
Called by seamless travel when initializing a player on the other side - copy properties to the new PlayerState that should persist |
|
void |
SetCompressedPing ( |
Sets the value of CompressedPing without causing other side effects to this instance. |
|
void |
SetIsABot ( |
Sets the value of bIsABot without causing other side effects to this instance. |
|
void |
SetIsFromPreviousLevel ( |
Sets the value of bFromPreviousLevel without causing other side effects to this instance. |
|
void |
SetIsInactive ( |
Sets the value of bIsInactive without causing other side effects to this instance. |
|
void |
SetIsOnlyASpectator ( |
Sets the value of bOnlySpectator without causing other side effects to this instance. |
|
void |
SetIsSpectator ( |
Sets the value of bIsSpectator without causing other side effects to this instance. |
|
void |
SetOldPlayerName ( |
Set the player name to S |
|
void |
SetPlayerId ( |
Sets the value of PlayerId without causing other side effects to this instance. |
|
void |
SetPlayerName ( |
Set the player name to S |
|
void |
SetPlayerNameInternal ( |
Set the player name to S locally, does not trigger net updates |
|
void |
SetScore ( |
Sets the value of Score without causing other side effects to this instance. |
|
void |
SetShouldUpdateReplicatedPing ( |
Sets whether or not the replicated ping value is updated automatically. |
|
void |
SetStartTime ( |
Sets the value of StartTime without causing other side effects to this instance. |
|
void |
SetUniqueId ( |
Associate an online unique id with this player |
|
void |
SetUniqueId ( |
Associate an online unique id with this player |
|
bool |
ShouldBroadCastWelcomeMessage ( |
Returns true if should broadcast player welcome/left messages. |
|
void |
UnregisterPlayerWithSession() |
Unregister a player with the online subsystem |
|
void |
UpdatePing ( |
Receives ping updates for the client (both clientside and serverside), from the net driver NOTE: This updates much more frequently clientside, thus the clientside ping will often be different to what the server displays |
Name | Description | ||
---|---|---|---|
|
void |
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. |
|
|
void |
PostInitializeComponents() |
Allow actors to initialize themselves on the C++ side after all of their components have been initialized, only called during gameplay |
|
void |
Reset() |
Reset actor to initial state - used when restarting level without reloading. |
Name | Description | ||
---|---|---|---|
|
void |
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. |
|
float |
ExactPingV2 |
Please use ExactPing instead. |
|
int32 |
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. |
|
int32 |
StartTime |
This member will be made private. Use GetStartTime or SetStartTime instead. |
|
UniqueId |
This member will be made private. Use GetUniqueId or SetUniqueId instead. |
Name | Description | ||
---|---|---|---|
|
uint8 |
GetPing() |
Use GetPingInMilliseconds() or GetCompressedPing() instead |
|
bool |
IsPrimaryPlayer() |
This version of IsPrimaryPlayer has been deprecated, please use the Platform Device Mapper to check the owning PlatformUserId instead. |
|
void |
SetUniqueId ( |
Use SetUniqueId(FUniqueNetIdRepl) instead |