Ejemplo n.º 1
0
        public void ShutDownMultiplayerServer(string sessionId, string region)
        {
            if (!PlayFabAuthenticationAPI.IsEntityLoggedIn())
            {
                PlayFabServerInstance.singleton.GetEntityToken();
            }

            ShutdownMultiplayerServerRequest request = new ShutdownMultiplayerServerRequest();

            request.BuildId   = PlayFabServerInstance.singleton.BuildIdKey;
            request.SessionId = sessionId;
            request.Region    = region;
            PlayFabMultiplayerAPI.ShutdownMultiplayerServer(request, ShutdownMultiplayerServerSuccess, Error, null, null);
            Debug.Log("[PlayFabMultiplayerServer] Shutting Down: " + sessionId + " Region: " + region);
        }
Ejemplo n.º 2
0
        public void ShutDownAllMultiplayerServer()
        {
            if (!PlayFabAuthenticationAPI.IsEntityLoggedIn())
            {
                PlayFabServerInstance.singleton.GetEntityToken();
            }

            foreach (KeyValuePair <string, string> server in servers)
            {
                ShutdownMultiplayerServerRequest request = new ShutdownMultiplayerServerRequest();
                request.BuildId   = PlayFabServerInstance.singleton.BuildIdKey;
                request.SessionId = server.Value;
                request.Region    = server.Key;
                PlayFabMultiplayerAPI.ShutdownMultiplayerServer(request, ShutdownMultiplayerServerSuccess, Error, null, null);
                Debug.Log("[PlayFabMultiplayerServer] Shutting Down: " + server.Value);
            }
        }
Ejemplo n.º 3
0
 public void ConfirmEndServerSession(ServerID identity)
 {
     ShowLoader();
     Debug.Log("End Session: " + identity.SessionIdentifier + "\nfor build: " + lastServerBuildId);
     PlayFabMultiplayerAPI.ShutdownMultiplayerServer(new ShutdownMultiplayerServerRequest {
         Region    = identity.Region,
         BuildId   = lastServerBuildId,
         SessionId = identity.SessionIdentifier
     },
                                                     result => {
         Debug.Log("SHUTDOWN OK: " + result.ToJson().ToString());
         Inform("Server was shutdown successfully.");
     },
                                                     error => {
         Debug.LogError("SHUTDOWN ERROR: " + error.GenerateErrorReport());
         Inform("Unable to shutdown server! " + error.ErrorMessage);
     });
 }