Archived

This topic is now archived and is closed to further replies.

Roof Top Pew Wee

What's the best way to assure uniqueness?

Recommended Posts

I''m creating a 2D map maker that loads up terrain packages ( a bunch of terrains which can blend into eachother, also made by another program I''m making). The question I have is I want these maps to be used in a multiplayer game. However, it is common that someone downloads a map, and messes with it, without changing its name. So I was thinking of adding something to maps to test whether they are the same, aside from file name. My idea was something along the lines of time. It is unlikely that two people save a file at the same exact second, but then again, it is possible. If this is really a good idea, can anyone tell me what funcion I can use to get the time? And if not, any other suggestions? Thanks. --Vic--

Share this post


Link to post
Share on other sites
Null and Void    1088
Time isn''t accurate, each computer has a different time (what if one person has there clock way off?). Everytime I extract tar.gz''s on sourceforge it complains that they are from the future (their time is past that of the server''s) . You can try a using checksum. It won''t tell you which one is newer, but it has a very high certainty of telling you if they''re different.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
Dactylos    122
If you''re targetting windows, then you can use a GUID/UUID. They are supposedly unique (based on time of creation and some id-stuff from network cards etc. on the machine that creates them). I don''t remember the function for generating a GUID. Just search msdn.

Share this post


Link to post
Share on other sites