Register for your free account! | Forgot your password?

You last visited: Today at 00:35

  • Please register to post and access all features, it's quick, easy and FREE!

 

[Release] AutoPatcher code source

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2012
Posts: 134
Received Thanks: 30
[Release] AutoPatcher code source

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



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
Attached Files
File Type: rar simple updating.rar (615.5 KB, 286 views)



DyjgK64J451Jhv0 is offline  
Old   #2
 
elite*gold: 0
Join Date: Jun 2010
Posts: 2,183
Received Thanks: 843
That code is TERRIBLE.

You've actually hurt my eyes.


_DreadNought_ is offline  
Thanks
2 Users
Old   #3
 
elite*gold: 0
Join Date: Apr 2012
Posts: 134
Received Thanks: 30
w/e
DyjgK64J451Jhv0 is offline  
Old   #4
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,234
Received Thanks: 2,476
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.


Korvacs is offline  
Old   #5
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 782
Also you never close the stream.
I don't have a username is offline  
Old   #6
 
elite*gold: 0
Join Date: Apr 2012
Posts: 134
Received Thanks: 30
edit : .. reason : ..
DyjgK64J451Jhv0 is offline  
Old   #7
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,234
Received Thanks: 2,476
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 **** (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...
Korvacs is offline  
Old   #8
 
elite*gold: 0
Join Date: Apr 2012
Posts: 134
Received Thanks: 30
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 :\
DyjgK64J451Jhv0 is offline  
Old   #9
 
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
@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.
shitboi is offline  
Old   #10
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,234
Received Thanks: 2,476
Indeed it has, trying to find the time to get the wiki up again, doing up a flat takes up alot of my time.


Korvacs is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
[Source] Autopatcher - MD5 By PavusRuleZ
English Version (translate by me =.= ) : Hello , i come from Italy . __________________________________________________ _____ Current...
7 Replies - Metin2 PServer - Discussions / Questions
[RELEASE] [OPEN SOURCE] CE 5.5 Pointer to AutoIt Source-Code
Habe heute erst gemerkt, dass es hier eine AutoIt Sektion gibt xD also poste ich mal mein Programm mit rein. Funktionsweise: 1. in CE Rechtsklick...
6 Replies - AutoIt



All times are GMT +1. The time now is 00:35.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.