Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 22:04

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

Advertisement



Comparing 2 hashes: local and website

Discussion on Comparing 2 hashes: local and website within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1

 
.Nexitis's Avatar
 
elite*gold: 20
Join Date: Mar 2009
Posts: 668
Received Thanks: 220
Comparing 2 hashes: local and website

Hey, i'm about to code a patcher for a server but im struggling.

I need to compare the local client with the uploaded client on the homepage and if they aren't the same it should delete the local one and download the online one.

I know that this is possible with hashes but i don't know how to start.
Google won't really help me i only found out how to compare 2 local hashes.
.Nexitis is offline  
Old 01/10/2017, 09:53   #2
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,487
You could also put a version information somewhere on the page. It can be a simple, increasing, number. If the web-version is newer than the local one, just download the client.

If you wanna stick with the hash, just place a checksum file next to the client on the web, that is updated as the client gets updated.
Then calculate the local checksum and compare it to the provided remote checksum.

Calculating the checksum of a remote file on a webspace is not possible. In order to calculate a checksum, you need to process the whole file. So you'll download the file no matter if its newer or not, just to calculate the checksum and then probably discard it most of the time.
florian0 is offline  
Old 01/10/2017, 18:26   #3

 
.Nexitis's Avatar
 
elite*gold: 20
Join Date: Mar 2009
Posts: 668
Received Thanks: 220
Thanks for the tip but i need it to work fast.

i need a method to compare the local and the remote file to avoid downloading the complete client over and over again.
.Nexitis is offline  
Old 01/10/2017, 19:07   #4
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,487
But I described a way that does not require to download the entire file ...
florian0 is offline  
Thanks
2 Users
Old 01/12/2017, 14:52   #5
 
XYZ-Cannon's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 1,773
Received Thanks: 866
Quote:
Originally Posted by .Nexitis View Post
Thanks for the tip but i need it to work fast.

i need a method to compare the local and the remote file to avoid downloading the complete client over and over again.
"You could also put a version information somewhere on the page. It can be a simple, increasing, number. If the web-version is newer than the local one, just download the client."

Version in client= local variable f.e. int 3.
Webserver has version in remote file f.e int 4.
You check the version with your local client from the webserver.
When you load the client you compare local variable with that one from webserver. 4>3 = download client.
XYZ-Cannon is offline  
Thanks
1 User
Old 01/21/2017, 22:31   #6
 
Beni's Avatar
 
elite*gold: 0
The Black Market: 171/0/0
Join Date: Jul 2009
Posts: 3,269
Received Thanks: 786
keep in mind that this method does not check any integrety of the local files. with your checksum approach that would be (kind of) granted. You could implement that increasing version number first now for the beginning to work, but i'd recommend to update it later on that checksum version.
Beni is offline  
Reply


Similar Threads Similar Threads
[Help] Packet Editor - Comparing Socket Data.
07/29/2011 - General Coding - 9 Replies
Hello, I want to save and compare the data of a 2 packets, and finding out if they contain the same data... Thanks to u-coRe & Metin2Spieler97 i have something like this, and its working great! Thanks for the help!!! This part saves the 1rst packet to be compared. bool paso0(const char* buf,int len){
Load Local Error(local/hong kong/local_game.txt) ?!
02/15/2010 - Metin2 Private Server - 5 Replies
Wenn ich mich mit China.Exe einlogg kommt diese Fehlermeldung.. mit normaler Deutscher aber nicht.. Wieso? wäre nett wenn mir jemand helfen könnte:rolleyes: Mfg: Saishi
Load Local Error(local/hong kong/local_game.txt) ?!
11/20/2009 - Metin2 Private Server - 23 Replies
Ich hab mir heute einen P-server gebaut, aber ich habe ein problem.Wenn ich versuche meinen P-server zu öffnen kommt die Feherlmeldung: Load Local Error(local/hong kong/local_game.txt). Weiß jemand wie man dieses Problem beheben kann ? Wäre echt nett wenn mir mal jemand dabei hilft !! :D



All times are GMT +1. The time now is 22:06.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.