Skip to content
Mostly experimental additions to the LambdaMOO-Stunt server, embarrassing mistakes and all.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
crypt
dependencies
docs
executables
files
test
yajl
.gitignore
.gitmodules
.indent.pro
GNUmakefile
Gemfile
Gemfile.lock
Makefile.in
Minimal.db
Test.db
acinclude.m4
aclocal.m4
ast.cc
ast.h
base64.cc
base64.h
bf_register.h
client_bsd.c
client_sysv.c
code_gen.cc
code_gen.h
collection.cc
collection.h
config.h.in
configure.ac
crypto.cc
crypto.h
db.h
db_file.cc
db_io.cc
db_io.h
db_objects.cc
db_private.h
db_properties.cc
db_tune.h
db_verbs.cc
decompile.cc
decompile.h
disassemble.cc
disassemble.h
eval_env.cc
eval_env.h
eval_vm.cc
eval_vm.h
exec.cc
exec.h
execute.cc
execute.h
extension-argon2.cc
extension-background.cc
extension-background.h
extension-pcre.cc
extension-pcre.h
extension-simplexnoise.cc
extension-simplexnoise.h
extension-spellcheck.cc
extension-sqlite.cc
extension-sqlite.h
extensions.cc
fileio.cc
fileio.h
functions.cc
functions.h
garbage.cc
garbage.h
http_parser.c
http_parser.h
install-sh
json.cc
json.h
keywords.gperf
keywords.h
linenoise.c
linenoise.h
list.cc
list.h
log.cc
log.h
map.cc
map.h
match.cc
match.h
my-ctype.h
my-fcntl.h
my-in.h
my-inet.h
my-ioctl.h
my-math.h
my-poll.h
my-signal.h
my-socket.h
my-stat.h
my-stdarg.h
my-stdio.h
my-stdlib.h
my-string.h
my-stropts.h
my-sys-time.h
my-time.h
my-tiuser.h
my-types.h
my-unistd.h
my-wait.h
name_lookup.cc
name_lookup.h
net_bsd_lcl.cc
net_bsd_tcp.cc
net_mp_fake.cc
net_mp_poll.cc
net_mp_selct.cc
net_mplex.cc
net_mplex.h
net_multi.cc
net_multi.h
net_proto.cc
net_proto.h
net_single.cc
net_sysv_lcl.cc
net_sysv_tcp.cc
net_tcp.cc
network.cc
network.h
numbers.cc
numbers.h
objects.cc
opcode.h
options.h
parse_cmd.cc
parse_cmd.h
parser.h
parser.y
pattern.cc
pattern.h
pcrs.c
pcrs.h
program.cc
program.h
property.cc
quota.cc
quota.h
random.h
regexpr.c
regexpr.h
restart
restart.sh
server.cc
server.h
sosemanuk.c
sosemanuk.h
storage.cc
storage.h
str_intern.cc
str_intern.h
streams.cc
streams.h
structures.h
sym_table.cc
sym_table.h
system.cc
system.h
t2hinit.pl
tasks.cc
tasks.h
test.yml
thpool.c
thpool.h
timers.cc
timers.h
tokens.h
unparse.cc
unparse.h
utils.cc
utils.h
verbs.cc
verbs.h
version.cc
version.h
version_opt_gen.pl
version_options.h
waif.cc
waif.h
xtrapbits.h

README.md

ToastStunt

ToastStunt is a fork of the LambdaMOO / Stunt server. It has a number of features that were found useful while developing Miriani and ChatMud, a mostly complete list of which can be found below.

