예제 #1
0
    // 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());
    }
예제 #2
0
        // 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());
        }
예제 #3
0
    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());
    }
예제 #4
0
파일: FabServer.cs 프로젝트: JK-IT/UnityGit
    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());
    }
예제 #5
0
    // 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());
 }