Exemplo n.º 1
0
        public static void XamShowGameInviteUI(XboxConsole Console, uint XUserIndex, ulong[] Recipients = null)
        {
            if (XUserIndex > 3)
            {
                throw new Exception("XDKUtilities.XamShowGameInviteUI: Invalid user index specified.It must be less than or equal to 3.");
            }
            if (Recipients != null)
            {
                if (Recipients.Length > 64)
                {
                    throw new Exception("XDKUtilities.XamShowGameInviteUI: Too many recipients specified. The maximum is 64.");
                }
                if (Recipients.Any(recipient => !XUID.IsOnlineXUID(recipient) && !XUID.IsTeamXUID(recipient)))
                {
                    throw new Exception("XDKUtilities.XamShowGameInviteUI: Invalid recipient online/team XUID specified.");
                }
            }
            var dwUserIndex     = new XDRPCArgumentInfo <uint>(XUserIndex);
            var pXuidRecipients = Recipients == null || Recipients.Length == 0 ? new XDRPCNullArgumentInfo() : (XDRPCArgumentInfo) new XDRPCArrayArgumentInfo <ulong[]>(Recipients);
            var cRecipients     = Recipients == null ? 0 : Recipients.Length;
            var returnVal       = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 717, dwUserIndex, pXuidRecipients, cRecipients);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }
Exemplo n.º 2
0
        public static void XamShowMessageComposeUI(XboxConsole Console, uint XUserIndex, ulong[] Recipients = null, string MessageText = "")
        {
            if (XUserIndex > 3)
            {
                throw new Exception("XDKUtilities.XamShowMessageComposeUI: Invalid user index specified.");
            }
            if (Recipients != null)
            {
                if (Recipients.Length > 64)
                {
                    throw new Exception("XDKUtilities.XamShowMessageComposeUI: Too many recipients specified. The maximum is 64.");
                }
                if (Recipients.Any(recipient => !XUID.IsOnlineXUID(recipient) && !XUID.IsTeamXUID(recipient)))
                {
                    throw new Exception("XDKUtilities.XamShowMessageComposeUI: Invalid recipient online/team XUID specified.");
                }
            }
            if (MessageText.Length > 255)
            {
                throw new Exception("XDKUtilities.XamShowMessageComposeUI: Specified message text is invalid. It must be less than or equal to 255 characters in length.");
            }
            var dwUserIndex     = new XDRPCArgumentInfo <uint>(XUserIndex);
            var pXuidRecipients = Recipients == null || Recipients.Length == 0 ? new XDRPCNullArgumentInfo() : (XDRPCArgumentInfo) new XDRPCArrayArgumentInfo <ulong[]>(Recipients);
            var cRecipients     = Recipients == null ? 0 : Recipients.Length;
            var pszText         = string.IsNullOrWhiteSpace(MessageText) ? new XDRPCNullArgumentInfo() : (XDRPCArgumentInfo) new XDRPCStringArgumentInfo(MessageText, Encoding.BigEndianUnicode);
            var returnVal       = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 716, dwUserIndex, pXuidRecipients, cRecipients, pszText);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }
Exemplo n.º 3
0
        public static XAMACCOUNTINFO XamProfileFindAccount(XboxConsole Console, ulong OfflineXUID)
        {
            if (!XUID.IsOfflineXUID(OfflineXUID))
            {
                throw new Exception("XDKUtilities.XamProfileFindAccount: Invalid offline XUID specified.");
            }
            var xuidOffline  = new XDRPCArgumentInfo <ulong>(OfflineXUID);
            var pAccountInfo = new XDRPCStructArgumentInfo <XAMACCOUNTINFO>(new XAMACCOUNTINFO(), ArgumentType.Out);
            var returnVal    = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 565, xuidOffline, pAccountInfo);

            //if (returnVal != 0x00000000) throw ProfilesExceptionFactory.CreateExceptionFromErrorCode(returnVal);
            return(pAccountInfo.Value);
        }
Exemplo n.º 4
0
        public static void XamShowGamerCardUIForXUID(XboxConsole Console, uint XUserIndex, ulong GamerXUID)
        {
            if (XUserIndex > 3)
            {
                throw new Exception("XDKUtilities.XamShowGamerCardUIForXUID: Invalid user index specified. It must be less than or equal to 3.");
            }
            if (!XUID.IsOnlineXUID(GamerXUID) && !XUID.IsTeamXUID(GamerXUID))
            {
                throw new Exception("XDKUtilities.XamShowGamerCardUIForXUID: Invalid gamer online/team XUID specified.");
            }
            var dwUserIndex = new XDRPCArgumentInfo <uint>(XUserIndex);
            var xuidPlayer  = new XDRPCArgumentInfo <ulong>(GamerXUID);
            var returnVal   = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 771, dwUserIndex, xuidPlayer);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }
Exemplo n.º 5
0
        public static void XamShowFofUI(XboxConsole Console, uint XUserIndex, ulong FriendXUID, string Gamertag)
        {
            if (XUserIndex > 3)
            {
                throw new Exception("XDKUtilities.XamShowFofUI: Invalid user index specified. It must be less than or equal to 3.");
            }
            if (!XUID.IsOnlineXUID(FriendXUID) && !XUID.IsTeamXUID(FriendXUID))
            {
                throw new Exception("XDKUtilities.XamShowFofUI: Invalid friend online/team XUID specified.");
            }
            if (Gamertag.Length > 15)
            {
                throw new Exception("XDKUtilities.XamShowFofUI: Invalid Gamertag specified. It must be less than or equal to 16 characters in length.");
            }
            var dwUserIndex = new XDRPCArgumentInfo <uint>(XUserIndex);
            var xuidFriend  = new XDRPCArgumentInfo <ulong>(FriendXUID);
            var pszGamertag = new XDRPCStringArgumentInfo(Gamertag, Encoding.ASCII);
            var returnVal   = Console.ExecuteRPC <uint>(XDRPCMode.Title, "xam.xex", 1572, dwUserIndex, xuidFriend, pszGamertag);

            if (returnVal != 0x00000000)
            {
                throw new COMException("Exception from HRESULT: " + string.Format("0x{0:X}", returnVal), (int)returnVal);
            }
        }