diff --git a/RAMAccount.lua b/RAMAccount.lua index 8ac9ccb..847eb82 100644 --- a/RAMAccount.lua +++ b/RAMAccount.lua @@ -93,8 +93,8 @@ function Account:SetAlias(Alias) return POST('SetAlias', self.Username, Alias) e function Account:SetDescription(Description) return POST('SetDescription', self.Username, Description) end function Account:AppendDescription(Description) return POST('AppendDescription', self.Username, Description) end -function Account:GetField(Field) return GET('GetField', self.Username, 'Field=' .. Field).Body end -function Account:SetField(Field, Value) return GET('SetField', self.Username, 'Field=' .. Field, 'Value=' .. tostring(Value)).Body end +function Account:GetField(Field) return GET('GetField', self.Username, 'Field=' .. Field) end +function Account:SetField(Field, Value) return GET('SetField', self.Username, 'Field=' .. Field, 'Value=' .. tostring(Value)) end function Account:RemoveField(Field) return GET('RemoveField', self.Username, 'Field=' .. Field) end function Account:GetCookie() return GET('GetCookie', self.Username) end diff --git a/RBX Alt Manager/AccountManager.Designer.cs b/RBX Alt Manager/AccountManager.Designer.cs index 513beab..2ccf16a 100644 --- a/RBX Alt Manager/AccountManager.Designer.cs +++ b/RBX Alt Manager/AccountManager.Designer.cs @@ -44,10 +44,6 @@ private void InitializeComponent() this.UserID = new System.Windows.Forms.TextBox(); this.LabelUserID = new System.Windows.Forms.Label(); this.ServerList = new System.Windows.Forms.Button(); - this.AccountsView = new System.Windows.Forms.ListView(); - this.AccountName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.AliasColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.Description = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.AccountsStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.addAccountsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.removeAccountToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -55,8 +51,6 @@ private void InitializeComponent() this.copyProfileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.moveGroupUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.moveToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.moveUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.moveDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.infoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.viewFieldsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.getAuthenticationTicketToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -66,9 +60,6 @@ private void InitializeComponent() this.HideUsernamesCheckbox = new System.Windows.Forms.CheckBox(); this.BrowserButton = new System.Windows.Forms.Button(); this.ArgumentsB = new System.Windows.Forms.Button(); - this.securityToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.setPasswordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.MainStrip = new System.Windows.Forms.MenuStrip(); this.CurrentPlace = new System.Windows.Forms.Label(); this.LabelPlaceID = new System.Windows.Forms.Label(); this.PlaceTimer = new System.Windows.Forms.Timer(this.components); @@ -78,8 +69,13 @@ private void InitializeComponent() this.SaveToAccount = new System.Windows.Forms.Button(); this.SaveTooltip = new System.Windows.Forms.ToolTip(this.components); this.SaveTimer = new System.Windows.Forms.Timer(this.components); + this.AccountsView = new BrightIdeasSoftware.ObjectListView(); + this.Username = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); + this.AccountAlias = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); + this.Description = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); + this.Group = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.AccountsStrip.SuspendLayout(); - this.MainStrip.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.AccountsView)).BeginInit(); this.SuspendLayout(); // // PlaceID @@ -227,50 +223,6 @@ private void InitializeComponent() this.ServerList.UseVisualStyleBackColor = true; this.ServerList.Click += new System.EventHandler(this.ServerList_Click); // - // AccountsView - // - this.AccountsView.AllowColumnReorder = true; - this.AccountsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.AccountsView.BackColor = System.Drawing.SystemColors.Window; - this.AccountsView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.AccountName, - this.AliasColumn, - this.Description}); - this.AccountsView.ContextMenuStrip = this.AccountsStrip; - this.AccountsView.ForeColor = System.Drawing.Color.Black; - this.AccountsView.FullRowSelect = true; - this.AccountsView.GridLines = true; - this.AccountsView.HideSelection = false; - this.AccountsView.Location = new System.Drawing.Point(13, 12); - this.AccountsView.MultiSelect = false; - this.AccountsView.Name = "AccountsView"; - this.AccountsView.Size = new System.Drawing.Size(485, 247); - this.AccountsView.TabIndex = 17; - this.AccountsView.UseCompatibleStateImageBehavior = false; - this.AccountsView.View = System.Windows.Forms.View.Details; - this.AccountsView.SelectedIndexChanged += new System.EventHandler(this.AccountsView_SelectedIndexChanged); - this.AccountsView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.AccountsView_MouseDown); - this.AccountsView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.AccountsView_MouseMove); - this.AccountsView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.AccountsView_MouseUp); - // - // AccountName - // - this.AccountName.Tag = ""; - this.AccountName.Text = "Name"; - this.AccountName.Width = 120; - // - // AliasColumn - // - this.AliasColumn.Text = "Alias"; - this.AliasColumn.Width = 112; - // - // Description - // - this.Description.Text = "Description"; - this.Description.Width = 229; - // // AccountsStrip // this.AccountsStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -319,9 +271,7 @@ private void InitializeComponent() // moveGroupUpToolStripMenuItem // this.moveGroupUpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.moveToToolStripMenuItem, - this.moveUpToolStripMenuItem, - this.moveDownToolStripMenuItem}); + this.moveToToolStripMenuItem}); this.moveGroupUpToolStripMenuItem.Name = "moveGroupUpToolStripMenuItem"; this.moveGroupUpToolStripMenuItem.Size = new System.Drawing.Size(208, 22); this.moveGroupUpToolStripMenuItem.Text = "Groups"; @@ -329,24 +279,10 @@ private void InitializeComponent() // moveToToolStripMenuItem // this.moveToToolStripMenuItem.Name = "moveToToolStripMenuItem"; - this.moveToToolStripMenuItem.Size = new System.Drawing.Size(174, 22); + this.moveToToolStripMenuItem.Size = new System.Drawing.Size(167, 22); this.moveToToolStripMenuItem.Text = "Move Account To"; this.moveToToolStripMenuItem.Click += new System.EventHandler(this.moveToToolStripMenuItem_Click); // - // moveUpToolStripMenuItem - // - this.moveUpToolStripMenuItem.Name = "moveUpToolStripMenuItem"; - this.moveUpToolStripMenuItem.Size = new System.Drawing.Size(174, 22); - this.moveUpToolStripMenuItem.Text = "Move Group Up"; - this.moveUpToolStripMenuItem.Click += new System.EventHandler(this.moveUpToolStripMenuItem_Click); - // - // moveDownToolStripMenuItem - // - this.moveDownToolStripMenuItem.Name = "moveDownToolStripMenuItem"; - this.moveDownToolStripMenuItem.Size = new System.Drawing.Size(174, 22); - this.moveDownToolStripMenuItem.Text = "Move Group Down"; - this.moveDownToolStripMenuItem.Click += new System.EventHandler(this.moveDownToolStripMenuItem_Click); - // // infoToolStripMenuItem // this.infoToolStripMenuItem.Name = "infoToolStripMenuItem"; @@ -423,32 +359,6 @@ private void InitializeComponent() this.ArgumentsB.UseVisualStyleBackColor = true; this.ArgumentsB.Click += new System.EventHandler(this.ArgumentsB_Click); // - // securityToolStripMenuItem - // - this.securityToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.setPasswordToolStripMenuItem}); - this.securityToolStripMenuItem.Name = "securityToolStripMenuItem"; - this.securityToolStripMenuItem.Size = new System.Drawing.Size(61, 20); - this.securityToolStripMenuItem.Text = "Security"; - // - // setPasswordToolStripMenuItem - // - this.setPasswordToolStripMenuItem.Name = "setPasswordToolStripMenuItem"; - this.setPasswordToolStripMenuItem.Size = new System.Drawing.Size(182, 22); - this.setPasswordToolStripMenuItem.Text = "Set Master Password"; - // - // MainStrip - // - this.MainStrip.Enabled = false; - this.MainStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.securityToolStripMenuItem}); - this.MainStrip.Location = new System.Drawing.Point(0, 0); - this.MainStrip.Name = "MainStrip"; - this.MainStrip.Size = new System.Drawing.Size(784, 24); - this.MainStrip.TabIndex = 20; - this.MainStrip.Text = "MainStrip"; - this.MainStrip.Visible = false; - // // CurrentPlace // this.CurrentPlace.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -534,11 +444,69 @@ private void InitializeComponent() this.SaveTimer.Interval = 2500; this.SaveTimer.Tick += new System.EventHandler(this.SaveTimer_Tick); // + // AccountsView + // + this.AccountsView.AllColumns.Add(this.Username); + this.AccountsView.AllColumns.Add(this.AccountAlias); + this.AccountsView.AllColumns.Add(this.Description); + this.AccountsView.AllColumns.Add(this.Group); + this.AccountsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.AccountsView.CellEditUseWholeCell = false; + this.AccountsView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.Username, + this.AccountAlias, + this.Description, + this.Group}); + this.AccountsView.ContextMenuStrip = this.AccountsStrip; + this.AccountsView.Cursor = System.Windows.Forms.Cursors.Default; + this.AccountsView.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.75F); + this.AccountsView.FullRowSelect = true; + this.AccountsView.HideSelection = false; + this.AccountsView.Location = new System.Drawing.Point(13, 13); + this.AccountsView.Name = "AccountsView"; + this.AccountsView.Size = new System.Drawing.Size(485, 246); + this.AccountsView.TabIndex = 26; + this.AccountsView.UseCompatibleStateImageBehavior = false; + this.AccountsView.View = System.Windows.Forms.View.Details; + this.AccountsView.ModelCanDrop += new System.EventHandler(this.AccountsView_ModelCanDrop); + this.AccountsView.ModelDropped += new System.EventHandler(this.AccountsView_ModelDropped); + this.AccountsView.SelectedIndexChanged += new System.EventHandler(this.AccountsView_SelectedIndexChanged); + // + // Username + // + this.Username.AspectName = "Username"; + this.Username.Sortable = false; + this.Username.Text = "Username"; + this.Username.Width = 120; + // + // AccountAlias + // + this.AccountAlias.AspectName = "Alias"; + this.AccountAlias.Text = "Alias"; + this.AccountAlias.Width = 120; + // + // Description + // + this.Description.AspectName = "Description"; + this.Description.Text = "Description"; + this.Description.Width = 210; + // + // Group + // + this.Group.AspectName = "Group"; + this.Group.MaximumWidth = 0; + this.Group.MinimumWidth = 0; + this.Group.Text = ""; + this.Group.Width = 0; + // // AccountManager // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(784, 301); + this.Controls.Add(this.AccountsView); this.Controls.Add(this.SaveToAccount); this.Controls.Add(this.ImportByCookie); this.Controls.Add(this.OpenApp); @@ -547,8 +515,6 @@ private void InitializeComponent() this.Controls.Add(this.ArgumentsB); this.Controls.Add(this.BrowserButton); this.Controls.Add(this.HideUsernamesCheckbox); - this.Controls.Add(this.MainStrip); - this.Controls.Add(this.AccountsView); this.Controls.Add(this.ServerList); this.Controls.Add(this.LabelUserID); this.Controls.Add(this.UserID); @@ -573,8 +539,7 @@ private void InitializeComponent() this.Load += new System.EventHandler(this.AccountManager_Load); this.Shown += new System.EventHandler(this.AccountManager_Shown); this.AccountsStrip.ResumeLayout(false); - this.MainStrip.ResumeLayout(false); - this.MainStrip.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.AccountsView)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -595,10 +560,6 @@ private void InitializeComponent() private System.Windows.Forms.TextBox UserID; private System.Windows.Forms.Label LabelUserID; private System.Windows.Forms.Button ServerList; - public System.Windows.Forms.ListView AccountsView; - private System.Windows.Forms.ColumnHeader AccountName; - private System.Windows.Forms.ColumnHeader AliasColumn; - private System.Windows.Forms.ColumnHeader Description; private System.Windows.Forms.ContextMenuStrip AccountsStrip; private System.Windows.Forms.ToolStripMenuItem addAccountsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem removeAccountToolStripMenuItem; @@ -610,16 +571,11 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem copySecurityTokenToolStripMenuItem; private System.Windows.Forms.Button BrowserButton; private System.Windows.Forms.Button ArgumentsB; - private System.Windows.Forms.ToolStripMenuItem securityToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem setPasswordToolStripMenuItem; - private System.Windows.Forms.MenuStrip MainStrip; private System.Windows.Forms.Label CurrentPlace; private System.Windows.Forms.Label LabelPlaceID; private System.Windows.Forms.Timer PlaceTimer; private System.Windows.Forms.ToolStripMenuItem moveGroupUpToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem moveToToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem moveUpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem moveDownToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem copyAppLinkToolStripMenuItem; private System.Windows.Forms.Button JoinDiscord; private System.Windows.Forms.Button OpenApp; @@ -629,5 +585,10 @@ private void InitializeComponent() private System.Windows.Forms.Button SaveToAccount; private System.Windows.Forms.ToolTip SaveTooltip; private System.Windows.Forms.Timer SaveTimer; + private BrightIdeasSoftware.ObjectListView AccountsView; + private BrightIdeasSoftware.OLVColumn Group; + private BrightIdeasSoftware.OLVColumn Username; + private BrightIdeasSoftware.OLVColumn AccountAlias; + private BrightIdeasSoftware.OLVColumn Description; } } \ No newline at end of file diff --git a/RBX Alt Manager/AccountManager.cs b/RBX Alt Manager/AccountManager.cs index f5c7cae..bed7522 100644 --- a/RBX Alt Manager/AccountManager.cs +++ b/RBX Alt Manager/AccountManager.cs @@ -1,20 +1,15 @@ -using Microsoft.Win32; +using BrightIdeasSoftware; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using RBX_Alt_Manager.Classes; using RestSharp; using System; -using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; -using System.Globalization; using System.IO; -using System.IO.Compression; -using System.IO.Pipes; using System.Linq; using System.Net; using System.Reflection; -using System.Runtime.InteropServices; using System.Security.Principal; using System.Text; using System.Text.RegularExpressions; @@ -30,12 +25,13 @@ public partial class AccountManager : Form { public static List AccountsList = new List(); public static Account SelectedAccount; - public static RestClient mainclient; - public static RestClient apiclient; - public static RestClient client; - public static RestClient econclient; + public static RestClient MainClient; + public static RestClient FriendsClient; + public static RestClient APIClient; + public static RestClient AuthClient; + public static RestClient EconClient; public static RestClient AccountClient; - public static RestClient webClient; + public static RestClient Web13Client; public static string CurrentPlaceId; public static string CurrentJobId; private AccountAdder aaform; @@ -47,9 +43,7 @@ public partial class AccountManager : Form private static DateTime startTime = DateTime.Now; public static bool IsTeleport = false; public static bool UseOldJoin = false; - public ListViewItem SelectedAccountItem; - private ListViewItem LastViewItem; - private ListViewItem DraggingItem; + public OLVListItem SelectedAccountItem; private DateTime DragTime = DateTime.MinValue; private WebServer AltManagerWS; public static IniFile IniSettings; @@ -60,7 +54,7 @@ public partial class AccountManager : Form private static Mutex rbxMultiMutex; private delegate void SafeCallDelegateAccount(Account account); - private delegate void SafeCallDelegateGroup(string Group, ListViewItem Item = null); + private delegate void SafeCallDelegateGroup(string Group, OLVListItem Item = null); private delegate void SafeCallDelegateRemoveAt(int Index); private delegate void SafeCallDelegateSetAccountViewSubItem(Account account, int Index, string Text); private delegate int SafeCallDelegateInvite(object Item); @@ -68,10 +62,30 @@ public partial class AccountManager : Form public AccountManager() { InitializeComponent(); + + AccountsView.UnfocusedHighlightBackgroundColor = Color.FromArgb(0, 150, 215); + AccountsView.UnfocusedHighlightForegroundColor = Color.FromArgb(240, 240, 240); + + /* SimpleDropSink sink = AccountsView.DropSink as SimpleDropSink; + sink.CanDropBetween = true; + sink.CanDropOnBackground = false; + sink.CanDropOnItem = false; + sink.CanDropOnSubItem = false; + sink.FeedbackColor = Color.FromArgb(33, 33, 33); */ + + AccountsView.AlwaysGroupByColumn = Group; } private static string SaveFilePath = Path.Combine(Environment.CurrentDirectory, "AccountData.json"); + private void RefreshView() + { + // AccountsView.SetObjects(AccountsList); + + AccountsView.BuildList(true); + AccountsView.BuildGroups(); + } + private void LoadAccounts() { if (File.Exists(SaveFilePath)) @@ -80,11 +94,18 @@ private void LoadAccounts() { AccountsList = JsonConvert.DeserializeObject>(File.ReadAllText(SaveFilePath)); - foreach (Account acc in AccountsList) - AddAccountToList(acc); + AccountsView.SetObjects(AccountsList); + + RefreshView(); + + //AccountsList.Sort(); + + //for (int i = 0; i < AccountsList.Count; i++) Console.WriteLine($"{i} {AccountsList[i].Group} : {AccountsList[i].Username}"); } - catch + catch (Exception x) { + MessageBox.Show("Failed to load accounts!\nA backup file was created.\n\n" + x); + File.WriteAllText(SaveFilePath + ".bak", File.ReadAllText(SaveFilePath)); } } @@ -99,8 +120,7 @@ private void LoadAccounts() { AccountsList = JsonConvert.DeserializeObject>(File.ReadAllText(SaveFilePath + ".backup")); - foreach (Account acc in AccountsList) - AddAccountToList(acc); + RefreshView(); } catch { @@ -144,7 +164,7 @@ public static long GetUserID(string Username) { RestRequest request = new RestRequest("users/get-by-username?username=" + Username, Method.GET); request.AddHeader("Accept", "application/json"); - IRestResponse response = apiclient.Execute(request); + IRestResponse response = APIClient.Execute(request); if (response.StatusCode == HttpStatusCode.OK) { @@ -167,24 +187,20 @@ public void AddAccountToList(Account account) } else { - ListViewItem Item = new ListViewItem(new string[] { account.Username, account.Alias, account.Description.Replace("\n", " "), account.Username }); - - AccountsView.Items.Add(Item); - - if (!string.IsNullOrEmpty(account.Group)) AddGroupToList(account.Group, Item, true); + RefreshView(); } } public void SetAccountViewSubItem(Account account, int Index, string Text) { - if (AccountsView.InvokeRequired) + /*if (AccountsView.InvokeRequired) { var getItem = new SafeCallDelegateSetAccountViewSubItem(SetAccountViewSubItem); AccountsView.Invoke(getItem, new object[] { account, Index, Text }); } else { - foreach (ListViewItem Item in AccountsView.Items) + foreach (OLVListItem Item in AccountsView.Items) { if (Item.SubItems[3].Text.Length >= account.Username.Length && account.Username == Item.SubItems[3].Text.Substring(0, account.Username.Length)) { @@ -192,10 +208,10 @@ public void SetAccountViewSubItem(Account account, int Index, string Text) break; } } - } + }*/ } - public void AddGroupToList(string GroupName, ListViewItem Item = null, bool OnStartup = false) + /*public void AddGroupToList(string GroupName, OLVListItem Item = null, bool OnStartup = false) { bool CreateGroup = true; ListViewGroup GroupItem = null; @@ -226,7 +242,7 @@ public void AddGroupToList(string GroupName, ListViewItem Item = null, bool OnSt if (!OnStartup) SaveAccounts(); } - } + }*/ public static void AddAccount(string SecurityToken, string UserData) { @@ -243,6 +259,7 @@ public static void AddAccount(string SecurityToken, string UserData) else { AccountsList.Add(account); + Program.MainForm.AddAccountToList(account); } @@ -366,23 +383,26 @@ private void AccountManager_Load(object sender, EventArgs e) // RobloxProcessTimer.Start(); - mainclient = new RestClient("https://www.roblox.com/"); - mainclient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); + MainClient = new RestClient("https://www.roblox.com/"); + MainClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); - apiclient = new RestClient("https://api.roblox.com/"); - apiclient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); + APIClient = new RestClient("https://api.roblox.com/"); + APIClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); - client = new RestClient("https://auth.roblox.com/"); - client.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); + AuthClient = new RestClient("https://auth.roblox.com/"); + AuthClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); - econclient = new RestClient("https://economy.roblox.com/"); - econclient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); + EconClient = new RestClient("https://economy.roblox.com/"); + EconClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); AccountClient = new RestClient("https://accountsettings.roblox.com/"); AccountClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); - webClient = new RestClient("https://web.roblox.com/"); - AccountClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); + Web13Client = new RestClient("https://web.roblox.com/"); + Web13Client.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); + + FriendsClient = new RestClient("https://friends.roblox.com"); + FriendsClient.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache); PlaceID_TextChanged(PlaceID, new EventArgs()); @@ -408,7 +428,6 @@ private void AccountManager_Load(object sender, EventArgs e) if (match.Groups[1].Value != version) { - DialogResult result = MessageBox.Show("An update is available, click yes to run the auto updater or no to be redirected to the download page.", "Roblox Account Manager", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (result == DialogResult.Yes) @@ -573,16 +592,32 @@ private void AccountManager_Shown(object sender, EventArgs e) private void Remove_Click(object sender, EventArgs e) { - if (SelectedAccount == null) return; + if (AccountsView.SelectedObjects.Count > 1) + { + DialogResult result = MessageBox.Show($"Are you sure you want to remove {AccountsView.SelectedObjects.Count} accounts?", "Remove Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + + if (result == DialogResult.Yes) + { + foreach (Account acc in AccountsView.SelectedObjects) + AccountsList.Remove(acc); - DialogResult result = MessageBox.Show($"Are you sure you want to remove {SelectedAccount.Username}?", "Remove Account", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + RefreshView(); - if (result == DialogResult.Yes) + SaveAccounts(); + } + } + else if (SelectedAccount != null) { - AccountsView.Items.Remove(SelectedAccountItem); + DialogResult result = MessageBox.Show($"Are you sure you want to remove {SelectedAccount.Username}?", "Remove Account", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - AccountsList.RemoveAll(x => x == SelectedAccount); - SaveAccounts(); + if (result == DialogResult.Yes) + { + AccountsList.RemoveAll(x => x == SelectedAccount); + + RefreshView(); + + SaveAccounts(); + } } } @@ -597,41 +632,24 @@ private void Add_Click(object sender, EventArgs e) private void AccountsView_SelectedIndexChanged(object sender, EventArgs e) { - if (LastViewItem != null) - { - LastViewItem.ForeColor = Color.Black; - LastViewItem.BackColor = Color.White; - } - if (AccountsView.SelectedItems.Count != 1) { + SelectedAccount = null; SelectedAccountItem = null; + return; } - SelectedAccountItem = AccountsView.SelectedItems[0]; - SelectedAccountItem.ForeColor = Color.White; - SelectedAccountItem.BackColor = Color.DodgerBlue; - LastViewItem = SelectedAccountItem; + SelectedAccount = AccountsView.SelectedObject as Account; + SelectedAccountItem = AccountsView.SelectedItem; - AccountsView.HideSelection = true; + AccountsView.HideSelection = false; - try - { - string Item = SelectedAccountItem.SubItems[3].Text; - Account account = AccountsList.FirstOrDefault(x => x.Username == Item); + Alias.Text = SelectedAccount.Alias; + DescriptionBox.Text = SelectedAccount.Description; - if (account != null) - { - SelectedAccount = account; - Alias.Text = account.Alias; - DescriptionBox.Text = account.Description; - - if (!string.IsNullOrEmpty(SelectedAccount.GetField("SavedPlaceId"))) PlaceID.Text = SelectedAccount.GetField("SavedPlaceId"); - if (!string.IsNullOrEmpty(SelectedAccount.GetField("SavedJobId"))) JobID.Text = SelectedAccount.GetField("SavedJobId"); - } - } - catch { } + if (!string.IsNullOrEmpty(SelectedAccount.GetField("SavedPlaceId"))) PlaceID.Text = SelectedAccount.GetField("SavedPlaceId"); + if (!string.IsNullOrEmpty(SelectedAccount.GetField("SavedJobId"))) JobID.Text = SelectedAccount.GetField("SavedJobId"); } private void SetAlias_Click(object sender, EventArgs e) @@ -639,7 +657,7 @@ private void SetAlias_Click(object sender, EventArgs e) if (SelectedAccount == null) return; SelectedAccount.Alias = Alias.Text; - SelectedAccountItem.SubItems[1].Text = SelectedAccount.Alias; + AccountsView.UpdateObject(SelectedAccount); } private void SetDescription_Click(object sender, EventArgs e) @@ -647,7 +665,7 @@ private void SetDescription_Click(object sender, EventArgs e) if (SelectedAccount == null) return; SelectedAccount.Description = DescriptionBox.Text; - SelectedAccountItem.SubItems[2].Text = SelectedAccount.Description.Replace("\n", " "); + AccountsView.UpdateObject(SelectedAccount); } private void JoinServer_Click(object sender, EventArgs e) @@ -694,7 +712,7 @@ private void OpenBrowser_Click(object sender, EventArgs e) // not used i forgot tokenrequest.AddCookie(".ROBLOSECURITY", SelectedAccount.SecurityToken); tokenrequest.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - IRestResponse response = client.Execute(tokenrequest); + IRestResponse response = AuthClient.Execute(tokenrequest); Parameter result = response.Headers.FirstOrDefault(x => x.Name == "x-csrf-token"); string Token = ""; @@ -713,7 +731,7 @@ private void OpenBrowser_Click(object sender, EventArgs e) // not used i forgot request.AddHeader("Accept", "application/json"); request.AddParameter("application/json", "{\"expectedCurrency\":1,\"expectedPrice\":350,\"expectedSellerId\":875316944}", ParameterType.RequestBody); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - response = econclient.Execute(request); + response = EconClient.Execute(request); MessageBox.Show(response.Content); } @@ -734,12 +752,14 @@ private void ServerList_Click(object sender, EventArgs e) private void HideUsernamesCheckbox_CheckedChanged(object sender, EventArgs e) { - foreach (ListViewItem Item in AccountsView.Items) - { - Account account = AccountsList.FirstOrDefault(x => Item.SubItems[3].Text.Length >= x.Username.Length && x.Username == Item.SubItems[3].Text.Substring(0, x.Username.Length)); + // Console.WriteLine(SelectedAccountItem.ForeColor); + // Console.WriteLine(SelectedAccountItem.SelectedForeColor); - Item.Text = HideUsernamesCheckbox.Checked ? Regex.Replace(account.Username, ".", "*") : account.Username; - } + AccountsView.BeginUpdate(); + + Username.Width = HideUsernamesCheckbox.Checked ? 0 : 120; + + AccountsView.EndUpdate(); } private void addAccountsToolStripMenuItem_Click(object sender, EventArgs e) @@ -752,16 +772,32 @@ private void addAccountsToolStripMenuItem_Click(object sender, EventArgs e) private void removeAccountToolStripMenuItem_Click(object sender, EventArgs e) { - if (SelectedAccount == null) return; + if (AccountsView.SelectedObjects.Count > 1) + { + DialogResult result = MessageBox.Show($"Are you sure you want to remove {AccountsView.SelectedObjects.Count} accounts?", "Remove Accounts", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + + if (result == DialogResult.Yes) + { + foreach (Account acc in AccountsView.SelectedObjects) + AccountsList.Remove(acc); - DialogResult result = MessageBox.Show("Are you sure?", "Remove", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + RefreshView(); - if (result == DialogResult.Yes) + SaveAccounts(); + } + } + else if (SelectedAccount != null) { - AccountsView.Items.Remove(SelectedAccountItem); - AccountsList.RemoveAll(x => x == SelectedAccount); + DialogResult result = MessageBox.Show($"Are you sure you want to remove {SelectedAccount.Username}?", "Remove Account", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - SaveAccounts(); + if (result == DialogResult.Yes) + { + AccountsList.RemoveAll(x => x == SelectedAccount); + + RefreshView(); + + SaveAccounts(); + } } } @@ -876,68 +912,7 @@ private void reAuthToolStripMenuItem_Click(object sender, EventArgs e) aaform.SetUsername = SelectedAccount.Username; } - private void AccountsView_MouseDown(object sender, MouseEventArgs e) - { - if (AccountsView.Groups.Count > 0) return; - - DraggingItem = AccountsView.GetItemAt(e.X, e.Y); - DragTime = DateTime.Now; - } - - private void AccountsView_MouseMove(object sender, MouseEventArgs e) - { - if (DraggingItem == null || (DateTime.Now - DragTime).TotalMilliseconds < 120) return; - - Cursor = Cursors.Hand; - } - - private void AccountsView_MouseUp(object sender, MouseEventArgs e) - { - if ((DateTime.Now - DragTime).TotalMilliseconds < 120) DraggingItem = null; - - Cursor = Cursors.Default; - - if (DraggingItem == null) return; - - ListViewItem HoveringItem = AccountsView.GetItemAt(0, e.Y); - - if (HoveringItem == null) return; - - Rectangle rc = HoveringItem.GetBounds(ItemBoundsPortion.Entire); - - bool InsertBefore = (e.Y < rc.Top + (rc.Height / 2)); - - if (DraggingItem != HoveringItem) - { - string Item = DraggingItem.SubItems[3].Text; - Account account = AccountsList.FirstOrDefault(x => Item.Length >= x.Username.Length && x.Username == Item.Substring(0, x.Username.Length)); - - if (account == null) { MessageBox.Show("Something went wrong!", "Roblox Account Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } - - if (InsertBefore) - { - AccountsView.Items.Remove(DraggingItem); - AccountsView.Items.Insert(HoveringItem.Index, DraggingItem); - - AccountsList.Remove(account); - AccountsList.Insert(HoveringItem.Index - 1, account); - } - else - { - AccountsView.Items.Remove(DraggingItem); - AccountsView.Items.Insert(HoveringItem.Index + 1, DraggingItem); - - AccountsList.Remove(account); - AccountsList.Insert(HoveringItem.Index, account); - } - - DraggingItem = null; - - SaveAccounts(); - } - } - - private void getAuthenticationTicketToolStripMenuItem_Click(object sender, EventArgs e) // shouldn't be available to public releases + private void getAuthenticationTicketToolStripMenuItem_Click(object sender, EventArgs e) { if (SelectedAccount == null) return; @@ -946,7 +921,7 @@ private void getAuthenticationTicketToolStripMenuItem_Click(object sender, Event request.AddCookie(".ROBLOSECURITY", SelectedAccount.SecurityToken); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - IRestResponse response = client.Execute(request); + IRestResponse response = AuthClient.Execute(request); Parameter result = response.Headers.FirstOrDefault(x => x.Name == "x-csrf-token"); string Token = ""; @@ -963,7 +938,7 @@ private void getAuthenticationTicketToolStripMenuItem_Click(object sender, Event request.AddCookie(".ROBLOSECURITY", SelectedAccount.SecurityToken); request.AddHeader("X-CSRF-TOKEN", Token); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - response = client.Execute(request); + response = AuthClient.Execute(request); Parameter Ticket = response.Headers.FirstOrDefault(x => x.Name == "rbx-authentication-ticket"); @@ -980,7 +955,7 @@ private void copyRbxplayerLinkToolStripMenuItem_Click(object sender, EventArgs e request.AddCookie(".ROBLOSECURITY", SelectedAccount.SecurityToken); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - IRestResponse response = client.Execute(request); + IRestResponse response = AuthClient.Execute(request); Parameter result = response.Headers.FirstOrDefault(x => x.Name == "x-csrf-token"); string Token = ""; @@ -997,7 +972,7 @@ private void copyRbxplayerLinkToolStripMenuItem_Click(object sender, EventArgs e request.AddCookie(".ROBLOSECURITY", SelectedAccount.SecurityToken); request.AddHeader("X-CSRF-TOKEN", Token); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - response = client.Execute(request); + response = AuthClient.Execute(request); Parameter Ticket = response.Headers.FirstOrDefault(x => x.Name == "rbx-authentication-ticket"); @@ -1008,7 +983,7 @@ private void copyRbxplayerLinkToolStripMenuItem_Click(object sender, EventArgs e double LaunchTime = Math.Floor((DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds * 1000); Random r = new Random(); - Clipboard.SetText(string.Format("", Token, PlaceID.Text, HasJobId ? "" : ("&gameId=" + JobID.Text), HasJobId ? "" : "Job", LaunchTime, r.Next(500000, 600000).ToString() + r.Next(10000, 90000).ToString())); + Clipboard.SetText(string.Format("", Token, PlaceID.Text, HasJobId ? "" : ("&gameId=" + JobID.Text), HasJobId ? "" : "Job", LaunchTime, r.Next(100000, 130000).ToString() + r.Next(100000, 900000).ToString())); } } @@ -1045,13 +1020,13 @@ private void PlaceID_TextChanged(object sender, EventArgs e) private void PlaceTimer_Tick(object sender, EventArgs e) { - if (apiclient == null) return; + if (APIClient == null) return; PlaceTimer.Stop(); RestRequest request = new RestRequest("Marketplace/ProductInfo?assetId=" + PlaceID.Text, Method.GET); request.AddHeader("Accept", "application/json"); - IRestResponse response = apiclient.Execute(request); + IRestResponse response = APIClient.Execute(request); if (response.IsSuccessful && response.StatusCode == HttpStatusCode.OK) { @@ -1063,101 +1038,17 @@ private void PlaceTimer_Tick(object sender, EventArgs e) private void moveToToolStripMenuItem_Click(object sender, EventArgs e) { - string GroupName = ShowDialog("Group Name", "Move Account to Group"); - - if (string.IsNullOrEmpty(GroupName)) return; - - if (AccountsView.Groups.Count == 0) - { - DialogResult res = MessageBox.Show("Creating groups prevents accounts from being moved! Continue?", "Groups", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - - if (res == DialogResult.No) return; - } - - AddGroupToList(GroupName); - } - - private void MoveAccounts(ListViewGroup Group1, ListViewGroup Group2 = null) - { - List AccountsToMove = new List(); - int Index = -1; - - foreach (Account acc in AccountsList) - { - if (acc.Group == Group1.Header) - AccountsToMove.Add(acc); - - if (Group2 != null && acc.Group == Group2.Header) - Index = AccountsList.IndexOf(acc); - } - - Index -= AccountsToMove.Count; if (Index < 0) Index = 0; - - AccountsList.RemoveAll(x => AccountsToMove.Contains(x)); - AccountsList.InsertRange(Index, AccountsToMove.ToArray()); - - SaveAccounts(); - } - - private void moveUpToolStripMenuItem_Click(object sender, EventArgs e) - { - if (SelectedAccountItem != null && SelectedAccountItem.Group != null) - { - ListViewGroup Group = SelectedAccountItem.Group; - int Index = AccountsView.Groups.IndexOf(Group); - - if (Index > 0) - { - List gs = new List(); - ListViewGroup GroupAbove = null; - - foreach (ListViewGroup group in AccountsView.Groups) - { - if (group == Group) continue; - - gs.Insert(gs.Count, group); - } - - if (Index > 0) GroupAbove = gs[Index - 1]; - - gs.Insert(Index - 1, Group); - - MoveAccounts(Group, GroupAbove); - - AccountsView.BeginUpdate(); - AccountsView.Groups.Clear(); - AccountsView.Groups.AddRange(gs.ToArray()); - AccountsView.EndUpdate(); - } - } - } - - private void moveDownToolStripMenuItem_Click(object sender, EventArgs e) - { - if (SelectedAccountItem != null && SelectedAccountItem.Group != null) - { - ListViewGroup Group = SelectedAccountItem.Group; - int Index = AccountsView.Groups.IndexOf(Group); + if (AccountsView.SelectedObjects.Count == 0) return; - if (Index < AccountsView.Groups.Count - 1) - { - List gs = new List(); - - foreach (ListViewGroup group in AccountsView.Groups) - { - if (group == Group) continue; + string GroupName = ShowDialog("Group Name", "Move Account to Group"); - gs.Insert(gs.Count, group); - } + if (string.IsNullOrEmpty(GroupName)) GroupName = "Default"; - gs.Insert(Index + 1, Group); + foreach (Account acc in AccountsView.SelectedObjects) + acc.Group = GroupName; - AccountsView.BeginUpdate(); - AccountsView.Groups.Clear(); - AccountsView.Groups.AddRange(gs.ToArray()); - AccountsView.EndUpdate(); - } - } + AccountsView.UpdateObjects(AccountsView.SelectedObjects); + AccountsView.EnsureModelVisible(AccountsView.SelectedObjects[0]); } private void copyAppLinkToolStripMenuItem_Click(object sender, EventArgs e) @@ -1169,7 +1060,7 @@ private void copyAppLinkToolStripMenuItem_Click(object sender, EventArgs e) request.AddCookie(".ROBLOSECURITY", SelectedAccount.SecurityToken); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - IRestResponse response = client.Execute(request); + IRestResponse response = AuthClient.Execute(request); Parameter result = response.Headers.FirstOrDefault(x => x.Name == "x-csrf-token"); string Token = ""; @@ -1186,7 +1077,7 @@ private void copyAppLinkToolStripMenuItem_Click(object sender, EventArgs e) request.AddCookie(".ROBLOSECURITY", SelectedAccount.SecurityToken); request.AddHeader("X-CSRF-TOKEN", Token); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - response = client.Execute(request); + response = AuthClient.Execute(request); Parameter Ticket = response.Headers.FirstOrDefault(x => x.Name == "rbx-authentication-ticket"); @@ -1263,5 +1154,39 @@ private void SaveTimer_Tick(object sender, EventArgs e) SaveAccounts(); SaveAccountsTimer.Stop(); } + + private void AccountsView_ModelCanDrop(object sender, ModelDropEventArgs e) + { + if (e.SourceModels[0] != null && e.SourceModels[0] is Account) e.Effect = DragDropEffects.Move; + } + + private void AccountsView_ModelDropped(object sender, ModelDropEventArgs e) + { + if (e.TargetModel == null || e.SourceModels.Count == 0) return; + + Account droppedOn = e.TargetModel as Account; + + int Index = AccountsList.IndexOf(droppedOn); + + foreach (Account a in AccountsList) Console.WriteLine($"{AccountsList.IndexOf(a)} {a.Username}"); + + for (int i = e.SourceModels.Count; i > 0; i--) + { + Account dragged = e.SourceModels[i - 1] as Account; if (dragged == null) continue; + + dragged.Group = droppedOn.Group; + + AccountsList.Remove(dragged); + AccountsList.Insert(Index, dragged); + } + + Console.WriteLine("---------------"); + + foreach (Account a in AccountsList) Console.WriteLine($"{AccountsList.IndexOf(a)} {a.Username}"); + + RefreshView(); + AccountsView.EnsureModelVisible(e.SourceModels[e.SourceModels.Count - 1]); + DelayedSaveAccounts(); + } } } \ No newline at end of file diff --git a/RBX Alt Manager/AccountManager.resx b/RBX Alt Manager/AccountManager.resx index d18883d..9ad3758 100644 --- a/RBX Alt Manager/AccountManager.resx +++ b/RBX Alt Manager/AccountManager.resx @@ -120,11 +120,8 @@ 34, 18 - - 276, 18 - - 380, 18 + 271, 17 @@ -147,7 +144,7 @@ 156, 17 - 491, 18 + 375, 16 diff --git a/RBX Alt Manager/Classes/Account.cs b/RBX Alt Manager/Classes/Account.cs index 48f9f5d..5050d39 100644 --- a/RBX Alt Manager/Classes/Account.cs +++ b/RBX Alt Manager/Classes/Account.cs @@ -21,14 +21,14 @@ public class PinStatus public double unlockedUntil { get; set; } } - public class Account + public class Account : IComparable { public bool Valid; public string SecurityToken; public string Username; private string _Alias = ""; private string _Description = ""; - public string Group { get; set; } + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public string Group { get; set; } = "Default"; public long UserID; public Dictionary Fields = new Dictionary(); [JsonIgnore] public DateTime PinUnlocked; @@ -36,6 +36,15 @@ public class Account [JsonIgnore] public DateTime LastAppLaunch; [JsonIgnore] public string CSRFToken; + public int CompareTo(Account compareTo) + { + if (compareTo == null) + return 1; + + else + return Group.CompareTo(compareTo.Group); + } + private string BrowserTrackerID; public string Alias @@ -88,7 +97,7 @@ public string GetCSRFToken() request.AddCookie(".ROBLOSECURITY", SecurityToken); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - IRestResponse response = AccountManager.client.Execute(request); + IRestResponse response = AccountManager.AuthClient.Execute(request); Parameter result = response.Headers.FirstOrDefault(x => x.Name == "x-csrf-token"); string Token = ""; @@ -122,7 +131,7 @@ public bool CheckPin(bool Internal = false) request.AddCookie(".ROBLOSECURITY", SecurityToken); request.AddHeader("Referer", "https://www.roblox.com/"); - IRestResponse response = AccountManager.client.Execute(request); + IRestResponse response = AccountManager.AuthClient.Execute(request); if (response.IsSuccessful && response.StatusCode == HttpStatusCode.OK) { @@ -150,7 +159,7 @@ public bool UnlockPin(string Pin) request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); request.AddParameter("pin", Pin); - IRestResponse response = AccountManager.client.Execute(request); + IRestResponse response = AccountManager.AuthClient.Execute(request); if (response.IsSuccessful && response.StatusCode == HttpStatusCode.OK) { @@ -200,7 +209,7 @@ public bool SetFollowPrivacy(int Privacy) break; } - IRestResponse response = AccountManager.mainclient.Execute(request); + IRestResponse response = AccountManager.MainClient.Execute(request); if (response.IsSuccessful && response.StatusCode == HttpStatusCode.OK) return true; @@ -220,7 +229,7 @@ public bool ChangePassword(string Current, string New) request.AddParameter("currentPassword", Current); request.AddParameter("newPassword", New); - IRestResponse response = AccountManager.client.Execute(request); + IRestResponse response = AccountManager.AuthClient.Execute(request); if (response.IsSuccessful && response.StatusCode == HttpStatusCode.OK) { @@ -282,7 +291,7 @@ public bool LogOutOfOtherSessions() request.AddHeader("X-CSRF-TOKEN", GetCSRFToken()); request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); - IRestResponse response = AccountManager.mainclient.Execute(request); + IRestResponse response = AccountManager.MainClient.Execute(request); if (response.IsSuccessful && response.StatusCode == HttpStatusCode.OK) { @@ -316,7 +325,7 @@ public bool BlockPlayer(string Username) request.AddCookie(".ROBLOSECURITY", SecurityToken); - IRestResponse response = AccountManager.apiclient.Execute(request); + IRestResponse response = AccountManager.APIClient.Execute(request); if (response.IsSuccessful && response.StatusCode == HttpStatusCode.OK) { @@ -330,7 +339,7 @@ public bool BlockPlayer(string Username) blockReq.AddHeader("Content-Type", "application/json"); blockReq.AddJsonBody(new { blockeeId = BlockeeID.ToString() }); - IRestResponse blockRes = AccountManager.mainclient.Execute(blockReq); + IRestResponse blockRes = AccountManager.MainClient.Execute(blockReq); if (blockRes.Content.Contains(@"""success"":true")) MessageBox.Show("Blocked " + Username); @@ -347,7 +356,7 @@ public bool BlockPlayer(string Username) blockReq.AddHeader("Content-Type", "application/json"); blockReq.AddJsonBody(new { blockeeId = BlockeeID.ToString() }); - IRestResponse blockRes = AccountManager.mainclient.Execute(blockReq); + IRestResponse blockRes = AccountManager.MainClient.Execute(blockReq); if (blockRes.Content.Contains(@"""success"":true")) MessageBox.Show("Unblocked " + Username); @@ -375,7 +384,7 @@ public string BlockUserId(string UserID, bool SkipPinCheck = false) blockReq.AddHeader("Content-Type", "application/json"); blockReq.AddJsonBody(new { blockeeId = UserID }); - IRestResponse blockRes = AccountManager.mainclient.Execute(blockReq); + IRestResponse blockRes = AccountManager.MainClient.Execute(blockReq); return blockRes.Content; } @@ -391,7 +400,7 @@ public string UnblockUserId(string UserID, bool SkipPinCheck = false) { blockReq.AddHeader("Content-Type", "application/json"); blockReq.AddJsonBody(new { blockeeId = UserID }); - IRestResponse blockRes = AccountManager.mainclient.Execute(blockReq); + IRestResponse blockRes = AccountManager.MainClient.Execute(blockReq); return blockRes.Content; } @@ -404,7 +413,7 @@ public string UnblockEveryone() request.AddCookie(".ROBLOSECURITY", SecurityToken); - IRestResponse response = AccountManager.apiclient.Execute(request); + IRestResponse response = AccountManager.APIClient.Execute(request); if (response.IsSuccessful && response.StatusCode == HttpStatusCode.OK) { @@ -444,14 +453,14 @@ public string GetBlockedList() request.AddCookie(".ROBLOSECURITY", SecurityToken); - IRestResponse response = AccountManager.apiclient.Execute(request); + IRestResponse response = AccountManager.APIClient.Execute(request); return response.Content; } public string ParseAccessCode(IRestResponse response) { - string pattern = "Roblox.GameLauncher.joinPrivateGame\\(\\d+,'(\\w+\\-\\w+\\-\\w+\\-\\w+\\-\\w+)"; + string pattern = "Roblox.GameLauncher.joinPrivateGame\\(\\d+\\,\\s*'(\\w+\\-\\w+\\-\\w+\\-\\w+\\-\\w+)'"; Regex regex = new Regex(pattern); MatchCollection matches = regex.Matches(response.Content); @@ -479,7 +488,7 @@ public string JoinServer(long PlaceID, string JobID = "", bool FollowUser = fals request.AddHeader("X-CSRF-TOKEN", Token); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - IRestResponse response = AccountManager.client.Execute(request); + IRestResponse response = AccountManager.AuthClient.Execute(request); Parameter Ticket = response.Headers.FirstOrDefault(x => x.Name == "rbx-authentication-ticket"); @@ -497,7 +506,7 @@ public string JoinServer(long PlaceID, string JobID = "", bool FollowUser = fals request.AddHeader("X-CSRF-TOKEN", Token); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - response = AccountManager.mainclient.Execute(request); + response = AccountManager.MainClient.Execute(request); if (response.StatusCode == HttpStatusCode.OK) { @@ -517,7 +526,7 @@ public string JoinServer(long PlaceID, string JobID = "", bool FollowUser = fals cRequest.AddHeader("X-CSRF-TOKEN", Token); cRequest.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - IRestResponse result = AccountManager.webClient.Execute(cRequest); + IRestResponse result = AccountManager.Web13Client.Execute(cRequest); if (result.StatusCode == HttpStatusCode.OK) { @@ -577,7 +586,7 @@ public string LaunchApp() request.AddHeader("X-CSRF-TOKEN", Token); request.AddHeader("Referer", "https://www.roblox.com/games/606849621/Jailbreak"); - IRestResponse response = AccountManager.client.Execute(request); + IRestResponse response = AccountManager.AuthClient.Execute(request); Parameter Ticket = response.Headers.FirstOrDefault(x => x.Name == "rbx-authentication-ticket"); @@ -595,6 +604,22 @@ public string LaunchApp() return "ERROR: Invalid Authentication Ticket"; } + public bool SendFriendRequest(string Username) + { + long UserId = AccountManager.GetUserID(Username); + + RestRequest friendRequest = new RestRequest($"/v1/users/{UserId}/request-friendship", Method.POST); + friendRequest.AddCookie(".ROBLOSECURITY", SecurityToken); + friendRequest.AddHeader("X-CSRF-TOKEN", GetCSRFToken()); + + IRestResponse friendResponse = AccountManager.FriendsClient.Execute(friendRequest); + + if (friendResponse.IsSuccessful && friendResponse.StatusCode == HttpStatusCode.OK) + return true; + + return false; + } + public string GetField(string Name) => Fields.ContainsKey(Name) ? Fields[Name] : ""; public void SetField(string Name, string Value) { Fields[Name] = Value; AccountManager.DelayedSaveAccounts(); } public void RemoveField(string Name) { Fields.Remove(Name); AccountManager.DelayedSaveAccounts(); } diff --git a/RBX Alt Manager/Classes/ViewSorter.cs b/RBX Alt Manager/Classes/ViewSorter.cs new file mode 100644 index 0000000..77f109b --- /dev/null +++ b/RBX Alt Manager/Classes/ViewSorter.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace RBX_Alt_Manager.Classes +{ + class ViewSorter : IComparer + { + SortOrder _Order; + + public ViewSorter(SortOrder order) + { + _Order = order; + } + + public int Compare(object x, object y) + { + // perform you desired comparison depending on the _Order + Console.WriteLine($"{x}, {y}"); + + return 0; + } + } +} diff --git a/RBX Alt Manager/Forms/AccountUtils.Designer.cs b/RBX Alt Manager/Forms/AccountUtils.Designer.cs index 2468d80..d17b58e 100644 --- a/RBX Alt Manager/Forms/AccountUtils.Designer.cs +++ b/RBX Alt Manager/Forms/AccountUtils.Designer.cs @@ -45,6 +45,7 @@ private void InitializeComponent() this.Username = new System.Windows.Forms.TextBox(); this.Block = new System.Windows.Forms.Button(); this.SetDisplayName = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // WhoFollow @@ -191,12 +192,12 @@ private void InitializeComponent() // this.Username.Location = new System.Drawing.Point(12, 80); this.Username.Name = "Username"; - this.Username.Size = new System.Drawing.Size(80, 20); + this.Username.Size = new System.Drawing.Size(72, 20); this.Username.TabIndex = 7; // // Block // - this.Block.Location = new System.Drawing.Point(98, 79); + this.Block.Location = new System.Drawing.Point(90, 79); this.Block.Name = "Block"; this.Block.Size = new System.Drawing.Size(50, 22); this.Block.TabIndex = 8; @@ -215,11 +216,22 @@ private void InitializeComponent() this.SetDisplayName.UseVisualStyleBackColor = true; this.SetDisplayName.Click += new System.EventHandler(this.SetDisplayName_Click); // + // button4 + // + this.button4.Location = new System.Drawing.Point(146, 79); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(72, 22); + this.button4.TabIndex = 1004; + this.button4.Text = "Add Friend"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click); + // // AccountUtils // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(518, 142); + this.Controls.Add(this.button4); this.Controls.Add(this.SetDisplayName); this.Controls.Add(this.Block); this.Controls.Add(this.Username); @@ -263,5 +275,6 @@ private void InitializeComponent() private System.Windows.Forms.TextBox Username; private System.Windows.Forms.Button Block; private System.Windows.Forms.Button SetDisplayName; + private System.Windows.Forms.Button button4; } } \ No newline at end of file diff --git a/RBX Alt Manager/Forms/AccountUtils.cs b/RBX Alt Manager/Forms/AccountUtils.cs index 35a6d3c..e93c8c0 100644 --- a/RBX Alt Manager/Forms/AccountUtils.cs +++ b/RBX Alt Manager/Forms/AccountUtils.cs @@ -1,11 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace RBX_Alt_Manager @@ -27,11 +20,15 @@ private void AccountUtils_FormClosing(object sender, FormClosingEventArgs e) private void WhoFollow_SelectedIndexChanged(object sender, EventArgs e) { + if (AccountManager.SelectedAccount == null) return; + AccountManager.SelectedAccount.SetFollowPrivacy(WhoFollow.SelectedIndex); } private void button2_Click(object sender, EventArgs e) { + if (AccountManager.SelectedAccount == null) return; + DialogResult result = MessageBox.Show($"Are you sure you want sign out of all other sessions?", "Account Utilities", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) @@ -40,11 +37,15 @@ private void button2_Click(object sender, EventArgs e) private void button7_Click(object sender, EventArgs e) { + if (AccountManager.SelectedAccount == null) return; + AccountManager.SelectedAccount.UnlockPin(textBox5.Text); } private void textBox5_KeyPress(object sender, KeyPressEventArgs e) { + if (AccountManager.SelectedAccount == null) return; + if (e.KeyChar == (char)Keys.Enter) { AccountManager.SelectedAccount.UnlockPin(textBox5.Text); @@ -63,16 +64,22 @@ private void textBox5_Enter(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e) { + if (AccountManager.SelectedAccount == null) return; + AccountManager.SelectedAccount.ChangePassword(textBox1.Text, textBox2.Text); } private void button3_Click(object sender, EventArgs e) { + if (AccountManager.SelectedAccount == null) return; + AccountManager.SelectedAccount.ChangeEmail(textBox1.Text, textBox3.Text); } private void Block_Click(object sender, EventArgs e) { + if (AccountManager.SelectedAccount == null) return; + AccountManager.SelectedAccount.BlockPlayer(Username.Text); } @@ -80,5 +87,12 @@ private void SetDisplayName_Click(object sender, EventArgs e) { MessageBox.Show("To set your display name, click 'Open App', go to settings, account info, then change your display name there"); } + + private void button4_Click(object sender, EventArgs e) + { + if (AccountManager.SelectedAccount == null) return; + + AccountManager.SelectedAccount.SendFriendRequest(Username.Text); + } } } diff --git a/RBX Alt Manager/Forms/AccountUtils.resx b/RBX Alt Manager/Forms/AccountUtils.resx index c6c0654..c104c15 100644 --- a/RBX Alt Manager/Forms/AccountUtils.resx +++ b/RBX Alt Manager/Forms/AccountUtils.resx @@ -120,4 +120,7 @@ 17, 17 + + 17, 17 + \ No newline at end of file diff --git a/RBX Alt Manager/Forms/ImportForm.cs b/RBX Alt Manager/Forms/ImportForm.cs index 82fefb5..cb9f763 100644 --- a/RBX Alt Manager/Forms/ImportForm.cs +++ b/RBX Alt Manager/Forms/ImportForm.cs @@ -33,7 +33,7 @@ private void ImportButton_Click(object sender, EventArgs e) myAcc.AddCookie(".ROBLOSECURITY", Token); - IRestResponse response = AccountManager.mainclient.Execute(myAcc); + IRestResponse response = AccountManager.MainClient.Execute(myAcc); if (response.StatusCode == HttpStatusCode.OK && response.Content.Contains("DisplayName")) // shitty check i know ... AccountManager.AddAccount(Token, response.Content); diff --git a/RBX Alt Manager/Forms/ServerList.cs b/RBX Alt Manager/Forms/ServerList.cs index b9cd90b..f965ab7 100644 --- a/RBX Alt Manager/Forms/ServerList.cs +++ b/RBX Alt Manager/Forms/ServerList.cs @@ -1,5 +1,4 @@ -using BrightIdeasSoftware; -using Newtonsoft.Json; +using Newtonsoft.Json; using RestSharp; using System; using System.Collections.Generic; @@ -140,9 +139,7 @@ private void ServerListView_MouseDoubleClick(object sender, MouseEventArgs e) private void joinServerToolStripMenuItem_Click(object sender, EventArgs e) { - ListView AccountsView = Program.MainForm.AccountsView; - - if (AccountsView.SelectedItems.Count != 1 || AccountManager.SelectedAccount == null) return; + if (AccountManager.SelectedAccount == null) return; string res = AccountManager.SelectedAccount.JoinServer(Convert.ToInt64(Program.MainForm.PlaceID.Text), ServerListView.SelectedItem.Text, false, false); @@ -354,8 +351,7 @@ public void AddFavoriteToList(FavoriteGame game) } else { - if (Favorites.Find(x => x.PlaceID == game.PlaceID) != null) - return; + if (string.IsNullOrEmpty(game.PrivateServer) && Favorites.Find(x => x.PlaceID == game.PlaceID) != null) return; Favorites.Add(game); FavoritesListView.AddObject(game); @@ -368,9 +364,7 @@ private void joinGameToolStripMenuItem_Click(object sender, EventArgs e) if (game != null) { - ListView AccountsView = Program.MainForm.AccountsView; - - if (AccountsView.SelectedItems.Count != 1 || AccountManager.SelectedAccount == null) return; + if (AccountManager.SelectedAccount == null) return; string res = AccountManager.SelectedAccount.JoinServer(game.placeId); @@ -396,9 +390,7 @@ private void toolStripMenuItem1_Click(object sender, EventArgs e) if (game != null) { - ListView AccountsView = Program.MainForm.AccountsView; - - if (AccountsView.SelectedItems.Count != 1 || AccountManager.SelectedAccount == null) return; + if (AccountManager.SelectedAccount == null) return; string res; @@ -450,18 +442,18 @@ private void Favorite_Click(object sender, EventArgs e) { string PlaceId = AccountManager.CurrentPlaceId; - if (AccountManager.CurrentJobId.Contains("privateServerLinkCode") && Regex.IsMatch(AccountManager.CurrentJobId, @"\/games\/(\d+)\/")) + if (!string.IsNullOrEmpty(AccountManager.CurrentJobId) && AccountManager.CurrentJobId.Contains("privateServerLinkCode") && Regex.IsMatch(AccountManager.CurrentJobId, @"\/games\/(\d+)\/")) PlaceId = Regex.Match(AccountManager.CurrentJobId, @"\/games\/(\d+)\/").Groups[1].Value; RestRequest request = new RestRequest("Marketplace/ProductInfo?assetId=" + PlaceId, Method.GET); request.AddHeader("Accept", "application/json"); - IRestResponse response = AccountManager.apiclient.Execute(request); + IRestResponse response = AccountManager.APIClient.Execute(request); if (response.IsSuccessful && response.StatusCode == HttpStatusCode.OK) { - ProductInfo placeInfo = JsonConvert.DeserializeObject(response.Content); + ProductInfo placeInfo = JsonConvert.DeserializeObject(response.Content); - if (AccountManager.CurrentJobId.Contains("privateServerLinkCode")) + if (!string.IsNullOrEmpty(AccountManager.CurrentJobId) && AccountManager.CurrentJobId.Contains("privateServerLinkCode")) AddFavoriteToList(new FavoriteGame(placeInfo.Name + " (VIP)", Convert.ToInt64(AccountManager.CurrentPlaceId), AccountManager.CurrentJobId)); else AddFavoriteToList(new FavoriteGame(placeInfo.Name, Convert.ToInt64(AccountManager.CurrentPlaceId))); diff --git a/RBX Alt Manager/Properties/AssemblyInfo.cs b/RBX Alt Manager/Properties/AssemblyInfo.cs index b834c25..f1b98a7 100644 --- a/RBX Alt Manager/Properties/AssemblyInfo.cs +++ b/RBX Alt Manager/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("2.3.1.0")] +[assembly: AssemblyFileVersion("2.4.0.0")] diff --git a/RBX Alt Manager/RBX Alt Manager.csproj b/RBX Alt Manager/RBX Alt Manager.csproj index 4419459..fc89836 100644 --- a/RBX Alt Manager/RBX Alt Manager.csproj +++ b/RBX Alt Manager/RBX Alt Manager.csproj @@ -91,8 +91,8 @@ ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - ..\packages\ObjectListView.Official.2.9.2-alpha2\lib\net20\ObjectListView.dll + + ..\packages\ObjectListView.Official.2.9.1\lib\net20\ObjectListView.dll ..\packages\RestSharp.106.11.8-alpha.0.7\lib\net452\RestSharp.dll @@ -119,6 +119,7 @@ Field.cs + Form diff --git a/RBX Alt Manager/packages.config b/RBX Alt Manager/packages.config index 01bc677..8a72e34 100644 --- a/RBX Alt Manager/packages.config +++ b/RBX Alt Manager/packages.config @@ -5,6 +5,6 @@ - + \ No newline at end of file