Пример #1
0
    private IEnumerator Start()
    {
        PlayerPrefs.Save();
        CoopTreeGrid.Init();
        LoadSave.OnGameStart += this.OnGameStart;
        yield return(CoopPeerStarter.PrefabDbResource);

        if (!CoopPeerStarter.Dedicated)
        {
            CoopLobby.Instance.SetServer(SteamGameServer.GetSteamID());
        }
        BoltConfig config = base.GetConfig();

        config.serverConnectionLimit = ((!CoopPeerStarter.Dedicated) ? (CoopLobby.Instance.Info.MemberLimit - 1) : SteamDSConfig.ServerPlayers);
        if (CoopPeerStarter.Dedicated)
        {
            BoltLauncher.SetUdpPlatform(new DotNetPlatform());
            BoltLauncher.StartServer(SteamDSConfig.EndPoint, config);
        }
        else
        {
            BoltLauncher.StartServer(SteamGameServer.GetSteamID().ToEndPoint(), config);
        }
        try
        {
            BoltNetwork.AddGlobalEventListener(CoopAckChecker.Instance);
        }
        catch
        {
        }
        yield break;
    }
Пример #2
0
 public override void BoltStartDone()
 {
     BoltNetwork.AddGlobalEventListener(CoopAckChecker.Instance);
     if (!CoopPeerStarter.Dedicated)
     {
         CoopSteamClient.Start();
     }
     if (!PlayerSpawn.HasMPCharacterSave())
     {
         GameSetup.SetInitType(InitTypes.New);
     }
     base.BoltSetup();
     this.Connect();
     PlayerSpawn.LoadSavedCharacter = GameSetup.IsSavedGame;
 }
Пример #3
0
    public override void BoltStartDone()
    {
        BoltNetwork.AddGlobalEventListener(CoopAckChecker.Instance);
        if (GameSetup.IsSavedGame && !LevelSerializer.CanResume)
        {
            Debug.Log(string.Concat(new object[]
            {
                "Will force game to new because GameSetup.IsSavedGame",
                GameSetup.IsSavedGame,
                " LevelSerializer.CanResume ",
                LevelSerializer.CanResume
            }));
            GameSetup.SetInitType(InitTypes.New);
        }
        if (GameSetup.IsSavedGame)
        {
            AnimalSpawnController.lastUpdate = Time.realtimeSinceStartup + 60f;
        }
        base.BoltSetup();
        BoltNetwork.Instantiate(BoltPrefabs.CoopServerInfo).transform.position = new Vector3(0f, 0f, 0f);
        ICoopServerInfo state = CoopServerInfo.Instance.state;

        this.mapState = CoopPeerStarter.MapState.Begin;
    }