Trying to build a MUD that allows Telnet and Web socket connections

57 views
Skip to first unread message

Liam Kenneth

unread,
Dec 16, 2015, 10:20:42 AM12/16/15
to nodejs
Hi,

I'm learning node by building an old school style text RPG(MUD).

I want to be able to telnet to my game and also use a browser with socket.io to interact with it.

currently Telnet works but I cant see a way of getting web sockets to work with it. 

Just looking for some ideas, pointers in the right direction.

Thanks

Zlatko

unread,
Dec 18, 2015, 12:02:26 PM12/18/15
to nodejs
Since it's a different protocol, your socket.io would listen on another port.

So, I guess the game api itself is on abstract enough to be accepting player input and sending output in a common way, your connections protocols have to hook into this abstract API.

Now, socket connections and telnet ones should all be wrapped into object streams, I think (and I think socket.io basically is like an object stream).

That way on ticks your game engine doesn't care where it sends stuff data. And it doesn't care how the data comes in as it's always passed to the game engine in the same way.

And your both com protocols don't care what the data is, they just need to know they're wrapping client side into object stream and converting server data back into whatever is needed.

That way you can later add other protocols as well, like pure http (POST for input, sse endpoint for output or so).

I'm very curious how it turned out for you - is your project available online?

Former addict here :)

mog...@syntheticsemantics.com

unread,
Dec 19, 2015, 1:12:06 AM12/19/15
to nodejs
I'm very curious how it turned out for you - is your project available online?

Former addict here :)

Ditto -- please support importing legacy PerlMUD databases!

Node should be perfect for this sort of event-driven job, and make possible scripting features undreamt of in Perl!

            -J

Reply all
Reply to author
Forward
0 new messages