Example #1
0
        internal static GooglePlayGames.BasicApi.UIStatus ConvertUIStatus(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus status)
        {
            GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus status2 = status;
            switch ((status2 + 12))
            {
            case ~(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.VALID | GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.ERROR_INTERNAL):
                return(GooglePlayGames.BasicApi.UIStatus.UiBusy);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus) 6):
                return(GooglePlayGames.BasicApi.UIStatus.UserClosedUI);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus) 7):
                return(GooglePlayGames.BasicApi.UIStatus.Timeout);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus) 8):
                return(GooglePlayGames.BasicApi.UIStatus.VersionUpdateRequired);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus) 9):
                return(GooglePlayGames.BasicApi.UIStatus.NotAuthorized);

            case ~(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.VALID | GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.ERROR_UI_BUSY):
                return(GooglePlayGames.BasicApi.UIStatus.InternalError);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus) 13):
                return(GooglePlayGames.BasicApi.UIStatus.Valid);
            }
            throw new InvalidOperationException("Unknown status: " + status);
        }
Example #2
0
        internal static GooglePlayGames.BasicApi.UIStatus ConvertUIStatus(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus status)
        {
            switch ((status + 6))
            {
            case ~(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.VALID | GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.ERROR_INTERNAL):
                return(GooglePlayGames.BasicApi.UIStatus.UserClosedUI);

            case GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.VALID:
                return(GooglePlayGames.BasicApi.UIStatus.Timeout);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.ERROR_NOT_AUTHORIZED:
                return(GooglePlayGames.BasicApi.UIStatus.VersionUpdateRequired);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.ERROR_VERSION_UPDATE_REQUIRED:
                return(GooglePlayGames.BasicApi.UIStatus.NotAuthorized);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.ERROR_TIMEOUT:
                return(GooglePlayGames.BasicApi.UIStatus.InternalError);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus) 7):
                return(GooglePlayGames.BasicApi.UIStatus.Valid);
            }
            if (status != GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.ERROR_UI_BUSY)
            {
                throw new InvalidOperationException("Unknown status: " + status);
            }
            return(GooglePlayGames.BasicApi.UIStatus.UiBusy);
        }
Example #3
0
        private static SelectUIStatus AsUIStatus(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus uiStatus)
        {
            switch ((uiStatus + 6))
            {
            case ~(GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.VALID | GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.ERROR_INTERNAL):
                return(SelectUIStatus.UserClosedUI);

            case GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.VALID:
                return(SelectUIStatus.TimeoutError);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.ERROR_VERSION_UPDATE_REQUIRED:
                return(SelectUIStatus.AuthenticationError);

            case ~GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus.ERROR_TIMEOUT:
                return(SelectUIStatus.InternalError);

            case ((GooglePlayGames.Native.Cwrapper.CommonErrorStatus.UIStatus) 7):
                return(SelectUIStatus.SavedGameSelected);
            }
            Logger.e("Encountered unknown UI Status: " + uiStatus);
            return(SelectUIStatus.InternalError);
        }