Пример #1
0
        internal LeaderboardResult(IntPtr leaderboardResultPtr)
        {
            pImpl = new LeaderboardResultImpl(leaderboardResultPtr);

            LEADERBOARD_RESULT cResult = MarshalingHelpers.PtrToStructure <LEADERBOARD_RESULT>(leaderboardResultPtr);

            TotalRowCount = cResult.TotalRowCount;

            Columns = new List <LeaderboardColumn>();
            if (cResult.ColumnsCount > 0)
            {
                IntPtr[] cColumns = new IntPtr[cResult.ColumnsCount];
                Marshal.Copy(cResult.Columns, cColumns, 0, (int)cResult.ColumnsCount);
                for (uint i = 0; i < cResult.ColumnsCount; i++)
                {
                    Columns.Add(new LeaderboardColumn(cColumns[i]));
                }
            }

            Rows = new List <LeaderboardRow>();
            if (cResult.RowsCount > 0)
            {
                IntPtr[] cRows = new IntPtr[cResult.RowsCount];
                Marshal.Copy(cResult.Rows, cRows, 0, (int)cResult.RowsCount);
                for (uint i = 0; i < cResult.RowsCount; i++)
                {
                    Rows.Add(new LeaderboardRow(cRows[i]));
                }
            }
        }
        internal LeaderboardColumn(IntPtr leaderboardColumnPtr)
        {
            LEADERBOARD_COLUMN cColumn = MarshalingHelpers.PtrToStructure <LEADERBOARD_COLUMN>(leaderboardColumnPtr);

            StatisticType = cColumn.StatType;
            StatisticName = MarshalingHelpers.Utf8ToString(cColumn.StatName);
        }
Пример #3
0
        internal PermissionDenyReason(IntPtr structPtr)
        {
            var permissionDenyReasonStruct = MarshalingHelpers.PtrToStructure <XSAPI_PRIVACY_PERMISSION_DENY_REASON>(structPtr);

            Reason            = MarshalingHelpers.Utf8ToString(permissionDenyReasonStruct.reason);
            RestrictedSetting = MarshalingHelpers.Utf8ToString(permissionDenyReasonStruct.restrictedSetting);
        }
        internal PreferredColor(IntPtr preferredColorPtr)
        {
            PREFERRED_COLOR cPreferredColor = MarshalingHelpers.PtrToStructure <PREFERRED_COLOR>(preferredColorPtr);

            PrimaryColor   = MarshalingHelpers.Utf8ToString(cPreferredColor.PrimaryColor);
            SecondaryColor = MarshalingHelpers.Utf8ToString(cPreferredColor.SecondaryColor);
            TertiaryColor  = MarshalingHelpers.Utf8ToString(cPreferredColor.TertiaryColor);
        }
Пример #5
0
        internal StatisticValue(IntPtr statValuePtr)
        {
            STATISTIC_VALUE cStatValue = MarshalingHelpers.PtrToStructure <STATISTIC_VALUE>(statValuePtr);

            Name      = MarshalingHelpers.Utf8ToString(cStatValue.Name);
            AsNumber  = cStatValue.AsNumber;
            AsInteger = cStatValue.AsInteger;
            AsString  = MarshalingHelpers.Utf8ToString(cStatValue.AsString);
            DataType  = cStatValue.DataType;
        }
        internal SocialManagerPresenceTitleRecord(IntPtr titleRecordPtr)
        {
            SOCIAL_MANAGER_PRESENCE_TITLE_RECORD cTitleRecord = MarshalingHelpers.PtrToStructure <SOCIAL_MANAGER_PRESENCE_TITLE_RECORD>(titleRecordPtr);

            IsTitleActive  = cTitleRecord.IsTitleActive;
            IsBroadcasting = cTitleRecord.IsBroadcasting;
            Device         = cTitleRecord.DeviceType;
            TitleId        = cTitleRecord.TitleId;
            PresenceText   = MarshalingHelpers.Utf8ToString(cTitleRecord.PresenceText);
        }
Пример #7
0
        internal void Refresh()
        {
            var CStruct = MarshalingHelpers.PtrToStructure <XSAPI_TITLE_STORAGE_BLOB_METADATA>(this.metadataPtr);

            this.ServiceConfigurationId = MarshalingHelpers.Utf8ToString(CStruct.serviceConfigurationId);
            this.BlobPath    = MarshalingHelpers.Utf8ToString(CStruct.blobPath);
            this.BlobType    = CStruct.blobType;
            this.StorageType = CStruct.storageType;
            this.DisplayName = MarshalingHelpers.Utf8ToString(CStruct.displayName);
            this.ETag        = MarshalingHelpers.Utf8ToString(CStruct.ETag);
            this.Length      = CStruct.length;
            this.XboxUserId  = MarshalingHelpers.Utf8ToString(CStruct.xboxUserId);
        }
