// Use this for initialization void Start() { _connectedPlayers = new List <ConnectedPlayer>(); PlayFabMultiplayerAgentAPI.Start(); PlayFabMultiplayerAgentAPI.IsDebugging = Debugging; PlayFabMultiplayerAgentAPI.OnMaintenanceCallback += OnMaintenance; PlayFabMultiplayerAgentAPI.OnShutDownCallback += OnShutdown; PlayFabMultiplayerAgentAPI.OnServerActiveCallback += OnServerActive; PlayFabMultiplayerAgentAPI.OnAgentErrorCallback += OnAgentError; UnityNetworkServer.Instance.OnPlayerAdded.AddListener(OnPlayerAdded); UnityNetworkServer.Instance.OnPlayerRemoved.AddListener(OnPlayerRemoved); StartCoroutine(ReadyForPlayers()); }
// Use this for initialization private void PlayFabStart() { Debug.Log("Starting PlayFabMultiplayerAgentAPI"); _connectedPlayers = new List <ConnectedPlayer>(); PlayFabMultiplayerAgentAPI.Start(); PlayFabMultiplayerAgentAPI.IsDebugging = Debugging; PlayFabMultiplayerAgentAPI.OnMaintenanceCallback += OnMaintenance; PlayFabMultiplayerAgentAPI.OnShutDownCallback += OnShutdown; PlayFabMultiplayerAgentAPI.OnServerActiveCallback += OnServerActive; PlayFabMultiplayerAgentAPI.OnAgentErrorCallback += OnAgentError; this.gameObject.AddComponent <PlayFabMultiplayerAgentView>(); StartCoroutine(ReadyForPlayers()); }
private void StartRemoteServer() { Debug.Log("[ServerStartUp]: StartRemoteServer"); _connectedPlayers = new List <ConnectedPlayer>(); PlayFabMultiplayerAgentAPI.Start(); PlayFabMultiplayerAgentAPI.IsDebugging = configuration.playFabDebugging; PlayFabMultiplayerAgentAPI.OnMaintenanceCallback += OnMaintenance; PlayFabMultiplayerAgentAPI.OnShutDownCallback += OnShutdown; PlayFabMultiplayerAgentAPI.OnServerActiveCallback += OnServerActive; PlayFabMultiplayerAgentAPI.OnAgentErrorCallback += OnAgentError; UNetServer.OnPlayerAdded.AddListener(OnPlayerAdded); UNetServer.OnPlayerRemoved.AddListener(OnPlayerRemoved); StartCoroutine(ReadyForPlayers()); StartCoroutine(ShutdownServerInXTime()); }
private void StartRemoteServer() { H.klog($"Starting Remote Server on Dead Server"); PlayFabMultiplayerAgentAPI.Start(); PlayFabMultiplayerAgentAPI.OnServerActiveCallback += OnServerActive; PlayFabMultiplayerAgentAPI.OnMaintenanceCallback += OnMaintenance; PlayFabMultiplayerAgentAPI.OnShutDownCallback += OnServerShutdown; PlayFabMultiplayerAgentAPI.OnAgentErrorCallback += OnAgentError; PlayFabMultiplayerAgentAPI.IsDebugging = true; // subcribe to event on server when adding and removing player knet.evnPlayerAdded += OnServerAddedPlayer; knet.addenv.AddListener(OnServerAddedPlayer); knet.evnPlayerRemoved += OnServerRemovedPlayer; knet.removeevn.AddListener(OnServerRemovedPlayer); StartCoroutine(ReadyForPlayers()); }
// Use this for initialization void Start() { if (configuration.buildType != BuildType.REMOTE_SERVER) { return; } _connectedPlayers = new List <ConnectedPlayer>(); PlayFabMultiplayerAgentAPI.Start(); PlayFabMultiplayerAgentAPI.IsDebugging = Debugging; PlayFabMultiplayerAgentAPI.OnMaintenanceCallback += OnMaintenance; PlayFabMultiplayerAgentAPI.OnShutDownCallback += OnShutdown; PlayFabMultiplayerAgentAPI.OnServerActiveCallback += OnServerActive; PlayFabMultiplayerAgentAPI.OnAgentErrorCallback += OnAgentError; UnityNetworkServer.Instance.OnPlayerAdded.AddListener(OnPlayerAdded); UnityNetworkServer.Instance.OnPlayerRemoved.AddListener(OnPlayerRemoved); StartCoroutine(ReadyForPlayers()); StartCoroutine(ShutdownServerInXTime()); }
void StartPlayFabAPI() { PlayFabMultiplayerAgentAPI.Start(); StartCoroutine(ReadyForPlayers()); }