Cogito, ergo sum

UE3:GameInfo (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site

Jump to: navigation, search
UDK Object >> Actor >> Info >> GameInfo

Contents

Package: 
Engine
Direct subclass:
UTGame
This class in other games:
RTNP, U1, U2, U2XMP, UE2Runtime, UT, UT2003, UT2004, UT3

GameInfo.

The GameInfo defines the game being played: the game rules, scoring, what actors are allowed to exist in this game type, and who may enter the game. While the GameInfo class is the public interface, much of this functionality is delegated to several classes to allow easy modification of specific game components. These classes include GameInfo, AccessControl, Mutator, and BroadcastHandler. A GameInfo actor is instantiated when the level is initialized for gameplay (in C++ UGameEngine::LoadMap() ). The class of this GameInfo actor is determined by (in order) either the URL ?game=xxx, or the DefaultGame entry in the game's .ini file (in the Engine.Engine section), unless its a network game in which case the DefaultServerGame entry is used. The GameType used can be overridden in the GameInfo script event SetGameType(), called on the game class picked by the above process.

[edit] Constants

[edit] MAX_INSTANCES_PER_CLASS

Value: 5

Path constraint

[edit] Properties

See GameInfo properties.

[edit] Enums

[edit] EStandbyType

Describes which standby detection event occured so the game can take appropriate action

STDBY_Rx 
STDBY_Tx 
STDBY_BadPing 

[edit] Structs

[edit] GameClassShortName

Modifiers: native

string ShortName 
string GameClassName 

[edit] NavMeshPathConstraintCacheDatum

Modifiers: native

int ListIdx 
NavMeshPathConstraint List[5] (MAX_INSTANCES_PER_CLASS) 

[edit] NavMeshPathGoalEvaluatorCacheDatum

Modifiers: native

Path Goal evaluator pool

int ListIdx 
NavMeshPathGoalEvaluator List[5] (MAX_INSTANCES_PER_CLASS) 

[edit] Delegates

[edit] CanUnpause

delegate bool CanUnpause ()

Default delegate that provides an implementation for those that don't have special needs other than a toggle

[edit] Functions

[edit] Static events

[edit] GetDefaultGameClassPath

static event string GetDefaultGameClassPath (string MapName, string Options, string Portal)

Returns:

the full path to the optimal GameInfo class to use for the specified map and options this is used for preloading cooked packages, etc. and therefore doesn't need to include any fallbacks as SetGameType() will be called later to actually find/load the desired class

[edit] SetGameType

static event class<GameInfoSetGameType (string MapName, string Options, string Portal)

Returns:

the class of GameInfo to spawn for the game on the specified map and the specified options this function should include any fallbacks in case the desired class can't be found

[edit] Other static functions

[edit] AllowMutator

static function bool AllowMutator (string MutatorClassName)


[edit] GetIntOption

static function int GetIntOption (string Options, string ParseString, int CurrentValue)


[edit] GetKeyValue

static function GetKeyValue (string Pair, out string Key, out string Value)


[edit] GrabOption

static function bool GrabOption (out string Options, out string Result)


[edit] HasOption

static function bool HasOption (string Options, string InKey)


[edit] ParseKillMessage

static function string ParseKillMessage (string KillerName, string VictimName, string DeathMessage)


[edit] ParseOption

static function string ParseOption (string Options, string InKey)


[edit] UseLowGore

static function bool UseLowGore (WorldInfo WI)


[edit] Exec functions

[edit] BeginBVT

exec simulated function BeginBVT (optional coerce string TagDesc)

This is for the QA team who don't use UFE nor commandline :-( *

[edit] DoTravelTheWorld

exec function DoTravelTheWorld ()

function to start the world traveling *

[edit] KillBots

exec function KillBots ()


[edit] Native functions

[edit] DoNavFearCostFallOff

final native function DoNavFearCostFallOff ()

Update navigation point fear cost fall off.

[edit] EnableStandbyCheatDetection

native function EnableStandbyCheatDetection (bool bIsEnabled)

Turns standby detection on/off

Parameters:

  • bIsEnabled - true to turn it on, false to disable it

[edit] ForceClearUnpauseDelegates

native final function ForceClearUnpauseDelegates (Actor PauseActor)

Forcibly removes an object's CanUnpause delegates from the list of pausers. If any of the object's CanUnpause delegate handlers were in the list, triggers a call to ClearPause().

Called when the player controller is being destroyed to prevent the game from being stuck in a paused state when a PC that paused the game is destroyed before the game is unpaused.

[edit] GetNavMeshPathConstraintFromCache

native function NavMeshPathConstraint GetNavMeshPathConstraintFromCache (class<NavMeshPathConstraintConstraintClass, NavigationHandle Requestor)

Will search for an existing free constraint from the cache, and return it if one is found otherwise it will add a new instance to the cache and return that

Parameters:

  • ConstraintClass - the class of the constraint to grab from the cache
  • Requestor - the handle that needs this constraint

[edit] GetNavMeshPathGoalEvaluatorFromCache

native function NavMeshPathGoalEvaluator GetNavMeshPathGoalEvaluatorFromCache (class<NavMeshPathGoalEvaluatorGoalEvalClass, NavigationHandle Requestor)

Will search for an existing free Evaluator from the cache, and return it if one is found otherwise it will add a new instance to the cache and return that

Parameters:

  • GoalEvalClass - the class of the evaluator to grab from the cache
  • Requestor - the handle that needs this constraint

[edit] GetNetworkNumber

native function string GetNetworkNumber ()


[edit] GetNextPlayerID

native final function int GetNextPlayerID ()


[edit] ReleaseCachedConstraintsAndEvaluators

native function ReleaseCachedConstraintsAndEvaluators ()


[edit] SwapPlayerControllers

native final function SwapPlayerControllers (PlayerController OldPC, PlayerController NewPC)

used to swap a viewport/connection's PlayerControllers when seamless travelling and the new gametype's controller class is different than the previous includes network handling

Parameters:

  • OldPC - the old PC that should be discarded
  • NewPC - the new PC that should be used for the player

[edit] Events

[edit] AcceptInventory

event AcceptInventory (Pawn PlayerPawn)


[edit] AddDefaultInventory

event AddDefaultInventory (Pawn P)


[edit] Broadcast

event Broadcast (Actor Sender, coerce string Msg, optional name Type)


[edit] BroadcastLocalized

event BroadcastLocalized (Actor Sender, class<LocalMessageMessage, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject)


[edit] BroadcastLocalizedTeam

event BroadcastLocalizedTeam (int TeamIndex, Actor Sender, class<LocalMessageMessage, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject)


[edit] ClearPause

event ClearPause ()

Checks the list of delegates to determine if the pausing can be cleared. If the delegate says it's ok to unpause, that delegate is removed from the list and the rest are checked. The game is considered unpaused when the list is empty.

[edit] GameEnding

event GameEnding ()


[edit] GetSeamlessTravelActorList

event GetSeamlessTravelActorList (bool bToEntry, out array<ActorActorList)

called on server during seamless level transitions to get the list of Actors that should be moved into the new level PlayerControllers, Role < ROLE_Authority Actors, and any non-Actors that are inside an Actor that is in the list (i.e. Object.Outer == Actor in the list) are all autmoatically moved regardless of whether they're included here only dynamic (!bStatic and !bNoDelete) actors in the PersistentLevel may be moved (this includes all actors spawned during gameplay) this is called for both parts of the transition because actors might change while in the middle (e.g. players might join or leave the game)

Parameters:

  • bToEntry - true if we are going from old level -> entry, false if we are going from entry -> new level
  • ActorList - out) list of actors to maintain

