KaVir said:
The only other option I can think of is to send the avatar directly from the mud using a binary protocol, and write it out to a file at the client end. But presumably that's going to require people to modify their sandbox settings?
...
Twisol said:
Excellent point. I'm for removing the sandbox at this point, too.
If we can stick to the initial question at first, that would be good. If you want to open a new topic about removing the sandbox, I am happy to discuss it.
I think you can pretty easily simply download an avatar as a binary sequence. For one thing, the recent changes to the telnet negotiation makes that practical, as the binary sequence could contain any character including binary zero. The only proviso would be that the IAC character (hex FF) would need to be doubled, which would provide a slight overhead.
I would envisage an "avatar ID" being sent, and if the client can't find it, it requests that avatar image to be sent, and then save it under its ID.
Say the avatar was 32 x 32 pixels, and 3 bytes per pixel (RGB) then that is only 3072 bytes, and that is before compression. You could send a PNG file which would be convenient to set up at the server end, and MUSHclient could simply do WindowLoadImageMemory to take the binary representation of that image and load it into a miniwindow. And of course the PNG file would be smaller, as it is compressed.
The sandbox concerns don't really come into it here, because you could readily set up a SQLite3 database (which is allowed anyway), and a "blob" type, to store images under. So you simply save each avatar as a database record, and load them when required. Simple and quick.
I honestly think that setting up web servers to serve up the images, and then starting HTTP sessions (one way or another) is just more complex. At the end of the day the data still has to be downloaded one way or another, so the 3072 bytes (or whatever the length is) may just as well come into the main client stream as through a HTTP stream. Yes, there may be a slight delay, but that is like under a 3 Kb download, and only once per image, and with modern web connections most people would be used to downloading that amount every few seconds. Just as an example, the Downloads button on this page is is 2.5 Kb in size.
As for the sandbox, let's talk about that separately. I think I have shown that this particular issue can be easily resolved without even worrying about it. |