omud
v1.0.13
Published
Node based websocket driven MUD.
Readme
This is a shared library used when developing a websocket based MUD in Node with Typescript. I wanted to share the domain models and this was an easy way to get started. So if you use this please contact me as without knowing I may delete or rename this...
At request or if it works out, I may begin to move service level code to this as well so that the Angular application can simulate more of the mud when 'editing'.
I think that IPlayerController is currently the problem, because it handles the input queue. But it can also be that commands should be moved to their own manager and the script service should have access to that manager.
Domain Models...
Server
The server starts up the primary dependencies:
- Mongo DB (Data)
- Express (Web Server)
- Connection Host
- MUD
Uses Domain: Connection Host, IPlayer, IAccount
It also handles the entry of connections, checking that the connection's account is valid and owns the player it is trying to connect with.
Connection Host
The connection host managed the physical connections to the mud. It will tell the mud when a player is added or removed as well as processing I/O from the mud to the physical connection.
Problems: The mud is hard coded in it, it should be taking an interface and using that.
User
A User is a connection to the connection host, it joins the websocket connection, the user's account, and the player within the account. Websocket + Account + Player.
Player
A player is owned by an Account, and represents saved progressed for an Actor. It contains both the template the player started from, and their current progress.
New Player
This is a transitive DTO for submitting a new set of player data.
Account
An Account owns one or more players and/or areas. Accounts have permissions.
New Account
This is a transitive DTO for submitting a new set of account data.
Actor
Represents an in-game actor that may or may not be wired up to a Player.
Player Controller
GameHost Command
Other
How should security work? Even if you edit the area for five minutes, if you haven't saved then your token is expired and that is that... Should the editor maybe ping the server? The problem being that a person is working and they haven't actually sent anything to the server in a while.
- have certain actions cause a server ping.
- automatically ping at intervals
