Exemple #1
0
        public override void CreateSession(string sessionName, OperationResultDelegate onComplete)
        {
            if (State != NetworkState.Running)
            {
                Log.Info(LogChannel, "[PhotonNetworkInterface] Cannot create session if not in running state");
                return;
            }

            if (!BoltNetwork.IsServer)
            {
                Log.Info(LogChannel, "[PhotonNetworkInterface] Cannot create session if not of type server");
                return;
            }

            _operationCallbackSessionCreated = onComplete;

            // Create some room custom properties
            PhotonRoomProperties roomProperties = new PhotonRoomProperties();

            roomProperties.IsOpen    = true;
            roomProperties.IsVisible = true;

            // Create the Photon Room
            BoltMatchmaking.CreateSession(sessionName, roomProperties);

            Log.Info(LogChannel, "[PhotonNetworkInterface] Session creation begun...");
        }
Exemple #2
0
 public override void BoltStartDone()
 {
     if (BoltNetwork.IsServer)
     {
         BoltMatchmaking.CreateSession(sessionID: Guid.NewGuid().ToString());
     }
 }
Exemple #3
0
        public override void BoltStartDone()
        {
            if (BoltNetwork.IsServer)
            {
                string matchName = Guid.NewGuid().ToString();

                var props = new PhotonRoomProperties();

                props.IsOpen    = true;
                props.IsVisible = true;

                props["type"] = "game01";
                props["map"]  = "Tutorial1";

                BoltMatchmaking.CreateSession(
                    sessionID: matchName,
                    sceneToLoad: "Tutorial1",
                    token: props
                    );
            }

            if (BoltNetwork.IsClient)
            {
                // This will start a server after 10secs of wait
                // if no server was found
                _timerRoutine = StartCoroutine(ShutdownAndStartServer());
            }
        }
        public override void BoltStartDone()
        {
            if (BoltNetwork.IsServer)
            {
                var token = new RoomProtocolToken()
                {
                    ArbitraryData = "My DATA",
                };

                BoltLog.Info("Starting Server");

                // Start Photon Room
                BoltMatchmaking.CreateSession(
                    sessionID: matchName,
                    token: token
                    );
            }
            else if (BoltNetwork.IsClient)
            {
                if (randomJoin)
                {
                    BoltMatchmaking.JoinRandomSession();
                }
                else
                {
                    ClientStaredUIHandler();
                }

                randomJoin = false;
            }
        }
Exemple #5
0
 public override void BoltStartDone()
 {
     BoltMatchmaking.CreateSession(
         sessionID: Guid.NewGuid().ToString(),
         sceneToLoad: "Main"
         );
 }
        public override void BoltStartDone()
        {
            if (BoltNetwork.IsServer)
            {
                // Create some room custom properties
                PhotonRoomProperties roomProperties = new PhotonRoomProperties();

                roomProperties.AddRoomProperty("t", GameType); // ex: game type
                roomProperties.AddRoomProperty("m", Map);      // ex: map id

                roomProperties.IsOpen    = true;
                roomProperties.IsVisible = true;

                // If RoomID was not set, create a random one
                if (RoomID.Length == 0)
                {
                    RoomID = Guid.NewGuid().ToString();
                }

                // Create the Photon Room
                BoltMatchmaking.CreateSession(
                    sessionID: RoomID,
                    token: roomProperties,
                    sceneToLoad: Map
                    );

                // BoltNetwork.SetServerInfo(RoomID, roomProperties);
                // BoltNetwork.LoadScene(Map);
            }
        }
Exemple #7
0
 public override void BoltStartDone()
 {
     if (BoltNetwork.IsServer)
     {
         BoltMatchmaking.CreateSession(sessionID: matchName.text, sceneToLoad: "Zoom");
     }
 }
Exemple #8
0
        private IEnumerator StartServerRoutine(ServerRoomToken serverToken, Action onStartSuccess, Action onStartFail)
        {
            if (BoltNetwork.IsRunning && !BoltNetwork.IsServer)
            {
                BoltLauncher.Shutdown();

                yield return(new WaitUntil(NetworkIsInactive));
            }

            state = State.Starting;

            BoltLauncher.StartServer(config);
            yield return(new WaitUntil(NetworkIsIdle));

            for (int i = 0; i < 3; i++)
            {
                yield return(new WaitForEndOfFrame());
            }

            if (BoltNetwork.IsServer)
            {
                onStartSuccess?.Invoke();

                BoltMatchmaking.CreateSession(Guid.NewGuid().ToString(), serverToken, serverToken.Map);
            }
            else
            {
                onStartFail?.Invoke();
            }
        }
