Пример #1
0
        private static SavedGameRequestStatus AsRequestStatus(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus status)
        {
            switch ((status + 5))
            {
            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.ERROR_LICENSE_CHECK_FAILED:
                return(SavedGameRequestStatus.TimeoutError);

            case GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.VALID_BUT_STALE:
                Logger.e("User was not authorized (they were probably not logged in).");
                return(SavedGameRequestStatus.AuthenticationError);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.ERROR_VERSION_UPDATE_REQUIRED:
                return(SavedGameRequestStatus.InternalError);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.ERROR_TIMEOUT:
                Logger.e("User attempted to use the game without a valid license.");
                return(SavedGameRequestStatus.AuthenticationError);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus) 6):
            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus) 7):
                return(SavedGameRequestStatus.Success);
            }
            Logger.e("Unknown status: " + status);
            return(SavedGameRequestStatus.InternalError);
        }
Пример #2
0
        internal static CommonStatusCodes ConvertResponseStatusToCommonStatus(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus status)
        {
            GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus status2 = status;
            switch ((status2 + 5))
            {
            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.ERROR_LICENSE_CHECK_FAILED:
                return(CommonStatusCodes.Timeout);

            case GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.VALID:
                return(CommonStatusCodes.ServiceVersionUpdateRequired);

            case GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.VALID_BUT_STALE:
                return(CommonStatusCodes.AuthApiAccessForbidden);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.ERROR_VERSION_UPDATE_REQUIRED:
                return(CommonStatusCodes.InternalError);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.ERROR_TIMEOUT:
                return(CommonStatusCodes.LicenseCheckFailed);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus) 6):
                return(CommonStatusCodes.Success);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus) 7):
                return(CommonStatusCodes.SuccessCached);
            }
            Debug.LogWarning("Unknown ResponseStatus: " + status + ", defaulting to CommonStatusCodes.Error");
            return(CommonStatusCodes.Error);
        }
Пример #3
0
        internal static GooglePlayGames.BasicApi.ResponseStatus ConvertResponseStatus(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus status)
        {
            GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus status2 = status;
            switch ((status2 + 5))
            {
            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.ERROR_LICENSE_CHECK_FAILED:
                return(GooglePlayGames.BasicApi.ResponseStatus.Timeout);

            case GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.VALID:
                return(GooglePlayGames.BasicApi.ResponseStatus.VersionUpdateRequired);

            case GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.VALID_BUT_STALE:
                return(GooglePlayGames.BasicApi.ResponseStatus.NotAuthorized);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.ERROR_VERSION_UPDATE_REQUIRED:
                return(GooglePlayGames.BasicApi.ResponseStatus.InternalError);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus.ERROR_TIMEOUT:
                return(GooglePlayGames.BasicApi.ResponseStatus.LicenseCheckFailed);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus) 6):
                return(GooglePlayGames.BasicApi.ResponseStatus.Success);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus) 7):
                return(GooglePlayGames.BasicApi.ResponseStatus.SuccessWithStale);
            }
            throw new InvalidOperationException("Unknown status: " + status);
        }
Пример #4
0
        internal static void InternalLeaveRoomCallback(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus response, IntPtr data)
        {
            Logger.d("Entering internal callback for InternalLeaveRoomCallback");
            Action <GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus> action = Callbacks.IntPtrToTempCallback <Action <GooglePlayGames.Native.Cwrapper.CommonErrorStatus.ResponseStatus> >(data);

            if (action != null)
            {
                try
                {
                    action(response);
                }
                catch (Exception exception)
                {
                    Logger.e("Error encountered executing InternalLeaveRoomCallback. Smothering to avoid passing exception into Native: " + exception);
                }
            }
        }