コード例 #1
0
 public new void StartGame()
 {
     _sessionManager.SetLocalPlayerState("start_primed", false);
     starting = true;
     base.StartGame();
     _multiplayerLevelLoader.countdownFinishedEvent -= base.HandleMultiplayerLevelLoaderCountdownFinished;
     _multiplayerLevelLoader.countdownFinishedEvent += HandleCountdown;
 }
コード例 #2
0
        public void Initialize()
        {
            Plugin.Log?.Info("Setting up SessionManager");

            MPState.CustomSongsEnabled = Plugin.Config.CustomSongs;

            _sessionManager.SetLocalPlayerState("modded", true);
            _sessionManager.SetLocalPlayerState("customsongs", Plugin.Config.CustomSongs);
            _sessionManager.SetLocalPlayerState("enforcemods", Plugin.Config.EnforceMods);
            _sessionManager.playerStateChangedEvent += HandlePlayerStateChanged;
        }
コード例 #3
0
        public void Initialize()
        {
            Plugin.Log?.Info("Setting up SessionManager");

            MPState.CustomSongsEnabled = Plugin.Config.CustomSongs;
            MPState.FreeModEnabled     = Plugin.Config.FreeMod;
            MPState.HostPickEnabled    = Plugin.Config.HostPick;

            _sessionManager.SetLocalPlayerState("modded", true);
            _sessionManager.SetLocalPlayerState("customsongs", Plugin.Config.CustomSongs);
            _sessionManager.SetLocalPlayerState("freemod", Plugin.Config.FreeMod);
            _sessionManager.connectedEvent          += HandleConnected;
            _sessionManager.playerStateChangedEvent += HandlePlayerStateChanged;
        }
コード例 #4
0
        public void Initialize()
        {
            Plugin.Log?.Info("Setting up SessionManager");

            _sessionManager.SetLocalPlayerState("modded", true);
            _sessionManager.SetLocalPlayerState("customsongs", Plugin.Config.CustomSongs);
            _sessionManager.SetLocalPlayerState("enforcemods", Plugin.Config.EnforceMods);

            _sessionManager.connectedEvent          += delegate() { connectedEvent?.Invoke(); };
            _sessionManager.connectionFailedEvent   += delegate(ConnectionFailedReason reason) { connectionFailedEvent?.Invoke(reason); };
            _sessionManager.playerConnectedEvent    += delegate(IConnectedPlayer player) { playerConnectedEvent?.Invoke(player); };
            _sessionManager.playerDisconnectedEvent += delegate(IConnectedPlayer player) { playerDisconnectedEvent?.Invoke(player); };
            _sessionManager.playerStateChangedEvent += delegate(IConnectedPlayer player) { playerStateChangedEvent?.Invoke(player); };
            _sessionManager.disconnectedEvent       += delegate(DisconnectedReason reason) { disconnectedEvent?.Invoke(reason); };
        }
コード例 #5
0
        public void Initialize()
        {
            Plugin.Log?.Info("Setting up SessionManager");

            _multiplayerSessionManager.RegisterSerializer((MultiplayerSessionManager.MessageType) 4, _packetSerializer);

            _multiplayerSessionManager.connectedEvent        += connectedEvent;
            _multiplayerSessionManager.connectionFailedEvent += connectionFailedEvent;
            _multiplayerSessionManager.disconnectedEvent     += disconnectedEvent;

            _multiplayerSessionManager.playerConnectedEvent    += HandlePlayerConnected;
            _multiplayerSessionManager.playerDisconnectedEvent += HandlePlayerDisconnected;
            _multiplayerSessionManager.playerStateChangedEvent += HandlePlayerStateChanged;

            _multiplayerSessionManager.SetLocalPlayerState("modded", true);
            _multiplayerSessionManager.SetLocalPlayerState("customsongs", Plugin.Config.CustomSongs);
            _multiplayerSessionManager.SetLocalPlayerState("enforcemods", Plugin.Config.EnforceMods);
        }