Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit 2d4d9a1

Browse files
committed
Initial commit
0 parents  commit 2d4d9a1

18 files changed

+397
-0
lines changed

.github/CONTRIBUTING.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# How to contribute
2+
3+
First off, thanks for taking the time to contribute! The following is a set of guidelines for contributing to GuildMUD-rs. These are just guidelines, not rules, so use your best judgement and feel free to propose changes to this document in a pull request.
4+
5+
## Code of Conduct
6+
7+
This project adheres to the [Contributor Covenant 1.2](http://contributor-covenant.org/version/1/2/0). By participating, you are expected to uphold this code. Please report unacceptable behavior to [[email protected]](mailto:[email protected]).
8+
9+
## Getting Started
10+
11+
This codebase is built on top of a Rust port of the barebones [SocketMUD](http://www.mudpedia.org/mediawiki/index.php/SocketMUD) codebase. If you are new to the Rust programming language, or MUDs in general, head on over to [MudBytes](http://www.mudbytes.net/), [/r/MUD](https://www.reddit.com/r/MUD), and [The MUD Coders Guild](http://signup.mudcommunity.com/) to get acquainted (and meet some uncomfortably enthusiastic people in the process).
12+
13+
- Make sure you have a [GitHub account](https://github.com/signup/free).
14+
- For issues or feature requests, submit an issue on GitHub (assuming one does not already exist).
15+
- Clearly describe the issue including steps to reproduce when it is a bug.
16+
- Make sure you fill in the earliest version that you know has the issue.
17+
- Fork the repository on GitHub.
18+
19+
## Making Changes
20+
21+
- Create a feature branch from where you want to base your work.
22+
- This is usually the `develop` branch.
23+
- Only target release branches if you are certain your fix must be on that branch.
24+
- Please avoid working directly on `develop` branch.
25+
- Make commits of logical units.
26+
- Make sure your commit messages are clear and concise.
27+
- Make sure you have added the necessary tests for your changes.
28+
- Run _all_ the tests to assure nothing else was accidentally broken.
29+
30+
## Submitting Changes
31+
32+
- Push your changes to a feature branch in your fork of the repository.
33+
- Submit a pull request to the repository. Be sure to include references to any GitHub issues related to the change.
34+
- After feedback has been given we expect responses within two weeks. After two weeks the pull request may be closed if it isn't showing any activity.

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.vagrant
2+
guildmud
3+
.vscode/tasks.json
4+
*.log
5+
.vscode/settings.json
6+
*.run
7+
Info.plist
8+
/tags
9+
/.vimrc
10+
/target
11+
**/*.rs.bk

Cargo.lock

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "guildmud-rs"
3+
version = "0.0.1"
4+
authors = ["Justin Seabrook-Rocha <[email protected]>"]
5+
edition = "2018"
6+
7+
[dependencies]

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 The MUD Coders Guild
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# GuildMUD-rs
2+
3+
GuildMUD-rs is a Rust port of a SocketMUD-based Multi-User Dungeon built and managed by the members of [The MUD Coders Guild](https://mudcoders.com/).
4+
5+
## Development
6+
7+
The GuildMUD development environment runs on a VirtualBox virtual machine that is managed using Vagrant. Additionally, the following packages and tools are required to properly run this application:
8+
9+
- [Vagrant](https://www.vagrantup.com/) - Development Environment Orchestration
10+
- [VirtualBox](https://www.virtualbox.org/) - Virtualization Platform
11+
12+
### Development Environment
13+
14+
While it is recommended to familiarize yourself with basic [Vagrant command syntax](https://www.vagrantup.com/docs/cli/), with the two dependencies above installed, spinning up the GuildMUD development environment is as simple as running one command:
15+
16+
`vagrant up`
17+
18+
This command will perform a host of automated tasks to get a development environment up and running:
19+
20+
- Power up the virtual machine
21+
- Add `guildmud.dev` to the host machine's hosts file
22+
- Install any necessary dependencies within the virtual machine (Make, GCC, GDB, Valgrind, etc)
23+
24+
Once the Vagrant box has booted, the virtual machine can be logged into using the `vagrant ssh` command, and the game server (when running) can be accessed at `telnet://guildmud.dev:9009`.
25+
26+
When you are finished coding, the `vagrant halt` command will shut the virtual machine completely down, while `vagrant suspend` will merely pause it for later. Running `vagrant up` will bring it back up again.
27+
28+
**Note: If for whatever reason the development environment isn't working as expected, you can re-provision it with the `vagrant provision` command, or you can burn it down and start over using `vagrant destroy` followed by `vagrant up`.
29+
30+
#### MacOS development environment
31+
32+
For macOS there's no need to setup vagrant, and having macOS Xcode installed including the Command Line tools plus some brew packages is enough.
33+
34+
The easiest way to install XCode with the Command Line Tools is, at the command line term:
35+
36+
`$ xcode-select --install`
37+
38+
once this is done, proceed to install [brew](https://brew.sh/) (if not installed)
39+
40+
and install the Rust via your preferred method. We suggest using [rustup.rs](https://rustup.rs).
41+
42+
### Compiling GuildMUD-rs
43+
44+
To compile and start GuildMUD-rs, first log into the development machine using the `vagrant ssh` command. Then, simply run the `cargo build` command to compile the `guildmud-rs` binary.
45+
46+
### Launching GuildMUD-rs
47+
48+
After compiling GuildMUD-rs, the server can be launched by using the `cargo run` command. This is a long running process, so to shut down the server simply press `Ctrl+C` or close the terminal window.
49+
50+
With the GuildMUD-rs server running, you can connect to it from any standard MUD client from the host server at `guildmud.dev:9009`.
51+
52+
## Contributing
53+
54+
If you would like to contribute to GuildMUD-rs, please review the [CONTRIBUTOR](.github/CONTRIBUTING.md) guidelines.
55+
56+
## License
57+
58+
GuildMUD-rs is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

data/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

doc/LICENCE

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SocketMUD(tm) is released under Public Domain. Parts of the code was
2+
written by Erwin Andreasen (http://www.andreasen.org/), and even though
3+
the code written by Erwin is also public domain, it would be nice if any
4+
user of this codebase would keep the credits for Erwin. The copyover and
5+
buffer code is inspired, converted and sometimes copy/pasted from the code
6+
found on his website.
7+
8+
The MUD has support for the mud compression protocol (MCCP), and thus
9+
contains the mccp.c file by Oliver Jowett. The only restrictions enforced
10+
by this, is that the mccp.c file contains the original header (as stated
11+
in the header file).
12+
13+
The are no restrictions of any kind on the rest of SocketMUD(tm).

doc/README

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
SocketMud version 2.4
2+
3+
Little mud project, which has a command interpreter and supports
4+
ANSI colors... has a nifty little help file system, and a few
5+
commands (say, quit, who, etc). Also supports MCCP version 1 and 2.
6+
7+
Simply type 'make' in the ../src/ directory, and start the mud
8+
by typing './SocketMud &'. You can now connect by telnetting
9+
to port 9009 on localhost (or whatever machine it runs on).
10+
11+
Thanks goes to the community of coders that have helped with bugfixes,
12+
typos, ideas and improvements on the codebase.
13+
14+
ANSI C
15+
======
16+
For those wanting the code to compile with the -ansi flag (for ANSI C
17+
compliance), I have made sure that almost the entire codebase works
18+
out of the box - there are only three functions giving problems. These
19+
are the isascii() macro, the gethostbyaddr_r() function and the
20+
vsnprintf() function call. The first macro is easy enough to fix, simply
21+
add something like this to mud.h
22+
23+
#define isascii(c) (((c) & ~0x7f) == 0)
24+
25+
The call to gethostbyaddr_r() will probably be the worst part. The only
26+
real solution I see, is to remove the threaded calls for DNS lookups,
27+
and simple live with using gethostbyaddr() calls.
28+
29+
The vsnprintf() call can simply be replaced by vsprintf(), though you
30+
will then risk writing beyond the end of the buffer.
31+
32+
Code and all that by
33+
34+
Brian Graversen ([email protected])

doc/VERSION

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
This is version 2.3 of SocketMUD(tm).
2+
3+
01 Aug 2001 - SocketMUD(tm) v 0.1
4+
=================================
5+
The very first release of SocketMUD(tm). This is the only version of
6+
SocketMUD(tm) for which the code no longer exists.
7+
8+
09 Mar 2002 - SocketMUD(tm) v 1.0
9+
=================================
10+
Bugfixes in get_time() and new_socket() and various cleanups in the
11+
code which allows us to use the -pedantic compile flag.
12+
13+
26 Feb 2003 - SocketMUD(tm) v 1.1
14+
=================================
15+
Bugfixes for cmd_linkdead(), new version of text_to_buffer(). The log()
16+
and bug() functions where recoded. And copyover/mccp should be more sane.
17+
18+
22 Mar 2003 - SocketMUD(tm) v 1.2
19+
=================================
20+
Removed the unused save_whois() function, compressEnd() handles
21+
compression more sane (had a problem with mccp v1 & v2 at the same
22+
time). This is the first version of SocketMUD(tm) that uses game
23+
pulses.
24+
25+
02 Apr 2003 - SocketMUD(tm) v 1.3
26+
=================================
27+
Passwords can no longer contain invalid characters (ie. characters that
28+
are encrypted to ~, messing with the load/save functions). Also in
29+
compressEnd() we no longer flush residual data to prevent gargage output.
30+
31+
01 May 2003 - SocketMUD(tm) v 1.4
32+
=================================
33+
Renamed log() was renamed to log_string() to avoid conflict with the
34+
math library. Fixed a crashbug in load_helps. Added add_help() which
35+
sorts loaded helpfiles (this is later removed - a new sorting function
36+
is a pending feature).
37+
38+
06 Sep 2003 - SocketMUD(tm) v 1.5
39+
=================================
40+
Removed the capitalization of the first letter in communicate(). A bug
41+
in load_helps() was fixed as well as a related bug in read_help_entry().
42+
43+
02 Oct 2003 - SocketMUD(tm) v 1.6
44+
=================================
45+
Fixed a memory leak in the SREAD() macro.
46+
47+
07 Jan 2004 - SocketMUD(tm) v 1.7
48+
=================================
49+
Better copyover "checking" in main(), fixed spelling in mud.h and redid
50+
how helpfiles are loaded (we now load all files in the help directory).
51+
As a sideeffect, helpfiles can be added (while the game is running) simply
52+
by adding a new file in the help directory, and changing a helpfile will
53+
directly change the help in the running MUD :)
54+
55+
11 Jan 2004 - SocketMUD(tm) v 1.8
56+
=================================
57+
Fixed current_time (it was never updated), fixed a comment in update.c.
58+
Simple codechange from getdtablesize() to the FD_SETSIZE macro, which
59+
should be more portable. Bugfix: fread_string() now replaces all \n's
60+
with \r\n (certain clients require this).
61+
62+
14 Jul 2004 - SocketMUD(tm) v 1.9
63+
=================================
64+
Fixed the comment for fread_string, and made changes to the Makefile
65+
which makes it easier to use the Cygwin patch. Switched from static
66+
clearing of structs to using bzero().
67+
68+
12 Dec 2004 - SocketMUD(tm) v 1.10
69+
==================================
70+
The comments for socket and thread states are now correct. Fixed the
71+
text_to_buffer() function. Bugfix: buffer_clear() now actually clears
72+
the buffer, preventing datableeding.
73+
74+
11 Sep 2005 - SocketMUD(tm) v 2.0
75+
=================================
76+
Ripped out the old "inline" linked lists, and replaced them with a generic
77+
linked list system. Also added a Stack datastructure, which is used to
78+
store our free-"lists". Made certain changes to the Makefil and ran the
79+
entire program through Valgrind, making sure we had no memory leaks.
80+
The event system is now a default part of the SocketMUD(tm) codebase.
81+
82+
The major changes from SocketMUD(tm) 1.10 to 2.0 makes it practically
83+
impossible to maintain a patchfile for upgrades from the 1.x versions to
84+
the 2.x versions (which is the major reason for upping the version
85+
number).
86+
87+
27 Nov 2005 - SocketMUD(tm) v 2.1
88+
=================================
89+
In strings.c, the function strdup() now allocates the
90+
correct amount of memory (len+1)
91+
92+
A potential memory leak in the linked lists has been
93+
fixed. If a list is _never_ iterated over (like local
94+
event lists), no cells in the list are ever free'd.
95+
In DetachFromList() we now check if there is an
96+
iterator over the list before we call InvalidateCell()
97+
and free the cell instead if there are no iterators.
98+
99+
08 Oct 2007 - SocketMUD(tm) v 2.2
100+
=================================
101+
A memory leak in event_isset_mobile() was found by Lobotomy, and another
102+
small security issue was also fixed in the help system.
103+
104+
The iterators used for the linked list system are no longer allocated and
105+
free'd using malloc/free calls, for improved performance.
106+
107+
22 Oct 2008 - SocketMUD(tm) v 2.3
108+
=================================
109+
Another year another release ;)
110+
111+
Christopher Schuler (Lobotomy) has been busy with bug reports, and this
112+
release removes some unused members in the event_data struct, fixes
113+
a buffer-size check in io.c and makes the copyover-check for arguments
114+
more robust against variable argument copyovers
115+
116+
14 Mar 2009 - SocketMUD(tm) v 2.4
117+
=================================
118+
Scott Dunlop was kind enough to point out a buffer overflow in the
119+
communicate function (exploitable through the say command), which has
120+
been fixed in this release. While I was at it, I also removed all use
121+
of the plain printf-family functions, and started using the safe
122+
versions of these functions (snprintf, etc).

help/ANSI

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
SocketMud(tm) supports ANSI colors, and you can access them by using the
2+
'#' character, followed by the colorkey from the table below.
3+
4+
Yellow #yy #YY#n
5+
Blue #bb #BB#n
6+
Green #gg #GG#n
7+
Red #rr #RR#n
8+
Cyan #cc #CC#n
9+
Purple #pp #PP#n
10+
Dark #dd #DD#n
11+
White #ww #WW#n
12+
13+
The 'n' key is the default SocketMud(tm) color, and the mudcolor will
14+
always revert to this color at the end of a string.

help/CREDITS

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SocketMUD(tm) was originally coded by Brian Graversen and improved upon by
2+
the various coders in the community that took the time to return useful
3+
feedback.
4+
5+
Thanks goes to Beej for his network guide, which got me started with
6+
network programming, and to Erwin Andreasen whose various small articles
7+
on MUD programming and useful bits of code has helped my over the time.
8+
9+
Thanks also goes to all the helpful people who have spend the time to help
10+
me improve on the original SocketMUD(tm) release.

help/GMCP

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
The intention of GMCP (and its predecessors such as ATCP) is to allow
2+
"out of band" information to be sent from the MUD server to the client, or
3+
the client to the server. In this context "out of band" means "invisible
4+
to the player". The messages are enclosed with Telnet escape sequences,
5+
and as such clients (that support these sequences) accept these messages
6+
but do not display them directly on the screen.
7+
8+
Thus, a server can send details like room numbers, available exits, player
9+
health and mana, changes to inventory and quests, and other details. This
10+
greatly simplifies client design, because instead of clients having to
11+
match and parse very specific textual elements (like "prompt" lines)
12+
which can be subject to change, or suppression, the client can instead
13+
interpret the GMCP data which should not change, even if the player
14+
alters their configuration.
15+
16+
It also allows clients to easily display some things (like chat messages,
17+
combat information) in separate windows, or panes of an existing window,
18+
without there being any ambiguity about what a particular message means.
19+

help/GREETING

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#n
2+
ssss ooooooooo cccccc kk kk eeeeeeeee tttttttttt
3+
ss ss oo oo cc cc kk kk eeeeeeeee tttttttttt
4+
ss oo oo cc kk kk ee tt
5+
sss oo oo cc kkkk eeeeeeeee tt
6+
ss oo oo cc kkkk eeeeeeeee tt
7+
ss oo oo cc kk kk ee tt
8+
ss ss oo oo cc cc kk kk eeeeeeeee tt
9+
sss ooooooooo cccccc kk kk eeeeeeeee tt
10+
11+
12+
mmm mmm uu uu ddddddd
13+
mm m m mm uu uu dd dd
14+
mm mmm mm uu uu dd dd
15+
mm m mm uu uu dd dd
16+
mm mm uu uu dd dd
17+
mm mm uu uu dd dd
18+
mm mm uuuuuuu ddddddd
19+

help/MCCP

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
The Mud Client Compression Protocol has the purpose of reducing the
2+
bandwidth usage of the mudserver, by using an MCCP-complient mudclient,
3+
the data send to you will be compressed by 80-85%, and thus not only
4+
reducing the amount of data processed by the server, but also greatly
5+
reduces the amount of data you need to download (i.e. less lag for you).
6+
7+
This MUD supports both versions 1 and 2 of the compression protocol,
8+
and any client supporting either of those version can be used to
9+
enable compression. Most clients enable compression automatically,
10+
but some require that you type 'compress'. The same command can also
11+
be used to disable compression.
12+
13+
MCCP was created by Oliver Jowett

0 commit comments

Comments
 (0)