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 BoltStartDone() { if (BoltNetwork.IsServer) { BoltMatchmaking.CreateSession(sessionID: Guid.NewGuid().ToString()); } }
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); } }
public override void SessionListUpdated(Map <Guid, UdpSession> sessionList) { if (_timerRoutine != null) { StopCoroutine(_timerRoutine); _timerRoutine = null; } Debug.LogFormat("Session list updated: {0} total sessions", sessionList.Count); foreach (var session in sessionList) { PhotonSession photonSession = session.Value as PhotonSession; if (photonSession != null && photonSession.Source == UdpSessionSource.Photon) { object value; if (photonSession.Properties.TryGetValue("type", out value)) { BoltLog.Info("Room with type: {0}", value); } if (photonSession.Properties.TryGetValue("map", out value)) { BoltLog.Info("Room with map: {0}", value); } BoltMatchmaking.JoinSession(photonSession); } } }
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(); } }
private void JoinEventHandler(UdpSession session) { if (BoltNetwork.IsClient) { BoltMatchmaking.JoinSession(session); } }
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; } }
public override void SessionListUpdated(Map <Guid, UdpSession> sessionList) { FeedbackUser("Searching ..."); //On rejoin le seul server qui existe pour le moment //Vu que le server est dans PlayScene on va essayer de load ca BoltMatchmaking.JoinSession(HeadlessServerManager1.RoomID()); }
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 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..."); }
public override void BoltStartDone() { if (BoltNetwork.IsServer) { BoltMatchmaking.CreateSession(sessionID: matchName.text, sceneToLoad: "Zoom"); } }
public override void BoltStartDone() { BoltMatchmaking.CreateSession( sessionID: Guid.NewGuid().ToString(), sceneToLoad: "Main" ); }
void State_SelectRoom() { GUI.Label(labelRoom, "Looking for rooms:", labelRoomStyle); if (BoltNetwork.SessionList.Count > 0) { GUILayout.BeginVertical(); GUILayout.Space(30); foreach (var session in BoltNetwork.SessionList) { var photonSession = session.Value as PhotonSession; if (photonSession.Source == UdpSessionSource.Photon) { var matchName = photonSession.HostName; var label = string.Format("Join: {0} | {1}/{2}", matchName, photonSession.ConnectionsCurrent, photonSession.ConnectionsMax); if (ExpandButton(label)) { BoltMatchmaking.JoinSession(photonSession); state = State.Started; } } } GUILayout.EndVertical(); } }
public override void BoltStartDone() { if (BoltNetwork.IsClient) { BoltMatchmaking.JoinRandomSession(); } }
public override void BoltStartDone() { if (BoltNetwork.IsServer) { PlayerPrefs.SetString("currentSession", SessionInput.text); BoltMatchmaking.CreateSession(sessionID: SessionInput.text, sceneToLoad: "FPSGame"); } }
public override void BoltStartDone() { if (BoltNetwork.IsServer) { BoltMatchmaking.CreateSession(serverName); BoltNetwork.LoadScene("DisCo-Scene"); } }
// // public override void BoltStartBegin() // { // BoltNetwork.RegisterTokenClass<PhotonRoomProperties>(); // } public override void BoltStartDone() { if (BoltNetwork.IsServer) { BoltMatchmaking.CreateSession(sessionID: "test", sceneToLoad: sceneToLoad); } // BoltNetwork.EnableLanBroadcast(); }
/// <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"); } }
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" ); }
public override void BoltStartDone() { if (BoltNetwork.IsServer) { string matchName = Guid.NewGuid().ToString(); BoltMatchmaking.CreateSession(sessionID: matchName, sceneToLoad: "Multiplayer"); } }
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); } }
public override void BoltStartDone() { if (BoltNetwork.IsServer) { string matchName = lobbyname.GetComponent <UnityEngine.UI.Text>().text; BoltMatchmaking.CreateSession(matchName); BoltNetwork.LoadScene("Main"); } }
public override void ConnectToSession(INetworkInterfaceSession session, OperationResultDelegate onComplete) { _operationCallbackSessionConnected = onComplete; UdpSession udpSession = ((PhotonNetworkInterfaceSession)session).UdpSession; BoltMatchmaking.JoinSession(udpSession); _connectedSessionInfo = session; }
public override void BoltStartDone() { if (!BoltNetwork.IsServer) { return; } var matchName = Guid.NewGuid().ToString(); BoltMatchmaking.CreateSession(matchName, null, "Game"); }
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 SessionListUpdated(Map <Guid, UdpSession> sessionList) { foreach (var session in sessionList) { UdpSession photonSession = session.Value as UdpSession; if (photonSession.Source == UdpSessionSource.Photon) { BoltMatchmaking.JoinSession(photonSession); } } }
public override void BoltStartDone() { // If we pressed join game, join a random session if (BoltNetwork.IsClient) { BoltMatchmaking.JoinRandomSession(); } else if (offlineMode) { BoltNetwork.LoadScene(GameData.ScenesInBuild.scenes[1]); } }
public override void BoltStartDone() { if (BoltNetwork.IsServer) { currentSession = PlayerPrefs.GetString("currentSession"); BoltMatchmaking.CreateSession(sessionID: currentSession, sceneToLoad: "FPSGame"); } else { BoltMatchmaking.JoinSession(currentSession); } }
public override void BoltStartDone() { if (BoltNetwork.IsServer) { //BoltMatchmaking.CreateSession(Guid.NewGuid().ToString(), null, "SampleScene"); BoltMatchmaking.CreateSession( sessionID: "Jocasta", sceneToLoad: "SampleScene" ); } }