When my Match end, inside my GameMode, I need to check for some condition on each PlayerController and if the condition is true, disconnect from server that PlayerController. Later, call ServerTravel in order to move to another map only the PlayerControllers that are connected. But i don’t know how disconnect a specific PlayerController from server.
Well, I found some solution, but don’t know if this is the best way to do this.
In my GameMode, when I found some PlayerController that I need to disconnect, I destroy it (calling Destroy()). So, in my game mode, on server, run a method like this:
for (FConstControllerIterator It = GetWorld()->GetControllerIterator(); It; ++It)
{
if ((*It)->MyCondition)
{
(*It)->Destroy();
}
}
… apparently it work correctly, and exactly has I want. This client is disconnected, on gameMode is called the Logout function etc. But, the point is that I don’t know if this is the best way to do it.
Hi , thank you for your answer, this is a old question, but is good to know that I was in a correct direction, thank you.
… and , I will use this opportunity, because you are a UE4 Guru :), maybe you can help me with another two question that I did here more recently, but none one answer me. If is not to mush ask, can you take a look please ?
I will appreciate if you can point me in the right direction at least on one of the two questions.