Legacy:PlayerReplicationInfo

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to navigation Jump to search
UT2003 :: Object >> Actor >> Info >> ReplicationInfo >> PlayerReplicationInfo (Package: Engine)

This class is responsible for replicating information about a player to all clients in a network game. It contains data, like their name, score, deaths, lives, and more. See PlayerReplicationInfo (UT) for the UT version of this class.

It's spawned by Controller's PostBeginPlay and owned by the controller.

You'll often find PRI as the instance name of PlayerReplicationInfo in many classes.

GameReplicationInfo contains an array of PlayerReplicationInfo called PRI_Array.

Replicated Properties

All properties are replicated which means this data is replicated across the network to each and every player in the game.

bool bAdmin 
True if the player is logged in as an Administrator, False if the player is not logged in as an Administrator.
bool bBot 
True if the player is a bot, False if the player is not a bot.
bool bIsFemale 
True if the player is a female, False if the player is not a female.
bool bIsSpectator 
True if the player is spectating, False if the player is not spectating.
bool bOnlySpectator 
True if the player is a spectator (in spectator mode), False if the player is not a spectator (in active play).
bool bOutOfLives 
True if the player is out of lives, False if the player still has lives or lives in the Game are not important.
bool bReadyToPlay 
True if the player is ready to play, False if the player is not ready to play.
bool bWaitingPlayer 
True if the player is waiting to play (bIsSpectator is also true in this state), False if the player is not waiting to play.
string CharacterName 
The string representation of the character name.
LinkedReplicationInfo CustomReplicationInfo
special field for mod authors. They can use it to replicate additional information about this player.
float Deaths 
The number of player's deaths.
Decoration HasFlag 
If the player has the flag this carries the Decoration that is added to the player to denote them holding the flag.
int Ping 
The integer value of the ping the server has to the player.
Volume PlayerVolume 
This is the players physical self in the game that determines their touch, untouch, entervolume, and leftvolume notifications.
ZoneInfo PlayerZone 
This is the Zone that the player is currently in, which is displayed displayed in the ScoreBoardTeamDeathMatch for your teammates to see.
float Score 
Player's current score.
int StartTime 
This is the players time in seconds set to the ElapsedTime of the Level's GameReplicationInfo.
TeamInfo Team 
Player Team
int TeamID 
Player position in team.
class<VoicePack> VoiceType 
This is the VoicePack that the player has selected that is tied to their character model. If their character makes vocal commands this ensures they hear the voice the player has chosen.

Non-Replicated Properties

This data is not replicated to each player over the network. Instead it is stored on the server.

bool bReceivedPing 
True if there is a current ping for the player, False if the player does not have a current ping. Used in Timer to determine whether to send a GETPING console command.
bool bWelcomed 
set after welcome message broadcast (not replicated) : True if the player has been welcomed to the server, False if the player has not be welcomed by the server.
int GoalsScored 
The number of goals scored by the player. This is stored on the server side only.
int Kills 
The number of kills the player has on other players.
int NumLives 
The number of lives the player has in the current game.
string OldCharacterName 
Not Used.
string OldName 
The old name of the character after they have have SetPlayerName to a different name.
int PlayerID 
Unique id number that is not set in this class. Assigned to an incrementing counter in GameInfo's Login event when the player logs in. This value can be different on the server and client and local values client-side cannot be used to identify players server-side.
string PreviousName 
Not Used.
string StringDead (localized) 
If the character is dead when the location is enquired this string is returned. "Dead"
string StringSpectating (localized) 
If the character is spectating this is the string that is returned for their location. "Spectating"
string StringUnknown (localized) 
If the character's location is unknown then this string is returned. "Unknown"

Methods

ClientNameChange () 
An event that is sends a GameMessage to all PlayerControllers of the NameChange.
Destroyed () 
Removes this players information from the GameReplicationInfo GRI Array.
DisplayDebug (Canvas Canvas, out float YL, out float YPos) 
Displays the PlayerName and any Team and HasFlag information.
string GetHumanReadableName () 
Returns the PlayerName.
string GetLocationName () 
If the PlayerVolume and PlayerZone is None then return the StringDead or StringSpectating (whichever applies). If the player has a PlayerVolume return the PlayerZone.LocationName. If there isn't a LocationName then return the Level.Title as long as it doesn't equal Level.Default.Title. If it fails to match any of the above criteria it returns StringUnknown.
material GetPortrait () 
No Code.
PostBeginPlay () 
If the Owner is an AIController then set the bBot flag to True. Set the start time to the current game's ElapsedTime. Calls the Timer method and then the SetTimer method.
PostNetBeginPlay () 
This class adds itself to the GameReplicationInfo object GRI through the AddPRI method.
Reset () 
Calls Parent class Reset. Sets the Score, Death, NumLives to 0. Sets bReadyToPlay and bOutOfLives to false.
SetCharacterName (string S) 
Sets the Character name to the string S.
SetPlayerName (string S) 
Stores the current PlayerName to OldName and then sets the PlayerName to S.
SetWaitingPlayer (bool B) 
If B is True the the player becomes a waiting spectator, if B is False then the player is no longer a waiting spectator.
Timer () 
Calls UpdatePlayerLocation and SetTimer. Then it picks a random number and if it is above 0.65, the player is not a bot, and the player has not received a ping bReceivedPing then it pings the player.
UpdateCharacter () 
No Code.
UpdatePlayerLocation () 
Grabs the Controller Pawn and then loops through the Volumes to find the Volume that encompasses the Pawn's Volume. That is then set to the current location of the Player.

Related Topics

Discussion