Example #1
1
 public static void SendFriendRequest(XDevkit.IXboxConsole xbc, Xuid xuidFrom, Xuid xuidTo)
 {
     try
     {
         XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0x4e6);
         XDRPCArgumentInfo<ulong> info = new XDRPCArgumentInfo<ulong>((ulong)xuidFrom);
         XDRPCArgumentInfo<ulong> info2 = new XDRPCArgumentInfo<ulong>((ulong)xuidTo);
         XDRPCNullArgumentInfo info3 = new XDRPCNullArgumentInfo();
         uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2, info3 });
         if (errorCode != 0)
         {
             //throw ProfilesExceptionFactory.CreateExceptionFromErrorCode(errorCode);
         }
     }
     catch (XDRPCException exception)
     {
         //throw new ProfilesException(exception);
     }
 }
Example #2
0
 internal Friend(string gamertag, Xuid onlineXuid, FriendRequestStatus requestStatus, FriendStatus friendStatus, string richPresence, uint titleId)
     : base(gamertag, onlineXuid)
 {
     this.RequestStatus = requestStatus;
     this.FriendState = friendStatus;
     this.RichPresence = richPresence;
     this.TitleId = titleId;
 }
 internal ConsoleProfile(string gamertag, Xuid onlineXuid, Xuid offlineXuid, SubscriptionTier tier, XboxLiveCountry country, IXboxConsole console, IProfileSupport profileSupport)
     : base(gamertag, onlineXuid)
 {
     this.OfflineXuid = offlineXuid;
     this.Tier = tier;
     this.Country = country;
     this.Console = console;
     this.profileSupport = profileSupport;
     //this.Friends = FriendsManagerFactory.CreateFriendsManager(this);
 }
Example #4
0
 public static void KickUserFromParty(XDevkit.IXboxConsole xbc, Xuid xuidToKick)
 {
     try
     {
         XDRPCStructArgumentInfo<XPARTY_USER_LIST> partyUserList = GetPartyUserList(xbc);
         XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0xb02);
         XDRPCArgumentInfo<ulong> info2 = new XDRPCArgumentInfo<ulong>((ulong)xuidToKick);
         uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info2 });
         if (errorCode != 0)
         {
             CreateExceptionFromErrorCode(errorCode);
         }
         WaitForPartyState(xbc, PartyState.XPARTY_STATE_INPARTY, TimeSpan.FromSeconds(15.0));
     }
     catch (XDRPCException exception)
     {
         //throw new ProfilesException(exception);
     }
 }
Example #5
0
 //static public string GetXUID(XDevkit.IXboxConsole xbc, string gamertag)
 //{
 //    XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, Addresses.g_XUserFindUserAddressDEV);
 //    //((XDevkit.IXboxConsole)xbc).Call(0x81824DF8, new object[] { 0x0009000006F93463, 0, gamertag, (int)0x18, Addresses.g_freememory + 0x20, 0 });
 //    XDRPCStringArgumentInfo GT = new XDRPCStringArgumentInfo(gamertag, Encoding.ASCII);
 //    XDRPCArgumentInfo<ulong> MyXUID = new XDRPCArgumentInfo<ulong>(0x0009000006F93463L);
 //    XDRPCArgumentInfo<int> idk = new XDRPCArgumentInfo<int>(0);
 //    XDRPCArgumentInfo<int> idk2 = new XDRPCArgumentInfo<int>((int)0x18);
 //    XDRPCArgumentInfo<ulong> XUID = new XDRPCArgumentInfo<ulong>(0L);
 //    uint num = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { MyXUID, idk, GT, idk2, XUID, idk });
 //    return XUID.Value.ToString("X16");
 //}
 public static void JoinParty(XDevkit.IXboxConsole xbc, UserIndex userIndex, Xuid xuidContact)
 {
     try
     {
         XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, "xam.xex", 0xb01);
         XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>((uint)userIndex);
         XDRPCArgumentInfo<ulong> info2 = new XDRPCArgumentInfo<ulong>((ulong)xuidContact);
         uint errorCode = ((XDevkit.IXboxConsole)xbc).ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2 });
         if (errorCode != 0)
         {
             CreateExceptionFromErrorCode(errorCode);
         }
         WaitForPartyState(xbc, PartyState.XPARTY_STATE_INPARTY, TimeSpan.FromSeconds(15.0));
     }
     catch (XDRPCException exception)
     {
         //throw new ProfilesException(exception);
     }
 }
Example #6
0
        public async Task MainAsync(string[] args)
        {
            // TODO: remove this
#if DEBUG
            if (args == null || args.Length == 0)
            {
                Write("[Debug] Enter Command: ");
                args = new[] { ReadLine() };
            }
#endif

            var config = new Configuration();
            config.AddJsonFile("config.json");
            config.AddEnvironmentVariables();

            // check args
            if (args == null ||
                args.Length == 0 ||
                args[0].ToLowerInvariant() == "h" ||
                args[0].ToLowerInvariant() == "help")
            {
                // write help
                var commands =
                    Environment.NewLine + Environment.NewLine +
                    "Xbox Live Enviroment Api - Build " + "alpha 0001" +
                    Environment.NewLine + Environment.NewLine +
                    "USAGE: xbl <command> [options]" +
                    Environment.NewLine + Environment.NewLine +

                    "  xbl login				description_1"+ Environment.NewLine +
                    "  xbl refresh				description_2"+ Environment.NewLine +
                    "  xbl help					description_3"+ Environment.NewLine;

                WriteLine(commands);

#if DEBUG
                ReadLine();
#endif

                return;
            }

            var validInput = false;
            switch (args[0].ToLowerInvariant())
            {
            case "login":
                string windowsLiveAuthenticationServer = null;
                if (!config.TryGet("windows_live_authentication_server", out windowsLiveAuthenticationServer))
                {
                    windowsLiveAuthenticationServer = "http://xdc-wl-auth-api.herokuapp.com/windowslive/authentication/create";
                }
                await Login(windowsLiveAuthenticationServer);

                validInput = true;
                break;

            case "refresh":
                if (!ValidateAuth())
                {
                    return;
                }
                await RefreshTokens(true);

                validInput = true;
                break;

            case "summary":
                if (!ValidateAuth())
                {
                    return;
                }
                await RefreshTokens();

                var settings = GetSettings();

                var xuid = args.Length > 1 ? args[1] : settings.XboxUserId.ToString();
                await Xuid.Summary(settings.Token, settings.UserHeaderSession, xuid);

                validInput = true;
                break;
            }

            if (!validInput)
            {
                WriteLine("No valid command specified - type `xbl help` for a list of options");
            }

#if DEBUG
            ReadLine();
#endif
        }
 internal PartyMember(string gamertag, Xuid onlineXuid, bool isLocal, Microsoft.Test.Xbox.Profiles.UserIndex userIndex)
     : base(gamertag, onlineXuid)
 {
     this.IsLocal = isLocal;
     this.UserIndex = userIndex;
 }