Exemple #9
0
 public override void BoltStartDone()
 {
     if (BoltNetwork.IsServer)
     {
         PlayerPrefs.SetString("currentSession", SessionInput.text);
         BoltMatchmaking.CreateSession(sessionID: SessionInput.text, sceneToLoad: "FPSGame");
     }
 }
Exemple #10
0
 public override void BoltStartDone()
 {
     if (BoltNetwork.IsServer)
     {
         BoltMatchmaking.CreateSession(serverName);
         BoltNetwork.LoadScene("DisCo-Scene");
     }
 }
 /// <summary>
 /// Wheneever either client or server network starts
 /// </summary>
 public override void BoltStartDone()
 {
     if (BoltNetwork.IsServer)
     {
         string roomName = "Test Match";
         BoltMatchmaking.CreateSession(roomName);
         //BoltNetwork.LoadScene("Game");
     }
 }
Exemple #12
0
    public override void BoltStartDone()
    {
        if (BoltNetwork.IsServer)
        {
            string matchName = Guid.NewGuid().ToString();

            BoltMatchmaking.CreateSession(sessionID: matchName, sceneToLoad: "Multiplayer");
        }
    }
Exemple #13
0
    //
    // public override void BoltStartBegin()
    // {
    //   BoltNetwork.RegisterTokenClass<PhotonRoomProperties>();
    // }

    public override void BoltStartDone()
    {
        if (BoltNetwork.IsServer)
        {
            BoltMatchmaking.CreateSession(sessionID: "test", sceneToLoad: sceneToLoad);
        }

        // BoltNetwork.EnableLanBroadcast();
    }
Exemple #14
0
 public override void BoltStartDone()
 {
     if (BoltNetwork.IsServer)
     {
         string matchName = Guid.NewGuid().ToString() + serverName.text;
         BoltMatchmaking.CreateSession(matchName, null);
         BoltNetwork.LoadScene(levelsselect.captionText.text);
     }
 }
    private void CreateSession()
    {
        string matchName = startServerSessionIdInputField.text.Trim();

        BoltMatchmaking.CreateSession(
            sessionID: matchName,
            sceneToLoad: "Lobby"
        );
    }
Exemple #16
0
    public override void BoltStartDone()
    {
        if (BoltNetwork.IsServer)
        {
            string matchName = lobbyname.GetComponent <UnityEngine.UI.Text>().text;

            BoltMatchmaking.CreateSession(matchName);
            BoltNetwork.LoadScene("Main");
        }
    }
 public override void BoltStartDone()
 {
     if (BoltNetwork.IsServer)
     {
         BoltNetwork.RegisterTokenClass <PhotonRoomProperties>();
         PhotonRoomProperties token = new PhotonRoomProperties();
         token.AddRoomProperty("roomName", GameObject.FindWithTag("NewRoomNameInputField").GetComponent <TMP_InputField>().text);
         BoltMatchmaking.CreateSession(sessionID: Guid.NewGuid().ToString(), sceneToLoad: "Game", token: token);
     }
 }
Exemple #18
0
    public override void BoltStartDone()
    {
        if (BoltNetwork.IsServer)
        {
            string matchName = Guid.NewGuid().ToString();

            //BoltNetwork.SetServerInfo(matchName, null);
            BoltMatchmaking.CreateSession(matchName, null);
            BoltNetwork.LoadScene("Main");
        }
    }
    public override void BoltStartDone()
    {
        if (!BoltNetwork.IsServer)
        {
            return;
        }

        var matchName = Guid.NewGuid().ToString();

        BoltMatchmaking.CreateSession(matchName, null, "Game");
    }
Exemple #20
0
    public override void BoltStartDone()
    {
        if (BoltNetwork.IsServer)
        {
            string matchName = "Test Match";

            //BoltNetwork.SetServerInfo(matchName, null);
            BoltMatchmaking.CreateSession(matchName);

            BoltNetwork.LoadScene("MPTest");
        }
    }
    public override void BoltStartDone()
    {
        if (BoltNetwork.IsServer)
        {
            //BoltMatchmaking.CreateSession(Guid.NewGuid().ToString(), null, "SampleScene");

            BoltMatchmaking.CreateSession(
                sessionID: "Jocasta",
                sceneToLoad: "SampleScene"
                );
        }
    }
