How disconnect a specific PlayerController from server ?
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.
Someone can help me with this, please ?
asked Dec 09 '15 at 08:43 PM in C++ Programming
Regardinging nan2cc's answer:
Actually you're right!
If you look in GameSession.cpp, Epic does the same thing, except they make sure to clean up the Pawn first:
hough if you want a more gentile approach you can use
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:
... 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.
answered Dec 09 '15 at 08:56 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here