Author Topic: Aggregating webserver improvements  (Read 1973 times)

I know a few of you out there had made improvements to my Torque webserver, and since I was going to work on adding some functionality to it / include it in a gamemode / release a new official build, I wanted to include your changes in it. For those of you who worked on it, could you post the full scripts here, or at least PM them to me? I remember seeing Lugnut post a few topics about the webserver and saw names like Brian Smith added to the credits section for the webserver in other gamemodes, but my hopes is by posting a topic here I can include the changes made by others I wasn't aware of too.

Even if you didn't modify the webserver but had ideas for it, or you want official functionality in it to enable a feature in a script/gamemode of yours, you can use this topic to post those here as well so the webserver can be as functional and complete as possible. Thanks.

What I wanna see is bloody websocket support, or some way to live update data

I'll find it and send it your way, most of my modifications were custom forwarding rules and ip loggers

Websocket support is about all I've got to suggest.

Im keeping my ideas to my self until I code them :)

What I wanna see is bloody websocket support, or some way to live update data

I'll find it and send it your way, most of my modifications were custom forwarding rules and ip loggers
I have implemented websockets, except I dont have the correct encoding/decoding functions in torque :(

I have implemented websockets, except I dont have the correct encoding/decoding functions in torque :(
adsfdsjfasjfasjfdsa ok
that is quite a bitch

im thinking about making a bit more userfriendly so people have an easier time making cool websites for their blockland servers :)



That was hard. Like, for real. I've never been so angry at code.



That was hard. Like, for real. I've never been so angry at code.

Lol, a challenge is good for you.

When I have free time I'll first write up the steps of how to create the websocket server itself... I couldn't find any existing documentation when I was creating my own that didn't have assumptions. For example, along the lines of "in the header, you will be given a mask. Use this mask to decode the payload" - that's great and all, but how do I use the mask. Of course, the official protocol standard (clicky) had it all in there, but digging around in it was the time consuming part. So hopefully that'll be useful for any of you looking to write one in another language or just check out some fun code (or at least I thought it was).

I will post a new "official" topic for the webserver soon that I can update over the course of the development that'll start with the last webserver version I posted + the websocket support so you can test it ASAP. There is only one flaw I know will happen with it, and that's our friend the null byte. If it just so happens one of the bytes is \x00 in a very rare case, it'll mess up the data transfer for that packet. However, the server can detect when this happens (woo!), and tell the client to simply re-send the last data since the mask is randomized every time. What this means for you guys is you'll just have to paste a snippet of Javascript I end up using for my tests into your pages to handle the re-send request.

Woo hoo
Yeah um I'm still looking for my modifications, but don't hold your breath - they aren't amazing

i was watching him code this
c:

Woo hoo
Yeah um I'm still looking for my modifications, but don't hold your breath - they aren't amazing

Do you know what they were at least? If you can remember but can't find them I can throw them in.
After that I'll put out the test version - just did a live chat with 3 people and it worked with them all.

Since you're only using HTTP, why can't you use AJAX's XMLHttpRequest?

Since you're only using HTTP, why can't you use AJAX's XMLHttpRequest?

From my understanding, there was no way to achieve a true, continuous, two-way data stream with AJAX, and that is why the websocket protocol was created. The closest things I've seen are continuous requests from the client to the server, or requests with very long timeouts. Thus having websockets integrated into the Torque webserver can benefit all sorts of pages that have features you'd naturally expect to live update.

Forgot you couldn't do true 2-way communication, but you can definitely do a continuous connection to a server. A continuous connection works pretty well for me, except for disconnects after a long time.