Skip to main content
gamedev.net
🔒 Locked

File identification

Started by iliak May 17, 2004 at 9:10 AM 4 replies 350+ views
Original Post
iliak
iliak
Hi, How can I be sure two files are the same, ie the files for a map are the same on the server side and on the client side ? I thought about the filename (case insensitive), the date, the size and maybe a CRC. I would like to have a quick method (computing crc of a 20~25Mo file would be slow...) to check. - Iliak -
- Iliak -
[ ArcEngine: An open source .Net gaming framework ]
[ Dungeon Eye: An open source remake of Eye of the Beholder II ]
ToohrVyk
ToohrVyk
Things like the average size of a polygon, the number of polygons, the number of items, the creation date are (imho) sure-fire ways. Two maps never look the same from that point of view.
iliak
iliak
I want to be sure the map files are the same. It''s possible to have the same number of polys, or faces in a map, but maps are totally differents...

- Iliak -
- Iliak -
[ ArcEngine: An open source .Net gaming framework ]
[ Dungeon Eye: An open source remake of Eye of the Beholder II ]
S1CA
S1CA
I''d store a UUID/GUID or similar in the header of the file when it''s created - in practical circumstances you can trust those to always be unique.

Then all you need to do is compare the headers for the two files rather than computing full CRCs for the whole file.

For a little extra data integrity/security you could also compute the CRC of just the header to ensure it (and therefore the UUID) hasn''t become corrupt.



Simon O''Connor
Game Programmer &
Microsoft DirectX MVP
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
CwazyWabbit
CwazyWabbit
I don''t know if MD5 is a better choice. I know it''s harder to fake the correct MD5, but don''t know if it would be too much computation for what you want.
iliak
iliak
I downloaded a md5 algo by John Walker @ http://www.fourmilab.ch/ and it takes me 600ms to checksum'izing a 15Mo file...

It sounds great...

- Iliak -

[edited by - iliak on May 17, 2004 11:43:42 AM]
- Iliak -
[ ArcEngine: An open source .Net gaming framework ]
[ Dungeon Eye: An open source remake of Eye of the Beholder II ]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.