Ok yeah, this is easily reproducalbe in a fresh Project an it seems like this is meant to be.
I will upload fresh project i made here: https://.com/open?id=0B34nzTE-VVazRlZTaW9oSU5LaW8&authuser=0
Instructions: When you open Project, you should be in MainMenu Map. If not, look into Maps folder.
In Blueprint folder, you will find a LobbyBlueprint and a MainMenuBlueprint Folder. Inside of MainMenu folder, there is a GameMode and a PlayerController (so we can start game etc). Inside Lobby folder, there is a GameMode, PlayerController und PlayerState.
Now start game with 2 Players, but NO dedicated server. Make sure to start game in Editor window (this appears in standalone too i guess) so you can see Outliner.
Then start server on Editor Window (one INSIDE Editor is server by default) by pressing “C”.
I added Logs so you can see what happens. Then, go to Window with Client game and press “F” to find sessions. What a few seconds till Log appears and says that search was ok. Then press “J” to join found session.
When creating game, Outliner should show ONE PlayerState. When joining Game as client, Outliner should have TWO PlayerStates. All ok by now.
In CLIENT window, press “E” to leave Game and destroy session. Now PlayerState gets deleted BUT, Server creates a new second one, which has a lifetime of 300 sec.
I added a Log Print for PlayerState, so that you can see which PlayerState is calling BeginPlay.
Also PlayerState that gets created after Client leaves, will remain on Server even if Player Reconnects.This is where my Game gets a problem. I need PlayerState to fire BeginPlay when Client connects and not after he left. created PlayerState (watch Number of new one when player disconnects) will NOT fire BeginPlay again. Only when Player leaves. And since i use Begin Play to add
players to a list, this is really bad for me ):
Just try to disconnect (E), and reconnect a few times with client. You will see that PlayerState remains for him to reconnect.
I guess this is just something unreal intern, that server leaves a PlayerStates for point when Player might reconnect. Is it possible to stop this from happening? A bool or something that i can set so that Server doesn’t do this? Or do i need to kill him by hand? PlayerState has no owner, so i could call “destroy” in begin play if he has no owner, but i don’t like work arounds.
I also noticed that at least client calls BeginPlay again, maybe i will do a Client to Server call.