Exemple #22
0
    public override void BoltStartDone()
    {
        if (BoltNetwork.IsServer)
        {
            string matchName = PlayerPrefs.GetString("userName");

            BoltMatchmaking.CreateSession(
                sessionID: matchName,
                sceneToLoad: "Main2"
                );
        }
    }
Exemple #23
0
 public override void BoltStartDone()
 {
     if (BoltNetwork.IsServer)
     {
         currentSession = PlayerPrefs.GetString("currentSession");
         BoltMatchmaking.CreateSession(sessionID: currentSession, sceneToLoad: "FPSGame");
     }
     else
     {
         BoltMatchmaking.JoinSession(currentSession);
     }
 }
Exemple #24
0
        public override void BoltStartDone()
        {
            if (BoltNetwork.IsServer)
            {
                var id        = Guid.NewGuid().ToString().Split('-')[0];
                var matchName = string.Format("{0} - {1}", id, map);

                BoltMatchmaking.CreateSession(
                    sessionID: matchName,
                    sceneToLoad: map
                    );
            }
        }
Exemple #25
0
        public override void BoltStartDone()
        {
            BoltLog.Warn("set loading MainGame Scene~~");
            if (BoltNetwork.IsClient)
            {
                return;
            }
            var matchName = Guid.NewGuid().ToString();

            BoltMatchmaking.CreateSession(
                matchName,
                sceneToLoad: "MainGame"
                );
        }
Exemple #26
0
    public override void BoltStartDone()
    {
        string newServerName = Regex.Replace(PlayerPrefs.GetString("ServerName"), @"[^a-zA-Z0-9 ]", "");

        if (PlayerPrefs.GetString("ServerName").Length == 0)                                                     // server names cannot be empty
        {
            PlayerPrefs.SetString("ServerName", "DefaultServerName" + UnityEngine.Random.Range(0, 10000000000)); // assign random server name
            newServerName = PlayerPrefs.GetString("ServerName");
            print(newServerName);
        }
        if (BoltNetwork.IsServer)
        {
            BoltMatchmaking.CreateSession(sessionID: newServerName, sceneToLoad: "Game");       // name the session ID.
        }
    }
Exemple #27
0
    public void StartSession()
    {
        if (BoltNetwork.IsServer && !offlineMode)
        {
            string matchName = "Test Match";



            // Broadcast Server now ( now people can join)
            BoltMatchmaking.CreateSession(sessionID: matchName, sceneToLoad: GameData.ScenesInBuild.scenes[1]);
        }
        else
        {
            Debug.Log("First start an online server please.");
        }
    }
Exemple #28
0
        public override void BoltStartDone()
        {
            if (BoltNetwork.IsServer)
            {
                PhotonRoomProperties token = new PhotonRoomProperties();
                token.IsOpen    = true;
                token.IsVisible = true;

                var matchName = Guid.NewGuid().ToString();

                BoltMatchmaking.CreateSession(
                    sessionID: matchName,
                    token: token,
                    sceneToLoad: "Game"
                    );
            }
        }
Exemple #29
0
    // Bolt Events

    public override void BoltStartDone()
    {
        if (BoltNetwork.IsServer)
        {
            var id        = Guid.NewGuid().ToString().Split('-')[0];
            var matchName = string.Format("{0} - {1}", id, _gameLevel);

            BoltMatchmaking.CreateSession(
                sessionID: matchName,
                sceneToLoad: _gameLevel
                );
        }
        else if (BoltNetwork.IsClient)
        {
            BoltMatchmaking.JoinRandomSession();
        }
    }
Exemple #30
0
        public override void BoltStartDone()
        {
            if (BoltNetwork.IsServer)
            {
                string matchName = Guid.NewGuid().ToString();

                BoltMatchmaking.CreateSession(
                    sessionID: matchName,
                    sceneToLoad: "NetworkedPaint_Game"
                    );
            }

            if (BoltNetwork.IsClient)
            {
                BoltMatchmaking.JoinRandomSession();
            }
        }