UserAgent change.
This commit is contained in:
parent
93380b7a19
commit
47167f2be5
|
|
@ -109,7 +109,9 @@ class Downloader
|
||||||
| SecurityProtocolType.Ssl3;
|
| SecurityProtocolType.Ssl3;
|
||||||
// Create a request for the specified remote file name
|
// Create a request for the specified remote file name
|
||||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(remoteFilename);
|
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(remoteFilename);
|
||||||
request.UserAgent = "Roblox/WinINet";
|
//changing it to just "roblox" since roblox is breaking everything.
|
||||||
|
//request.UserAgent = "Roblox/WinINet";
|
||||||
|
request.UserAgent = "Roblox";
|
||||||
request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
|
request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
|
||||||
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
|
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
|
||||||
if (request != null)
|
if (request != null)
|
||||||
|
|
|
||||||
|
|
@ -1229,40 +1229,48 @@ namespace NovetusLauncher
|
||||||
private void SearchButton_Click(object sender, EventArgs e)
|
private void SearchButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string searchText = SearchBar.Text;
|
string searchText = SearchBar.Text;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(searchText))
|
if (string.IsNullOrWhiteSpace(searchText))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (LastSearchText != searchText)
|
try
|
||||||
{
|
{
|
||||||
//It's a new Search
|
if (LastSearchText != searchText)
|
||||||
CurrentNodeMatches.Clear();
|
{
|
||||||
LastSearchText = searchText;
|
//It's a new Search
|
||||||
LastNodeIndex = 0;
|
CurrentNodeMatches.Clear();
|
||||||
SearchNodes(searchText, treeView1.Nodes[0]);
|
LastSearchText = searchText;
|
||||||
}
|
LastNodeIndex = 0;
|
||||||
|
SearchNodes(searchText, treeView1.Nodes[0]);
|
||||||
|
}
|
||||||
|
|
||||||
if (LastNodeIndex >= 0 && CurrentNodeMatches.Count > 0 && LastNodeIndex < CurrentNodeMatches.Count)
|
if (LastNodeIndex >= 0 && CurrentNodeMatches.Count > 0 && LastNodeIndex < CurrentNodeMatches.Count)
|
||||||
{
|
{
|
||||||
TreeNode selectedNode = CurrentNodeMatches[LastNodeIndex];
|
TreeNode selectedNode = CurrentNodeMatches[LastNodeIndex];
|
||||||
LastNodeIndex++;
|
LastNodeIndex++;
|
||||||
treeView1.SelectedNode = selectedNode;
|
treeView1.SelectedNode = selectedNode;
|
||||||
treeView1.SelectedNode.Expand();
|
treeView1.SelectedNode.Expand();
|
||||||
treeView1.Select();
|
treeView1.Select();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//It's a new Search
|
||||||
|
CurrentNodeMatches.Clear();
|
||||||
|
LastSearchText = searchText;
|
||||||
|
LastNodeIndex = 0;
|
||||||
|
SearchNodes(searchText, treeView1.Nodes[0]);
|
||||||
|
TreeNode selectedNode = CurrentNodeMatches[LastNodeIndex];
|
||||||
|
LastNodeIndex++;
|
||||||
|
treeView1.SelectedNode = selectedNode;
|
||||||
|
treeView1.SelectedNode.Expand();
|
||||||
|
treeView1.Select();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (Exception)
|
||||||
{
|
{
|
||||||
//It's a new Search
|
MessageBox.Show("The map '" + searchText + "' cannot be found. Please try another term.");
|
||||||
CurrentNodeMatches.Clear();
|
|
||||||
LastSearchText = searchText;
|
|
||||||
LastNodeIndex = 0;
|
|
||||||
SearchNodes(searchText, treeView1.Nodes[0]);
|
|
||||||
TreeNode selectedNode = CurrentNodeMatches[LastNodeIndex];
|
|
||||||
LastNodeIndex++;
|
|
||||||
treeView1.SelectedNode = selectedNode;
|
|
||||||
treeView1.SelectedNode.Expand();
|
|
||||||
treeView1.Select();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
||||||
|
|
@ -1386,40 +1386,48 @@ namespace NovetusLauncher
|
||||||
private void SearchButton_Click(object sender, EventArgs e)
|
private void SearchButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string searchText = SearchBar.Text;
|
string searchText = SearchBar.Text;
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(searchText))
|
if (string.IsNullOrWhiteSpace(searchText))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (LastSearchText != searchText)
|
try
|
||||||
{
|
{
|
||||||
//It's a new Search
|
if (LastSearchText != searchText)
|
||||||
CurrentNodeMatches.Clear();
|
{
|
||||||
LastSearchText = searchText;
|
//It's a new Search
|
||||||
LastNodeIndex = 0;
|
CurrentNodeMatches.Clear();
|
||||||
SearchNodes(searchText, treeView1.Nodes[0]);
|
LastSearchText = searchText;
|
||||||
}
|
LastNodeIndex = 0;
|
||||||
|
SearchNodes(searchText, treeView1.Nodes[0]);
|
||||||
|
}
|
||||||
|
|
||||||
if (LastNodeIndex >= 0 && CurrentNodeMatches.Count > 0 && LastNodeIndex < CurrentNodeMatches.Count)
|
if (LastNodeIndex >= 0 && CurrentNodeMatches.Count > 0 && LastNodeIndex < CurrentNodeMatches.Count)
|
||||||
{
|
{
|
||||||
TreeNode selectedNode = CurrentNodeMatches[LastNodeIndex];
|
TreeNode selectedNode = CurrentNodeMatches[LastNodeIndex];
|
||||||
LastNodeIndex++;
|
LastNodeIndex++;
|
||||||
treeView1.SelectedNode = selectedNode;
|
treeView1.SelectedNode = selectedNode;
|
||||||
treeView1.SelectedNode.Expand();
|
treeView1.SelectedNode.Expand();
|
||||||
treeView1.Select();
|
treeView1.Select();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//It's a new Search
|
||||||
|
CurrentNodeMatches.Clear();
|
||||||
|
LastSearchText = searchText;
|
||||||
|
LastNodeIndex = 0;
|
||||||
|
SearchNodes(searchText, treeView1.Nodes[0]);
|
||||||
|
TreeNode selectedNode = CurrentNodeMatches[LastNodeIndex];
|
||||||
|
LastNodeIndex++;
|
||||||
|
treeView1.SelectedNode = selectedNode;
|
||||||
|
treeView1.SelectedNode.Expand();
|
||||||
|
treeView1.Select();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
catch (Exception)
|
||||||
{
|
{
|
||||||
//It's a new Search
|
MessageBox.Show("The map '" + searchText + "' cannot be found. Please try another term.");
|
||||||
CurrentNodeMatches.Clear();
|
|
||||||
LastSearchText = searchText;
|
|
||||||
LastNodeIndex = 0;
|
|
||||||
SearchNodes(searchText, treeView1.Nodes[0]);
|
|
||||||
TreeNode selectedNode = CurrentNodeMatches[LastNodeIndex];
|
|
||||||
LastNodeIndex++;
|
|
||||||
treeView1.SelectedNode = selectedNode;
|
|
||||||
treeView1.SelectedNode.Expand();
|
|
||||||
treeView1.Select();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue