{"id":17931377,"url":"https://github.com/mattgodbolt/xania","last_synced_at":"2025-10-12T11:33:37.059Z","repository":{"id":41881849,"uuid":"277354974","full_name":"mattgodbolt/xania","owner":"mattgodbolt","description":"Xania MUD source","archived":false,"fork":false,"pushed_at":"2024-03-30T18:20:31.000Z","size":9325,"stargazers_count":58,"open_issues_count":42,"forks_count":15,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-19T02:11:27.391Z","etag":null,"topics":["c","cpp","mud","mud-server"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattgodbolt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-07-05T17:53:22.000Z","updated_at":"2024-06-15T12:49:53.000Z","dependencies_parsed_at":"2024-03-28T02:36:10.055Z","dependency_job_id":null,"html_url":"https://github.com/mattgodbolt/xania","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattgodbolt%2Fxania","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattgodbolt%2Fxania/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattgodbolt%2Fxania/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattgodbolt%2Fxania/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattgodbolt","download_url":"https://codeload.github.com/mattgodbolt/xania/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217032,"owners_count":20579274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cpp","mud","mud-server"],"created_at":"2024-10-28T21:21:31.989Z","updated_at":"2025-10-12T11:33:31.990Z","avatar_url":"https://github.com/mattgodbolt.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Xania MUD source ![C/C++ CI](https://github.com/mattgodbolt/xania/workflows/C/C++%20CI/badge.svg)\n----------------\n\nFound on @mattgodbolt's hard disk, and resurrected. Shows the code behind a\nUK-based Multi-User Dungeon that my university housemates and I ran, built and\nadministrated in late 1990s.\n\n## Discord\n\nWe chat about the mud [here](https://discord.gg/Xsstufyt8t). Feel free to drop in.\n\n## Building and running\n\nIf you want to build and run Xania locally, you'll need a modern Linux. We test it on Ubuntu 24.0.4 and Arch Linux.\n\nIt works within **Docker** including when hosted by **Windows Subsystem for Linux**. To learn more about this see\nthe Docker-specific [tutorial](docker-dev/README.md)!\n\nIt has been reported to work on Fedora 34 too.\n\n### g++ and Other Essentials\n\nHere are the Ubuntu steps for installing some prerequisites:\n\n```bash\n# Install gcc-13 and g++-13.\n$ sudo apt install build-essential manpages-dev software-properties-common\n$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test\n\n# Optional step: We recommend installing ninja-build as it speeds the builds up significantly.\n$ sudo apt install ninja-build\n\n# And you'll need the following...\n$ sudo apt install git make curl\n\n# Local builds autodetect g++-13 and use it for compilation, but fallback to g++-12.\n# clang-19 works too (see later section).  If you want to build with a different compiler\n# create a new cmake toolchain file e.g. \"toolchain/mycompilers.cmake\" and set the compiler\n# variables in it. Then invoke make specifying the leading part of your toolchain name in \n# the TOOLCHAIN make variable e.g.\n$ make TOOLCHAIN=mycompilers test\n\n# Alternatively, if you know what you're doing you can invoke cmake directly and pass a custom \n# toolchain, (with -DCMAKE_TOOLCHAIN_FILE= or using the --toolchain switch (cmake \u003e= 3.21)). \n# Take a look in the Makefile for how cmake gets invoked to generate the build currently.\n```\n\n\n\n### CMake\n\nYou'll also need a recent version of __cmake__. The build is configured to require at least version 3.28,\nalthough older versions may work.\nOn Ubuntu 22 or later and Arch, the cmake package is present in the main repository.\n```bash\n$ sudo apt install cmake\n```\n\n### Build and Run\n\nThe build itself downloads and manages many other upstream dependencies such as __conda__ and __conan__\nvia the `Makefile`.\n\nTo build and run, type `make`:\n\n```bash\n$ make start\n... lots of configuration nonsense here, downloads, cmake, and then compilation ...\nAll being well, telnet localhost 9000 to log in\n$\n```\n\n\nThe MUD is now running in the background, on port 9000. `telnet localhost 9000` should get you the logon prompt. Create\na character, and log in...and have fun!\n\nIf you want to build but not start it up, simply run `make`.\n\nBy default a debuggable unoptimized build is run. Use `make BUILD_TYPE=release` to build the optimized version.\n\n### Stopping and Restart the MUD\n\nTo stop Xania, run `make stop`. To restart,  `make restart`.\n\n### Compiling with clang\n\nYou may be interested in compiling with `clang`. The project builds cleanly with clang 19 and has been tested in the\npast with versions going back to 15.\nYou may also want to use `clangd` as an LSP for editors like [ neovim ](https://neovim.io)\nand the [ nvim-lspconfig ](https://github.com/neovim/nvim-lspconfig)plugin.\n\n```bash\n# First install the tools:\n$ sudo apt install clang-19 clangd-19\n$ update-alternatives --install /usr/bin/clangd clangd $(which clangd-19) 10\n$ update-alternatives --install /usr/bin/clang clang $(which clang-19) 10\n$ update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-19)\n$ update-alternatives --install /usr/bin/clang-tidy clang-tidy $(which clang-tidy-19)\n```\nBuild by specifying the toolchain:\n\n```bash\n$ make TOOLCHAIN=clang-19\n```\nWhen building with clang, it's possible that you may run into compatibility\nproblems with versions of libraries in your conan cache. The cache typically resides in `~/.conan`. \nRemoving the problematic libraries from the cache and re-running make is one solution.\nYou can selectively nuke cached libraries, for example:\n\n```bash\n# Remove all versions of fmt from the cache\n$ ./cmake-build-debug/.tools/conda-25.1.1-2/bin/conan remove -c fmt/*\n# Remove all cached libraries from the cache\n$ ./cmake-build-debug/.tools/conda-25.1.1-2/bin/conan remove -c \"*\"\n```\n\n### Creating an immortal account\n\nTo administrate Xania from inside, you'll need a level 100 character. Create a character as above, then `quit`. Edit\nthe `player/Yourplayername` file and edit the line with `Levl 1` to be `Levl 100`. Then log back in and voila! You are\nan immortal!\n\n## Developing\n\nThe top-level `Makefile` is more of a convenience layer to set up a consistent environment. It delegates the actual\nbuilding to a `cmake`-built system in one of the `cmake-build-{type}` directories (e.g. `cmake-build-debug`). A tiny\namount of back-and-forth between the two systems ensures the `cmake` build system uses the various tools installed\nlocally in `.tools/` to do work (e.g. `conan` for C++ packages, `clang-format` for code formatting, etc).  The top-level\n`Makefile` will configure `cmake` to use `ninja` if you have that installed, else it'll use `make`.\n\nFor day-to-day developing you can use your favourite IDE or editor (CLion, vs.code, vi, emacs). If your IDE supports\nCMake projects, then it might Just Work out of the box. CLion, for example, will open up and run the code from the IDE.\n\nThe mud happily runs without being installed, however it does rely on a few environment variables for configuration \n(see below).\n\nThere are two components, `doorman` and `xania`. The former is the TCP side of things, and unless you're changing how\nthe MUD and the connection process communicate you can probably build and run `doorman` and then leave it running.\n`xania` is the MUD part, and so if you're debugging and building, that's probably the target to run.\n\nWe use `clang-format` to format all the code consistenly, and a `.clang-format` file is in the root. Again, most IDEs\nwill pick up on this and just use it. Command-line users can run `make reformat-code` to reformat everything, or\n`make check-format` to just see if everything's formatted as it should be. At some point we'll make this part of the CI\nprocess.\n\n### Environment Variables\n\nThe mud processes use some environment variables for configuration. Out of the box, `make start` will set reasonable defaults\nfor these. The default settings are stored in `mud-settings-dev.sh`, and `make start` will read this file.\n\nIf you are doing development and launching the processes from an IDE then you prefer to configure these settings separately.\nThe project includes an example Visual Studio Code `launch.json` that sets these.\n\n- `MUD_AREA_DIR`:  Static game database files.\n- `MUD_DATA_DIR`:  The base directory of all runtime data. The mud uses these subdirectories:\n   - player/ (player character files)\n   - gods/ (configuration for deities)\n   - system/ (other player generated data e.g. ban lists and bug lists)\n   - log/ (the mud processes are unaware of this as log output is redirected from to stdout \u0026 stderr)\n- `MUD_HTML_DIR`:  Static and dynamically generated HTML.\n- `MUD_PORT`:  The TCP port doorman listens on for telnet connections. Default: `9000`.\n\nIf you are running either process _directly_ from a shell rather than using `make start` or a launch target in your IDE,\nthere is also a helper script `mud-settings-dev.sh`.  Source this file from one of your shells then run the process e.g.\nafter running the build:\n```\n$ . mud-settings-dev.sh\n$ ./install/bin/doorman\n```\n\n### Tests\n\nThere are some very early tests. To run the tests, use `make test`, or run them from your IDE.\n\n### Debugging Xania in GDB\n\nThere's more than one way to do this, and one way is:  after building Xania you can run \nit like so (use of `gdb` is optional):\n\n```bash\n$ gdb install/bin/xania\n(gdb) r   # to run\n```\n\nYou can also attach to the running process using gdb -p.\n\nIf you're relying on the default `make` targets to build \u0026 start things, the `reboot` command from within the MUD will\nnot restart the processes.\n\nA solution is to not run `make start` at all, but instead, execute `./install/bin/doorman` and\nthe xania executable directly in another terminal as described above.\n\nFor `neovim` users, the [ nvim-gdb ](https://github.com/sakhnik/nvim-gdb)plugin works well.\n\n### Going \"live\"\n\nWhen the MUD is actually deployed, we `make install` to get a built setup with `area`s and binaries etc. That's tar'd\nup and copied to a host to run. `player` files and whatnot are managed separately. If you're curious how we're sketching\nout ideas for the deployment, check out the `infra/` directory. It's a bit wild in there right now though.\n\n# License\n\nSee the [LICENSE](LICENSE) file for more details, but this code is built on and\nextends code from  [Rom2.4](http://web.archive.org/web/20000818050433/http://www.hypercube.org/tess/rom/) code.\n\nXania's log on banner contains a lot of the required info. As you may not wish\nto log in, it is:\n\n```\n.   .... NO! ...                  ... MNO! ...\n.... MNO!! ...................... MNNOO! ..    /    \\    /    \\\n.... MMNO! ......................... MNNOO!!   \\     \\  /     /\n.. MNOONNOO!   MMMMMMMMMMPPPOII!   MNNO!!!!     \\     \\/     /\n.. !O! NNO! MMMMMMMMMMMMMPPPOOOII!! NO! ...      \\          /  A N I A\n  ...... ! MMMMMMMMMMMMMPPPPOOOOIII! ! ...       /    /\\    \\\n ........ MMMMMMMMMMMMPPPPPOOOOOOII!! .....     /    /  \\    \\\n ........ MMMMMOOOOOOPPPPPPPPOOOOMII! ...      /    /    \\    \\\n  ....... MMMMM..    OPPMMP    .,OMI! ....     \\   /      \\   /\n   ...... MMMM::   o.,OPMP,.o   ::I!! ... \n       .... NNM:::.,,OOPM!P,.::::!! ....    ...where it is recognised that \n       .. MMNNNNNOOOOPMO!!IIPPO!!O! .....   shaking hands with Death brings\n       ... MMMMMNNNNOO:!!:!!IPPPPOO! ....  longevity and considerable kudos.\n         .. MMMMMNNOOMMNNIIIPPPOO!! ......\n        ...... MMMONNMMNNNIIIOO!..........\n     ....... MN MOMMMNNNIIIIIO! OO .......... DikuMUD by Hans Staerfeldt\n  ......... MNO! IiiiiiiiiiiiI OOOO ......... Katja Nyboe, Tom Madsen, Michael\n ..... NNN.MNO! . O!!!!!!!!!O . OONO NO! .... Seifert, and Sebastian Hammer.\n .... MNNNNNO! ...OOOOOOOOOOO .  MMNNON!..... Based on MERC 2.2 code\n ...... MNNNNO! .. PPPPPPPPP .. MMNON!....... by Hatchet, Furey, and Kahn,\n    ...... OO! ................. ON! .......  ROM 2.4 (C) 1993-96 Russ Taylor\n       ................................       MUDdled by the Xanian Immortals\n```\n\nI (@mattgodbolt) believe the code is free to open source, but of course if you\nhave any issues don't hesitate to contact me.\n\n## Thanks to\n\nThe Xania implementors were avid players of [MadROM](http://madrom.net/), and were inspired to get the ROM code and\nstart hacking on their own MUD. In particular thanks to Etaine, Ozymandius, Neuromancer, Amiga and Crash. Sorry if we\nforgot someone!\n\nIn the MUD itself, the thanks read:\n\n```\nXania was created by The Moog, Death, Faramir, Rohan  and Wandera,\nfive bold Gods who saw fit to create a new world where\npeace and happiness would reign. Sadly, (due to  sheer incompetence)\nthey made a nasty mistake somewhere along the line, and an infestation\nof evil spread chaotically throughout  the realm. Thus, this place is\nno longer safe and it is up to you, bold adventurer, to face up to the\nprospect of meeting an untimely demise!\n\nA special thank you to the original immortals and heroes who contributed\nto Xania's success, you can see their names using the 'wizlist' command.\n\nAnd it goes without saying, Xania would have been nothing without the base\ncode and areas that shipped with Rivers of Mud (ROM), its sister mud, MadROM,\nand before that, DikuMUD and MERC. We owe a debt of gratitude to the original\ndevelopers and zonesmiths.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattgodbolt%2Fxania","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattgodbolt%2Fxania","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattgodbolt%2Fxania/lists"}