Ejemplo n.º 1
0
 internal static void OnManagerInitialized(N.InitializationStatus status)
 {
     Debug.Log("Nearby Init Complete: " + status + " sManager = " + sManager);
     if (status == N.InitializationStatus.VALID)
     {
         if (sCreationCallback != null)
         {
             sCreationCallback.Invoke(new NativeNearbyConnectionsClient(GetManager()));
             sCreationCallback = null;
         }
     }
     else
     {
         Debug.LogError("ERROR: NearbyConnectionManager not initialized: " + status);
     }
 }
Ejemplo n.º 2
0
        private static InitializationStatus ToStatus(S.InitializationStatus status)
        {
            switch (status)
            {
            case S.InitializationStatus.VALID:
                return(InitializationStatus.Success);

            case S.InitializationStatus.ERROR_INTERNAL:
                return(InitializationStatus.InternalError);

            case S.InitializationStatus.ERROR_VERSION_UPDATE_REQUIRED:
                return(InitializationStatus.VersionUpdateRequired);

            default:
                GooglePlayGames.OurUtils.Logger.w("Unknown initialization status: " + status);
                return(InitializationStatus.InternalError);
            }
        }
        private static void InternalOnInitializationFinishedCallback(S.InitializationStatus status,
                                                                     IntPtr userData)
        {
            var callback =
                Callbacks.IntPtrToPermanentCallback <Action <S.InitializationStatus> >(userData);

            if (callback == null)
            {
                Logger.w("Callback for Initialization is null. Received status: " + status);
                return;
            }

            try
            {
                callback(status);
            }
            catch (Exception e)
            {
                Logger.e("Error encountered executing " +
                         "NearbyConnectionsManagerBuilder#InternalOnInitializationFinishedCallback. " +
                         "Smothering exception: " + e);
            }
        }