[Release] AutoPatcher code source

04/12/2012 13:37 DyjgK64J451Jhv0#1
bored and playing around so i coded this shit
idea ?
it download string which contains the newest version and compare with the version at version.dat , if there is a new patch it download it and start it
ummm if there is more than 1 patch updated u need to add some do whiles (u can add them i wont wipe ur ass either)

code source

i didnt test it yet -.- so move ur fucking ass and give it a try
a scan ? i dun give a fuck

what it actually depends on ? web client instance to download the string and the new patchs , lil dicky progressbar to check the progress also a lable throw event handler of web client instance

for ummm exit after patching ?
add this shit
if (progressBar1.Value == 100)
{
this.Dispose();
Application.Exit();
}
or ummm throw the event handler of download complet
aka

wc.DownloadFileCompleted += new AsyncCompletedEventHandler(wc_DownloadFileComplete d);

void wc_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
wipe his ass
}

ummm about download speed i unno how it will be but umm it's async anyway

design is the same shit as tq , ill add the ummm whole project

and umm i need to stop saying ummm but it's not ur own buss. -.- lol
yes im mad bro

[Only registered and activated users can see links. Click Here To Register...]

P.s if anyone had developed a project about physcometric chart pm me , i've just done one but not with much graphics so was wondering if it worth it adding some xna shits o-0 lol , sorry but it's a project of mine at college so i give a shit about it

P.s for more safty scan it o-0 lol

P.s i like to say a7a

cya folks
04/14/2012 00:01 _DreadNought_#2
That code is TERRIBLE.

You've actually hurt my eyes.
04/14/2012 09:00 DyjgK64J451Jhv0#3
w/e :)
04/14/2012 09:09 Korvacs#4
Bad code is bad, DownloadProgressChanged should be assigned before the download starts, thats a pretty obvious mistake..and as you state DownloadFileCompleted should be used for disposing and closing the client.

However what i think is the biggest mistake is your autopatcher client assumes that the new version is also the next version, so if you have 5 patches 1001 - 1005, and your client is currently on 1001, it will just download 1005 and assume its upto date resulting in you completely breaking your client.
04/14/2012 12:25 I don't have a username#5
Also you never close the stream.
04/14/2012 13:30 DyjgK64J451Jhv0#6
edit : .. reason : ..
04/14/2012 13:55 Korvacs#7
lol amusing, no one ever said "why isnt this code perfect so people can copy/paste it?" we all just said "hey look this code is bad and heres why", also amusing you start with "guys guys chill out" and then go off on one at the end, GG.

There's nothing wrong with having the progress bar not update in time, but getting into the habit of assigning event handlers after the event is known to have been fired is bad practice.

Also having re-read your code, you start an async download and then try to run the downloaded patch immediately on the next line, so you will infact get a filenotfound exception and the entire thing will break. Going by your logic there (this is just an fyi), if that was how the application functioned (ie. it was a sync download) the progress bar would never be updated untill after it completed.

So going from me suggesting that you should use the DownloadFileCompleted event im going to move to this event is a requirement so that you can then run the installation once the download is completed.

Even if your attitude to everything im saying is that you dont give a fuck (which is fine btw), if i did write an autopatch client mine would actually work...you on the other hand are rejecting tips and advice on your code which you need to improve...
04/14/2012 14:11 DyjgK64J451Jhv0#8
Quote:
Originally Posted by Korvacs View Post
lol amusing, no one ever said "why isnt this code perfect so people can copy/paste it?" we all just said "hey look this code is bad and heres why", also amusing you start with "guys guys chill out" and then go off on one at the end, GG.

There's nothing wrong with having the progress bar not update in time, but getting into the habit of assigning event handlers after the event is known to have been fired is bad practice.

Also having re-read your code, you start an async download and then try to run the downloaded patch immediately on the next line, so you will infact get a filenotfound exception and the entire thing will break. Going by your logic there (this is just an fyi), if that was how the application functioned (ie. it was a sync download) the progress bar would never be updated untill after it completed.

So going from me suggesting that you should use the DownloadFileCompleted event im going to move to this event is a requirement so that you can then run the installation once the download is completed.

Even if your attitude to everything im saying is that you dont give a fuck (which is fine btw), if i did write an autopatch client mine would actually work...you on the other hand are rejecting tips and advice on your code which you need to improve...


i dont reject tips , here is an example of 2 people trying to help

this is bad , piece of shit , u can't get it done , u need to wear tops before u start this

this is not gona work cuz u forgot to wear tops

which comment will be nice and which will piss u off ? that's why i was pissed , technically im not even programmer , mechatronics engineer only do micro-controllers and they done with programming

sorry for being rude in the post i did but the point is , i would like it when people gives me tips or even teach me something new or tell me that i have a mistake but then they just tell me that what i have did was a piece of shit it will just lead to something like what i have said earlier , sorry once more :\
04/14/2012 18:19 shitboi#9
@DyjgK64J451Jhv0

logic is logic nonetheless. I suppose you probably need just as much if not more logic in complex chip design. You should gracefully ignore all the flaming posts and humbly learn from those who is willing and can teach you.

@korvacs

your Conquer wiki page has been down for a couple months. Though there are ps sources to refer to, the page is more comfortable to read use.
04/14/2012 19:19 Korvacs#10
Indeed it has, trying to find the time to get the wiki up again, doing up a flat takes up alot of my time.