Features

  • SQLite [functions: sqlite_open(), sqlite_close(), sqlite_handle(), sqlite_info(), sqlite_query(), sqlite_execute()]

  • Perl Compatible Regular Expressions (PCRE) [functions: pcre_match(), pcre_replace]

  • Simplex noise (implemented but never actually tested / used)

  • Argon2id hashing [functions: argon2(), argon2_verify()]

  • 32-bit and 64-bit versions ($maxint and $minint set automatically)

  • Waifs

    • Call :pre_destroy on waifs when they're destroyed
    • A WAIF type (so typeof(some_waif) == WAIF)
    • Waif dict patch (so waif[x] and waif[x] = y will call the :_index and :_set_index verbs on the waif)
    • '-w' command line option to convert existing databases with a different waif type to the new waif type
    • waif_stats (show how many instances of each class of waif exist, how many waifs are pending recycling, and how many waifs in total exist)
    • Parser recognition for waif properties (e.g. thing.:property)
  • Basic threading support:

    • background.cc (a library, of sorts, to make it easier to thread builtins)
    • Threaded sqlite_query and sqlite_execute functions
  • FileIO improvements:

    • Faster reading
    • Open as many files as you want, configurable with FILE_IO_MAX_FILES or $server_options.file_io_max_files
    • file_handles() (returns a list of open files)
    • file_grep() (search for a string in a file (kind of FUP in FIO, don't tell))
    • file_count_lines() (counts the number of lines in a file)
  • ANSI:

    • Parse_ansi() (parses color tags into their ANSI equivalents)
    • remove_ansi() (strips ANSI tags from strings)
  • Telnet:

    • Capture IAC commands and pass them to listener:do_out_of_band_command() for the database to handle.
  • Primitive types:

    • Support calling verbs on an object prototype ($obj_proto). Counterintuitively, this will only work for types of OBJ that are invalid. This can come in useful for un-logged-in connections (i.e. creating a set of convenient utilities for dealing with negative connections in-MOO).
  • Maps

    • maphaskey() (check if a key exists in a map. Looks nicer than !(x in mapkeys(map)) and is faster when not dealing with hundreds of keys)
  • Options.h configuration:

    • LOG_CODE_CHANGES (causes .program and set_verb_code to add a line to the server log indicating the object, verb, and programmer)
    • OWNERSHIP_QUOTA (disable the server's builtin quota management)
    • USE_ANCESTOR_CACHE (enable a cache of an object's ancestors to speed up property lookups)
    • UNSAFE_FIO (skip character by character line verification, trading off potential safety for speed)
    • LOG_EVALS (add an entry to the server log any time eval is called)
    • ONLY_32_BITS (switch from 64-bit integers back to 32-bit)
  • Additional builtins:

    • frandom (random floats)
    • distance (calculate the distance between an arbitrary number of points)
    • relative_heading (a relative bearing between two coordinate sets)
    • memory_usage (total memory used, resident set size, shared pages, text, data + stack)
    • ftime (precise time, including an argument for monotonic timing)
    • locate_by_name (quickly locate objects by their .name property)
    • usage (returns {load averages}, user time, system time, page reclaims, page faults, block input ops, block output ops, voluntary context switches, involuntary context switches, signals received)
    • explode (serverified version of the LambdaCore verb)
    • occupants (return a list of objects of parent parent, optionally with a player flag check)
    • spellcheck (uses Aspell to check spelling)
    • locations (recursive location function)
    • clear_ancestor_cache (clears the ancestor cache manually)
    • chr (return extended ASCII characters; characters that can corrupt your database are considered invalid)
  • Miscellaneous changes:

    • Numeric IP addresses in connection_name
    • Detect connections from TCP proxies using the HAProxy Proxy protocol and rewrite the source IP as appropriate (controllable with $server_options.proxy_rewrite)
    • .last_move (a map of an object's last location and the time() it moved)
    • Sub-second fork and suspend
    • Call 'do_blank_command' on listening objects when a blank command is issued
    • Allow "string" in "some other string" as a shortcut for index()
    • Allow exec to set environment variables with a new argument
    • Bandaid over an issue where emptylist loses all references and gets freed, causing a server panic
    • Change the server log message when calling switch_player()
    • Complete deprecation of tonum() in favor of toint()
    • Move #0.dump_interval to $server_options.dump_interval
    • Rename recycle() to destroy() (also call pre_destroy rather than recycle verbs)
    • New argument to notify() to suppress the newline
    • Support object lists in isa() as well as an optional third argument to return the matching parent rather than simply true or false.
    • New argument to move() to effectively listinsert() the object into the destination's .contents

Build Instructions

Debian/Ubuntu

apt install build-essential bison gperf autoconf libsqlite3-dev libaspell-dev libpcre3-dev nettle-dev g++
autoconf
./configure
make

REL/CentOS

yum group install -y "Development Tools"
yum install -y sqlite-devel pcre-devel aspell-devel nettle-devel gperf   centos-release-scl
yum install -y devtoolset-7
scl enable devtoolset-7 bash
autoconf
./configure
make
exit

Gentoo

emerge dev-db/sqlite app-text/aspell app-crypt/argon2
autoconf
./configure
make

Notes

Many distributions do not include Libargon2 which is required for Argon2id password hashing. As such, it has been included as a Git submodule in this repository. To build it yourself, follow these steps:

  1. Inside of the ToastStunt repository, checkout all available submodules: git submodule update --init
  2. cd dependencies/phc-winner-argon2
  3. Build the library: make
  4. Install it on your system: make install PREFIX=/usr

Support and Development

Realtime support and collaborative discussion for ToastStunt primarily takes place on the 'toaststunt' channel on ChatMUD. Barring this, the Miriani Message Boards are another good resource for assistance.

You can’t perform that action at this time.