Server is not kicking unauthorized clients out of the game
chris-gong opened this issue · 2 comments
Calls to AGameSession::KickPlayer
do not seem to be working. A workaround suggested by someone is to destroy the player controller on the server.
After further review, it may not be smart do this in the InitNewPlayer
function of my server's GameModeBase
class.
Not sure which commit I implemented the solution to this issue in, but I just populated the ErrorMessage
parameter in the PreLogin
function of the server's AGameMode
class if the call to GameLift's AcceptPlayerSession
failed. The Login
function, which is called right after PreLogin
, checks the ErrorMessage
paramater, so if the ErrorMessage
contains anything, then the player will be kicked because its player controller will never be created, thereby kicking the unauthorized client out of the game.