So first of all I tested it very often especially now again as you made me unsure if it really works. I can still be wrong but I just don't see it right now. Please correct me.
First thing I now check again. Is the media name is the sha1 hash in hex of the file, right? Check this
What I do is to just decode the filename.
LMD wrote:> Your system needs to calculate what to send
Of course it does ! There is no other way, AFAIK. Probably old protocols. That way the client can know which files your server can serve. So there won't be that much failed requests. It likely saves you LOTS of time.
Also, the calculations I do are extremely efficient. Binary searches and such. Number of hashes * binary lookup. That's not alot. My implementation does this in, huh, no idea, but extremely fast. And this only needs to be done a few times (when index.mth is requested).
Yes it's your way you do it. But the index.mth file which tells the client which files exist can also be static. It just contains all files the server has. About bandwith... later.
I know calculating is no reason to do this, it's much more what I saided before:
Lejo wrote:For all other remote media services you need a paid root server.
But you can everywhere get a simple static webserver where you just need to upload the medias.
You don't need to install complex programs you just generate the index file.
LMD wrote:Ah, now I know why I have been mislead. I thought you were just giving file names. You aren't. Your file names aren't the hashes.
Sure my files names are sha1 hashes as hex!
The index.mth tells the client which files exist.
LMD wrote:But this means that the given source code is not complete. There is no easy way of adding media; it needs additional shell scripts and stuff.
Sure it is! Just add your media and execute python make_index_mth.py
it will generate the index.mth file.
LMD wrote:My impl is also easy to use (as easy as running a JAR with arguments) and automatically retrieves media which does not need to be in any specific format (normal Minetest subgame/mod folders will all work).
For my you not even need to install a program just copy your media cache(containing your server medias) and execute make_index_mth.py
sofar wrote:He can read code. He can see that you're using `filename.decode("hex")` which does not generate sha1sums. So clearly, it is an incorrect implementation.
Sure he can. The file names are just hex encoded sha1 hashes. See again
sofar wrote:Your implementation is not functional. The only reason MT clients don't complain is because the client implementation has proper fallbacks. You don't understand the protocol and are not properly testing it yourself. Hint: watch the web logs, and hexdump your index.mth.
I checked my whole verbose stream! I extra added logging to my client and it never calls any error.
I also saw on my webserver in the access.log that the hashes got requested.
Don't want to go in detail here.
sofar wrote:He is sending each MT client that connects an 875KB file. Every, single, client, Every time they miss 1 media file. My implementation would only send ~30 bytes or so if only 1 file is needed from the server.
That's true and it's also the reason why I thought about alternatives which can also get hosted for free.
Just like php but php is ahhhhhhh please not.
There is no free host where you can run your own programm for free.(I haven't found one. Tell me if you know one please :D)
I would be better if you have it per server so the index.mth only sends needed files.
But come on it's still a question of less then a seconds to download it.
sofar + Linuxdir wrote:I ... don't understand why people are making inadequate solutions if a feature rich, open source and efficient implementation exist. A static index.mth is a ridiculous way to waste internet bandwidth and make MT clients do more work for no reason. Especially for a public service.
You people should support existing projects instead of fiddling around with this crap :D
As you maybe remember I multiple times asked you to add my whole project as it contains outdated files or skins. Which have no git link. Thats the reason why I added one remote media for alllll media the client download: just copy the cache.
In addition to this I multiple times used all my allowed bandwith of my server so I wanted a server for the whole media.
sofar wrote:This is far worse than sfan5's shell script, which actually does this correctly. Your code is non-functional.
I didn't find it? I would have used it for my server if I knew about it.