Пример #8
0
        public LeaderboardQueryImpl(IntPtr ptr, LeaderboardQuery query)
        {
            m_leaderboardQueryPtr = ptr;

            LEADERBOARD_QUERY cLeaderboardQuery = MarshalingHelpers.PtrToStructure <LEADERBOARD_QUERY>(m_leaderboardQueryPtr);

            m_skipResultToMe   = cLeaderboardQuery.SkipResultToMe;
            m_skipResultToRank = cLeaderboardQuery.SkipResultToRank;
            m_maxItems         = cLeaderboardQuery.MaxItems;
            m_order            = cLeaderboardQuery.Order;
            query.StatName     = MarshalingHelpers.Utf8ToString(cLeaderboardQuery.StatName);
            query.SocialGroup  = MarshalingHelpers.Utf8ToString(cLeaderboardQuery.SocialGroup);
            query.HasNext      = cLeaderboardQuery.HasNext;
        }
        internal MultiplePermissionsCheckResult(IntPtr multiplePermissionsStructPtr)
        {
            var multiplePermissionsStruct = MarshalingHelpers.PtrToStructure <XSAPI_PRIVACY_MULTIPLE_PERMISSIONS_CHECK_RESULT>(multiplePermissionsStructPtr);

            XboxUserId = MarshalingHelpers.Utf8ToString(multiplePermissionsStruct.xboxUserId);

            Items = new List <PermissionCheckResult>((int)multiplePermissionsStruct.itemsCount);

            int    size = MarshalingHelpers.SizeOf <XSAPI_PRIVACY_PERMISSION_CHECK_RESULT>();
            IntPtr permissionStructPtr = multiplePermissionsStruct.items;

            for (ulong i = 0; i < multiplePermissionsStruct.itemsCount; ++i)
            {
                var permissionCheckResultStruct = MarshalingHelpers.PtrToStructure <XSAPI_PRIVACY_PERMISSION_CHECK_RESULT>(permissionStructPtr);
                Items.Add(new PermissionCheckResult(permissionCheckResultStruct));
                permissionStructPtr = permissionStructPtr.Increment(size);
            }
        }
        internal SocialManagerPresenceRecord(IntPtr socialManagerPresenceRecordPtr)
        {
            this.m_socialManagerPresenceRecordPtr = socialManagerPresenceRecordPtr;

            SOCIAL_MANAGER_PRESENCE_RECORD cPresenceRecord = MarshalingHelpers.PtrToStructure <SOCIAL_MANAGER_PRESENCE_RECORD>(socialManagerPresenceRecordPtr);

            UserState = cPresenceRecord.UserState;

            m_titleRecords = new List <SocialManagerPresenceTitleRecord>();
            if (cPresenceRecord.PresenceTitleRecordsCount > 0)
            {
                IntPtr[] cTitleRecords = new IntPtr[cPresenceRecord.PresenceTitleRecordsCount];
                Marshal.Copy(cPresenceRecord.PresenceTitleRecords, cTitleRecords, 0, (int)cPresenceRecord.PresenceTitleRecordsCount);
                foreach (IntPtr cTitleRecord in cTitleRecords)
                {
                    m_titleRecords.Add(new SocialManagerPresenceTitleRecord(cTitleRecord));
                }
            }
        }
Пример #11
0
        internal LeaderboardRow(IntPtr leaderboardRowPtr)
        {
            LEADERBOARD_ROW cRow = MarshalingHelpers.PtrToStructure <LEADERBOARD_ROW>(leaderboardRowPtr);

            Rank       = cRow.Rank;
            Percentile = cRow.Percentile;
            XboxUserId = MarshalingHelpers.Utf8ToString(cRow.XboxUserId);
            Gamertag   = MarshalingHelpers.Utf8ToString(cRow.Gamertag);

            Values = new List <string>();
            if (cRow.ColumnValuesCount > 0)
            {
                IntPtr[] cValues = new IntPtr[cRow.ColumnValuesCount];
                Marshal.Copy(cRow.ColumnValues, cValues, 0, (int)cRow.ColumnValuesCount);
                for (uint i = 0; i < cRow.ColumnValuesCount; i++)
                {
                    Values.Add(Marshal.PtrToStringAnsi(cValues[i]));
                }
            }
        }
Пример #12
0
 internal PermissionCheckResult(IntPtr permissionCheckResultStructPtr)
     : this(MarshalingHelpers.PtrToStructure <XSAPI_PRIVACY_PERMISSION_CHECK_RESULT>(permissionCheckResultStructPtr))
 {
 }
Пример #13
0
        internal LeaderboardResultEventArgs(IntPtr leaderboardResultEventArgsPtr)
        {
            LEADERBOARD_RESULT_EVENT_ARGS cArgs = MarshalingHelpers.PtrToStructure <LEADERBOARD_RESULT_EVENT_ARGS>(leaderboardResultEventArgsPtr);

            Result = new LeaderboardResult(cArgs.Result);
        }