ringmud icon indicating copy to clipboard operation
ringmud copied to clipboard

SSH and WebSocket Support

Open ProjectMoon opened this issue 15 years ago • 6 comments

SSH and WebSocket would be good ideas for other communication protocols aside from Telnet. Telnet is ancient and insecure (although still the basis of most MUD communications). SSH is modern and secure. WebSockets give the MUD server an easy Web-based frontend that any multitude of clients could be written for.

ProjectMoon avatar Jun 12 '10 03:06 ProjectMoon

Yes, I would love to see a mud implementation using ssh. Really look forward to seeing this!

ingalls avatar Jan 02 '12 22:01 ingalls

Unfortunately, for that to happen I would have to be actively working on RingMUD. I only vaguely remember that I left off with rewriting the commands portion. There are so many bugs and issues with RingMUD, that I don't even know where to begin. The last time I tried running it, I couldn't get the XML database connection to work properly.

ProjectMoon avatar Jan 03 '12 14:01 ProjectMoon

I know this is kinda out of place on the issue thread... but I'm new to github and couldn't find any kind of pm system.

I've been writing a new mud server, it's not very clean code as of yet as I'm relatively new to Java but I was wondering if all of your code is under the GPL v3 license so that if I was to look through your code I may be able to take some ideas/design concepts from your code?

Cheers, Nicholas

ingalls avatar Jan 03 '12 15:01 ingalls

The entirety of RingMUD (not necessarily its dependencies) is LGPL: https://github.com/ProjectMoon/ringmud/blob/master/LICENSE

That means any code you take from it has to be LGPL, but that requirement doesn't spread to the rest of your project's dependencies. This is different from the GPL, which is "viral" in the sense that any GPL code makes an entire project GPL. The reasoning was because RingMUD was supposed to be a library to build a MUD on top of.

I started RingMUD to learn how to write a MUD, and used the (as far as I can tell) abandoned WolfMUD code as a base. At this point, all WolfMUD code is long gone. Because RingMUD was a progressive project, a lot of the code is in varying states of completion that I never really bothered to keep track of. Some of it is better organized than others.

As for messaging, GitHub does have a PM system. I tried to message you, but it said you haven't provided an email address yet.

If you want to find out how RingMUD runs, start here: https://github.com/ProjectMoon/ringmud/blob/master/src/ring/main/RingMain.java https://github.com/ProjectMoon/ringmud/blob/master/src/ring/server/StartServer.java <--- module that starts the server https://github.com/ProjectMoon/ringmud/blob/master/src/ring/system/MUDBoot.java <--- takes care of all the things you're probably interested in

MUDBoot is actually a good example of disorganized code and the progressive code and fix nature of RingMUD. There is a DeployedMUD object, which you think would contain its own world and everything... but nope. MUDBoot is still static and the entire system is basically a massive singleton.

And for the record, I do not recommend using an XML database for object storage. I think it could work, but the mapping and everything is too much of a pain. Better to go with an object-oriented database or just JSON files (which is what my next project will use).

ProjectMoon avatar Jan 03 '12 18:01 ProjectMoon

Ok, that sounds great! I have no problem putting the entirety of my code under the LGPL.

For now I'm more interested in the concepts that you've incorporated into RingWorld as, like you, I'm doing this to learn more about how muds work as there isn't very much info about the servers out there. If I do decide to actually use code under LGPL I have to reference back to the library/code but I didn't see any mention of giving credit to the programmer, do you want your name displayed in any way? I'd be happy to give credit where credit is due.

I've added my email and name to the profile so that should work now.

Thanks for the links! They'll provide a nice starting point when browsing the code. I haven't had a look at the code yet, but do you mind pointing me towards the user login class as well?

And finally just a couple of questions about your design of the server - Is there any sort of sample data-set for the server? And in what way is the data-set stored? (Text files a sql database? Does save every action to the data-set, or does it save everything at a specific time everyday or does it only save the server to physical memory when the server is restarted/shutdown?

Thanks for your help! Nicholas

ingalls avatar Jan 03 '12 18:01 ingalls

@ingalls I have decided to start work on RingMUD again, so it's better late than never to answer your questions. After 10 years, a lot more experience, and better languages and features, it's time to finish this off. As before, it's still a learning experiment.

You can follow the new progress on the convert-to-mvn branch. Converting to Maven is only one step of many. I should probably rename it.

Is there any sort of sample data-set for the server?

  • There was a sample world that I used, probably some XML file. It seems I never committed it for some reason, and it is since lost.
  • I am changing the world building to be done by Kotlin DSL, which will be put into the packaged .mud file as Kotlin scripts, which will be executed when the MUD is deployed. The world will be built in memory.

And in what way is the data-set stored? (Text files a sql database?

  • It was stored in the eXist native XML database. This idea was dumb even at the time 10+ years ago, although somewhat interesting.
  • I am removing eXist completely and will migrate storage to either H2 or SQLite databases.

Does save every action to the data-set, or does it save everything at a specific time everyday or does it only save the server to physical memory when the server is restarted/shutdown?

  • A lot of things happen(ed) only in memory. As part of the new architecture, this will be cleaned up and actually made clear and proper.
  • There is a clear delineation between state that must be completely persistent, between server reboots, and state that is semi-transient. The world itself, as defined in the MUD data files, is semi-transient. Mobiles, items in the world, NPCs, etc are all things that have a known beginning state that they can be reset to. Players, their inventories, user accounts, etc are things that must be persistent no matter what happens.
  • It's likely everything will be stored in a database, even the semi-transient state. At first, stuff like player accounts and characters will be stored in the database while the world state will probably be serialized to disk between reboots, or loaded from scratch every server start.
  • The end goal is to have the semi-transient state be capable of persisting between server restarts. This is important for version upgrades, which makes serialization complicated. But it also needs to be easy to erase the semi-transient state and recreate it (this is probably as easy as truncating tables, if we are able to reload the Kotlin scripts at runtime).

ProjectMoon avatar Aug 17 '20 10:08 ProjectMoon