AGameModeBase::Login

Called to login new players by creating a player controller, overridable by the game

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/GameFramework/GameModeBase.h

Include

#include "GameFramework/GameModeBase.h"

Source

/Engine/Source/Runtime/Engine/Private/GameModeBase.cpp

Syntax

virtual APlayerController * Login
(
    UPlayer * NewPlayer,
    ENetRole InRemoteRole,
    const FString & Portal,
    const FString & Options,
    const FUniqueNetIdRepl & UniqueId,
    FString & ErrorMessage
)

Remarks

Called to login new players by creating a player controller, overridable by the game

Sets up basic properties of the player (name, unique id, registers with backend, etc) and should not be used to do more complicated game logic. The player controller is not fully initialized within this function as far as networking is concerned. Save "game logic" for PostLogin which is called shortly afterward.

If login is successful, returns a new PlayerController to associate with this player. Login fails if ErrorMessage string is set.

Returns

a new player controller for the logged in player, NULL if login failed for any reason

Parameters

Parameter

Description

NewPlayer

pointer to the UPlayer object that represents this player (either local or remote)

RemoteRole

the remote role this controller has

Portal

desired portal location specified by the client

Options

game options passed in by the client at login

UniqueId

platform specific unique identifier for the logging in player

ErrorMessage

[out] error message, if any, why this login will be failing

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss