Re: Heroic Gunz - C# Launcher
Lets go over what's wrong with this and why no one should use it.
1. Synchronous downloads.
Code:
namespace GLauncher{
class PatchFile{
public bool checkPatchFile(string from){
try{
WebClient PatchFile = new WebClient();
PatchFile.DownloadFile(from+"ZPatch.xml", "ZPatch.xml");
return true;
}catch(WebException exeption){
MessageBox.Show(Convert.ToString(exeption));
return false;
}
}
}
2. Using MD5 hashing instead of a decent algorithm.
Code:
class Hash{
public string GetMD5HashFromFile(string fileName){
FileStream file = new FileStream(fileName, FileMode.Open);
MD5 md5 = new MD5CryptoServiceProvider();
byte[] retVal = md5.ComputeHash(file);
file.Close();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < retVal.Length; i++){
sb.Append(retVal[i].ToString("x2"));
}
return sb.ToString();
}
}
3. Sleeping on a main thread.
Code:
private void checkPatchFile(){
PatchFile checkPatch = new PatchFile();
if (!checkPatch.checkPatchFile(Convert.ToString(this.PatchLocation))){
this.TransferSpeed.Visible = false;
this.Information.Text = "Exiting Gunz Launcher.";
this.Information.Refresh();
Thread.Sleep(500);
this.Information.Text = "Exiting Gunz Launcher..";
this.Information.Refresh();
Thread.Sleep(500);
this.Information.Text = "Exiting Gunz Launcher...";
this.Information.Refresh();
Thread.Sleep(500);
Environment.Exit(0);
}else{
this.checkFiles();
}
}
4. Do I even need to explain this?
Code:
static bool FilesAreEqual(FileInfo first, FileInfo second){
if (first.Length != second.Length)
return false;
int iterations = (int)Math.Ceiling((double)first.Length / BYTES_TO_READ);
using (FileStream fs1 = first.OpenRead())
using (FileStream fs2 = second.OpenRead()){
byte[] one = new byte[BYTES_TO_READ];
byte[] two = new byte[BYTES_TO_READ];
for (int i = 0; i < iterations; i++){
fs1.Read(one, 0, BYTES_TO_READ);
fs2.Read(two, 0, BYTES_TO_READ);
if (BitConverter.ToInt64(one, 0) != BitConverter.ToInt64(two, 0))
return false;
}
}
return true;
}
Re: Heroic Gunz - C# Launcher
not a BACK DOOR ... But FRONT and OPEN door lol ..
any idea bout CGLEncryption?
Re: Heroic Gunz - C# Launcher
Quote:
Originally Posted by
Duluxe
You cant, i opened up the .sln in VS 2003 and it says its been used with a higher version of Visual Studio...
Wa I talking about opening or installing ?
Install 2003, 2008, 2012 > right mouse click sln > open with > 2008 or 2012, and you can still use 2003 for other stuff.
sigh..
Re: Heroic Gunz - C# Launcher
Re: Heroic Gunz - C# Launcher
May i ask how i get this Launcher working? I open it up in 2012 and open Form1 and edit this part
PHP Code:
private Uri PatchLocation = new Uri("http://127.0.0.1/UnitedUpdate/Gunz");
and build it and when i open it up and run i recieve this error, is there anything else i gotta do?? Thanks
http://i.imgur.com/Tkn6Lxg.png