See: also PlayerController::GetSeamlessTravelActorList() (the function that's called on clients)

[edit] HandleSeamlessTravelPlayer

event HandleSeamlessTravelPlayer (out Controller C)

handles reinitializing players that remained through a seamless level transition called from C++ for players that finished loading after the server

Parameters:

  • C - the Controller to handle

[edit] InitGame

event InitGame (string Options, out string ErrorMessage)


[edit] KickIdler

event KickIdler (PlayerController PC)


[edit] Login

event PlayerController Login (string Portal, string Options, const OnlineSubsystem.UniqueNetId UniqueID, out string ErrorMessage)


[edit] MatineeCancelled

event MatineeCancelled ()

Called when this PC is in cinematic mode, and its matinee is cancelled by the user.

[edit] NotifyPendingConnectionLost

event NotifyPendingConnectionLost ()

Called when a connection closes before getting to PostLogin()

[edit] PostBeginPlay

event PostBeginPlay ()

Overrides: Actor.PostBeginPlay


[edit] PostCommitMapChange

event PostCommitMapChange ()

Called from C++'s CommitMapChange after unloading previous level and loading new level+sublevels

[edit] PostLogin

event PostLogin (PlayerController NewPlayer)


[edit] PostSeamlessTravel

event PostSeamlessTravel ()

called after a seamless level transition has been completed on the *new* GameInfo used to reinitialize players already in the game as they won't have *Login() called on them

[edit] PreBeginPlay

event PreBeginPlay ()

Overrides: Actor.PreBeginPlay


[edit] PreCommitMapChange

event PreCommitMapChange (string PreviousMapName, string NextMapName)

Called from C++'s CommitMapChange before unloading previous level

Parameters:

  • PreviousMapName - Name of the previous persistent level
  • NextMapName - Name of the persistent level being streamed to

[edit] PreExit

event PreExit ()

Engine is shutting down.

[edit] PreLogin

event PreLogin (string Options, string Address, out string ErrorMessage)


[edit] Reset

event Reset ()

Overrides: Actor.Reset


[edit] StandbyCheatDetected

event StandbyCheatDetected (EStandbyType StandbyType)

Notifies the game code that a standby cheat was detected

Parameters:

  • StandbyType - the type of cheat detected

[edit] Timer

event Timer ()

Overrides: Actor.Timer


[edit] Other instance functions

See GameInfo instance functions.

[edit] States

[edit] PendingMatch

This state is used to change the flow of start/end match to handle arbitration

Basic flow of events: Server prepares to start the match and tells all clients to register arbitration Clients register with arbitration and tell the server when they are done Server checks for all clients to be registered and kicks any clients if they don't register in time. Server registers with arbitration and the match begins

Match ends and the server tells connected clients to write arbitrated stats Clients write stats and notifies server of completion Server writes stats and ends the match

Modifiers: auto

[edit] PendingMatch.EndState

event EndState (name NextStateName)

Overrides: Object.EndState (global)

Called immediately before going out of the current state, while within the GotoState() call that caused the state change, and before BeginState() is called within the new state.

[edit] PendingMatch.ArbitrationRegistrationComplete

function ArbitrationRegistrationComplete (name SessionName, bool bWasSuccessful)

Overrides: ArbitrationRegistrationComplete (global)

Callback from the server that starts the match if the registration was successful. If not, it goes back to the menu

Parameters:

  • SessionName - the name of the session this is for
  • bWasSuccessful - whether the registration worked or not

[edit] PendingMatch.ArbitrationTimeout

function ArbitrationTimeout ()

Handles kicking any clients that haven't completed handshaking

[edit] PendingMatch.MatchIsInProgress

function bool MatchIsInProgress ()

Overrides: MatchIsInProgress (global)


[edit] PendingMatch.ProcessClientRegistrationCompletion

function ProcessClientRegistrationCompletion (PlayerController PC, bool bWasSuccessful)

Overrides: ProcessClientRegistrationCompletion (global)

Removes the player controller from the pending list. Kicks that PC if it failed to register for arbitration. Starts the match if all clients have completed their registration

Parameters:

  • PC - the player controller to mark as done
  • bWasSuccessful - whether the PC was able to register for arbitration or not

[edit] PendingMatch.RegisterServerForArbitration

function RegisterServerForArbitration ()

Overrides: RegisterServerForArbitration (global)

Does the registration for the server. This must be done last as it includes all the players info from their registration

[edit] PendingMatch.StartArbitratedMatch

function StartArbitratedMatch ()

Overrides: StartArbitratedMatch (global)

Called once arbitration has completed and kicks off the real start of the match

[edit] PendingMatch.StartArbitrationRegistration

function StartArbitrationRegistration ()

Overrides: StartArbitrationRegistration (global)

Kicks off the async tasks of having the clients register with arbitration before the server does. Sets a timeout for when all slow to respond clients get kicked

[edit] PendingMatch.StartMatch

function StartMatch ()

Overrides: StartMatch (global)

Tells all of the currently connected clients to register with arbitration. The clients will call back to the server once they have done so, which will tell this state to see if it is time for the server to register with arbitration.

[edit] TravelTheWorld

This our state which allows us to have delayed actions while traveling the world (e.g. waiting for levels to stream in) *

Personal tools