1

Topic: Map versions - how does it work?

I can see that when i download a map it will have a random string at the end.
for example: ctf5_3a1694a7
Could someone tell me how does this work?
Does the server create a "hash" for a map and then puts it at the end?
If this is true could someone link me the function that creates it?
I searched it but couldn't find it.
Thanks a lot for any help

2

Re: Map versions - how does it work?

duralakun wrote:

Does the server create a "hash" for a map and then puts it at the end?

Yes. It is a checksum.

It is calculated there, for example:
https://github.com/teeworlds/teeworlds/ … pp#L26-L39

Not Luck, Just Magic.

3

Re: Map versions - how does it work?

Thank you.
I can see this source code is part of a small tool.
Could you tell me, does the server use this tool in order to create unique map names and then sends it to client?
Or is something like this inside the server that does the same thing?

4

Re: Map versions - how does it work?

It's something inside the server (and client) that does it.

Here:
https://github.com/teeworlds/teeworlds/ … pp#L89-L91
Using functions defined in src/engine/shared/datafile.h and src/engine/shared/datafile.cpp

Not Luck, Just Magic.

5 (edited by duralakun 2019-01-10 19:30:03)

Re: Map versions - how does it work?

Thanks again. I will take a look and try to understand it :)

6

Re: Map versions - how does it work?

Related: https://github.com/teeworlds/teeworlds/issues/1691

Not Luck, Just Magic.