public override void ConnectRequest(UdpEndPoint endpoint, IProtocolToken token)
        {
            if (BoltNetwork.IsServer)
            {
                if (full == false)
                {
                    full = true;

                    PhotonRoomProperties roomProperties = new PhotonRoomProperties
                    {
                        IsOpen    = false,
                        IsVisible = true
                    };

                    BoltMatchmaking.UpdateSession(roomProperties);

                    BoltNetwork.Accept(endpoint);

                    Debug.Log("Accept Client");
                }
                else
                {
                    BoltNetwork.Refuse(endpoint);

                    Debug.Log("Refuse Client");
                }
            }
        }
        public override void Disconnected(BoltConnection connection)
        {
            if (full == true)
            {
                full = false;

                PhotonRoomProperties roomProperties = new PhotonRoomProperties
                {
                    IsOpen = true, IsVisible = true
                };

                BoltMatchmaking.UpdateSession(roomProperties);
            }
        }
Beispiel #3
0
        private void StartGame()
        {
            if (!BoltNetwork.IsServer)
            {
                return;
            }

            BoltNetwork.LoadScene("PreAlphaMap");
            BoltMatchmaking.UpdateSession(new PhotonRoomProperties
            {
                IsOpen    = false,
                IsVisible = false
            });
        }
Beispiel #4
0
    public static void UpdateLobbyData(LobbyData lobbyData)
    {
        if (BoltNetwork.IsRunning && BoltNetwork.IsServer)
        {
            BoltNetwork.RegisterTokenClass <LobbyToken>();

            LobbyToken token = new LobbyToken().BuildData(lobbyData);
            BoltMatchmaking.UpdateSession(token);
            Debug.Log("Lobby data updated.");
        }
        else
        {
            Debug.LogWarning("Can't update data if Bolt is not running.");
        }
    }
Beispiel #5
0
        public override void Disconnected(BoltConnection connection)
        {
            if (full == true)
            {
                full = false;

                PhotonRoomProperties roomProperties = new PhotonRoomProperties
                {
                    IsOpen = true, IsVisible = true
                };

                BoltMatchmaking.UpdateSession(roomProperties);

                // var matchName = Guid.NewGuid().ToString();
                // BoltNetwork.SetServerInfo(matchName, roomProperties);
            }
        }