public bool StartStandalone() { MDLog.Info(LOG_CAT, "Starting Standalone Game Session"); OnPlayerJoined_Internal(STANDALONE_ID); MDPlayerInfo PlayerInfo = GetPlayerInfo(STANDALONE_ID); if (PlayerInfo != null) { PlayerInfo.BeginInitialization(); } OnSessionStartedEvent(); IsSessionStarted = true; return(true); }
// Called on the server when a client connects private void ServerOnPeerConnected(int PeerId) { MDLog.Info(LOG_CAT, $"Peer [ID: {PeerId}] connected"); OnPlayerJoined_Internal(PeerId); MDPlayerInfo PlayerInfo = GetPlayerInfo(PeerId); if (PlayerInfo != null) { PlayerInfo.BeginInitialization(); } SynchronizeCurrentPlayers(PeerId); BroadcastNewPlayerJoined(PeerId); SynchronizeNetworkedNodes(PeerId); }
private void ServerOnStarted() { if (GameInstance.UseUPNP()) { ServerUPNP = InitUPNP(UPNPPort); } MDLog.Info(LOG_CAT, "Server started"); #if !GODOT_SERVER OnPlayerJoined_Internal(SERVER_ID); MDPlayerInfo PlayerInfo = GetPlayerInfo(SERVER_ID); if (PlayerInfo != null) { PlayerInfo.BeginInitialization(); } #endif OnSessionStartedEvent(); IsSessionStarted = true; }