Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        // 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);
        }
Esempio n. 3
0
        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;
        }