The code listed here has been years in the making; countless revisions and rewrites throughout every line. As such, it is not the most organized of projects with many vestigial parts still imbedded. I tried to clean up as much as I could within a short timeframe, but there will still be areas of the code that may not make sense. Please keep that in mind when reviewing the code.
I used Notepad++ as my workspace, so the formatting and style generally looks better there. I cannot say how anything will look on another platform. The code compiles using gnu99, though I am sure it could work on others. I have ran it on Ubuntu for Windows and of course any Linux systems. It does not have any code to compile directly to run on windows or other OSes. The scripting language is Lua and requires those libraries to function properly. The Makefile is in the base directory, with the source files organized in /src. The .o files created on compilation will be placed in a /build folder with the executable created in the base folder with the Makefile. ./asteria & will run it on port 1111. This port number can be changed in the /src/Global/Mud.h file. Make clean is useful as it will remove the /build folder and clear out any residual files such as copyover. This is important as if the MUD ever crashes on a copyover reboot, the copyover file does not get deleted causing the MUD to not boot up properly when done manually. Performing a Make clean then Make will allow it to work again (or just delete the copyover file.) I tried to keep a consistent style, but that also changed over time. Generally, each structure has its own header and c file. Each structure has a New() and Delete() function assigned to it, such as NewItem() and DeleteRoom(). Even if there are no actual calls to a Delete function for a particular structure, I still added it for completions sake.
I used enums for constants throughout, with assigned numbers for many of them as I felt it looked nicer than using #defines. There are plenty of macros throughout, but hopefully not to obtuse to understand. I did very little commenting throughout the code (shocking, I know) as I felt the code should be written well enough to understand what is going on. I was also the only one ever seeing this code, so I only added comments when I felt it was pertinent for me to remember. I still believe that the code is generally written well enough that a person familiar with the C language should be able to follow the logic and understand what a particular function is doing.
The /src folder is divided up into groups of subfolders. This was done relatively recently, so is not extremely thought out nor complete. If you decide to remove the subfolders and just have all of the files in one folder, keep in mind the #includes would need to be changed as they reference the subfolders.
This codebase started a long time ago with a version of SocketMUD, but every single line has been rewritten in some way. I only mention this because I wish to point out the List.h/.c library which is the only library leftover from SocketMud. It has also been rewritten, but the ability to make linked lists and iterate through them so easily is something not to be taken for granted. I would make sure you understand how that works before trying to modify anything else, as it is used pretty much everywhere. I created a simple macro called ITERATE_LIST to make it easier; as well as a DESTROY_LIST macro that not only frees the list, but all the content it holds. As far as memory is concerned; I used valgrind often and believe that there should be zero memory leaks. The one exception is Lua and how it handles garbage. I believe that it works fine, but I cannot say for sure.
I have included sample data files for items, monsters, and some zones/rooms. The data for the actual world of Asteria are possessed by their creator. I used a very simple file reader for all player and world data files; which should generally be easy to understand. It is also very easy to add additional fields as necessary. There is a rather robust, though incomplete, OLC system that can be used to build a variety of things including spells, rooms, items, and monsters. This too is not very well documented, as it was still being designed. Also, if you are to create a new character, go into the account.info file of the account and set TRUST 31. This will give staff access in game.
Finally, this code is as-is and is completely available for use either modified or otherwise. There is no need to ask permission from me to do what you wish with it. Please feel free to run a MUD using this codebase, or take parts of it to be used in another codebase. I am not releasing this as a full-fledged engine; rather I uploaded it to possibly help another coder and to let former players get an idea of what was going on behind the scenes. Have fun with it, and feel free to ask me any questions if you see me on the Discord channel or elsewhere.