13 Jul 2012 wainstead   » (Master)

A C++ version of Stunt is born

Compiling:


-*- mode: compilation; default-directory: "~/Sites/projects/moowork/stunt-swain/" -*-
Compilation started at Thu Jul 12 19:38:35

make
[ config.h : config.status ]
./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
g++ -m32 -O -DHAVE_CONFIG_H -c -o ast.o ast.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o base64.o base64.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o code_gen.o code_gen.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o collection.o collection.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o db_file.o db_file.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o db_io.o db_io.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o db_objects.o db_objects.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o db_properties.o db_properties.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o db_verbs.o db_verbs.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o decompile.o decompile.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o disassemble.o disassemble.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o eval_env.o eval_env.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o eval_vm.o eval_vm.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o exceptions.o exceptions.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o exec.o exec.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o execute.o execute.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o extension-fileio.o extension-fileio.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o extensions.o extensions.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o functions.o functions.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o hmac_sha2.o hmac_sha2.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o http_parser.o http_parser.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o json.o json.c
bison -y -d parser.y
mv -f y.tab.c parser.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o parser.o parser.c
touch y.tab.h
g++ -m32 -O -DHAVE_CONFIG_H -c -o keywords.o keywords.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o list.o list.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o log.o log.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o map.o map.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o match.o match.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o md5.o md5.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o name_lookup.o name_lookup.c
touch net_single.o
touch net_multi.o
g++ -m32 -O -DHAVE_CONFIG_H -c -o network.o network.c
touch net_mp_selct.o
touch net_mp_poll.o
touch net_mp_fake.o
g++ -m32 -O -DHAVE_CONFIG_H -c -o net_mplex.o net_mplex.c
touch net_bsd_tcp.o
touch net_bsd_lcl.o
touch net_sysv_tcp.o
touch net_sysv_lcl.o
g++ -m32 -O -DHAVE_CONFIG_H -c -o net_proto.o net_proto.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o numbers.o numbers.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o objects.o objects.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o parse_cmd.o parse_cmd.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o pattern.o pattern.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o program.o program.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o property.o property.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o quota.o quota.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o regexpr.o regexpr.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o server.o server.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o sha1.o sha1.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o sha256.o sha256.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o storage.o storage.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o streams.o streams.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o str_intern.o str_intern.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o sym_table.o sym_table.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o tasks.o tasks.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o timers.o timers.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o unparse.o unparse.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o utils.o utils.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o verbs.o verbs.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o version.o version.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl.o yajl.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_alloc.o yajl_alloc.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_buf.o yajl_buf.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_encode.o yajl_encode.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_gen.o yajl_gen.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_lex.o yajl_lex.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_parser.o yajl_parser.c
g++ -m32 -O -DHAVE_CONFIG_H -c -o yajl_version.o yajl_version.c
g++ -m32 -O -DHAVE_CONFIG_H ast.o base64.o code_gen.o collection.o db_file.o db_io.o
db_objects.o db_properties.o db_verbs.o decompile.o disassemble.o eval_env.o
eval_vm.o exceptions.o exec.o execute.o extension-fileio.o extensions.o functions.o
hmac_sha2.o http_parser.o json.o keywords.o list.o log.o map.o match.o md5.o
name_lookup.o network.o net_mplex.o net_proto.o numbers.o objects.o parse_cmd.o
pattern.o program.o property.o quota.o regexpr.o server.o sha1.o sha256.o storage.o
streams.o str_intern.o sym_table.o tasks.o timers.o unparse.o utils.o verbs.o
version.o yajl.o yajl_alloc.o yajl_buf.o yajl_encode.o yajl_gen.o yajl_lex.o
yajl_parser.o yajl_version.o parser.o -lexpat -o moo
rm parser.c

Compilation finished at Thu Jul 12 19:38:51
Running:

bash-3.2$ ./moo Stunt.db Stunt.db.new
Jul 12 19:46:36: CMDLINE: Outbound network connections enabled.
Jul 12 19:46:36: STARTING: Version 1.8.3+?_ad_hoc_?? of the LambdaMOO server
Jul 12 19:46:36: (Using BSD/TCP protocol)
Jul 12 19:46:36: (Task timeouts measured in server CPU seconds.)
Jul 12 19:46:36: (Process id 39697)
Jul 12 19:46:36: LOADING: Stunt.db
Jul 12 19:46:36: LOADING: Reading 11 objects ...
Jul 12 19:46:36: LOADING: Done reading 11 objects ...
Jul 12 19:46:36: VALIDATING the object hierarchies ...
Jul 12 19:46:36: VALIDATE: Phase 1: Check for invalid objects ...
Jul 12 19:46:36: VALIDATE: Phase 2: Check for cycles ...
Jul 12 19:46:36: VALIDATE: Phase 3: Check for inconsistencies ...
Jul 12 19:46:36: VALIDATING the object hierarchies ... finished.
Jul 12 19:46:36: LOADING: Reading 94 MOO verb programs ...
Jul 12 19:46:36: NAME_LOOKUP: Started new lookup process
Jul 12 19:46:36: LOADING: Done reading 94 verb programs ...
Jul 12 19:46:36: LOADING: Reading forked and suspended tasks ...
Jul 12 19:46:36: LOADING: Reading list of formerly active connections ...
Jul 12 19:46:36: LOADING: Stunt.db done, will dump new database on Stunt.db.new
Jul 12 19:46:36: INTERN: 770 allocations saved, 9815 bytes
Jul 12 19:46:36: INTERN: at end, 750 entries in a 10007 bucket hash table.
Jul 12 19:46:36: Loaded protect cache for 177 builtin functions
Jul 12 19:46:36: LISTEN: #0 now listening on port 7777
Jul 12 19:46:36: > WARNING: Log-in via passkey is enabled for the following players
(specified in $passkey_players):
Jul 12 19:46:36: > WARNING: "Wizard" (#5)
Jul 12 19:46:36: > WARNING: "Programmer" (#6)
Jul 12 19:46:36: > WARNING: This is a severe security vulnerability. In a secure
environment you should:
Jul 12 19:46:36: > WARNING: disable passkey login:
Jul 12 19:46:36: > WARNING: ; $disable_passkey_login = 1
Jul 12 19:46:36: > WARNING: ; $passkey_players = {}
Jul 12 19:46:36: > WARNING: disable existing passkeys:
Jul 12 19:46:36: > WARNING: ; #5.passkey = 0
Jul 12 19:46:36: > WARNING: ; #6.passkey = 0
Jul 12 19:46:36: > WARNING: and for good measure:
Jul 12 19:46:36: > WARNING: ; set_player_flag(#5, 0)
Jul 12 19:46:36: > WARNING: ; set_player_flag(#6, 0)
Jul 12 19:46:36: > PASSKEY for "Wizard" (#5): 14FC3656E763CB43C5E16F4CE9A9B77EE742629677A29048C44423C640A59442 (keep it secret)
Jul 12 19:46:36: > PASSKEY for "Programmer" (#6): 2B3BE77D36447234AE5AEBB920FC1E3F7B0FDAB8D4169A3FED23C57C0753C398 (keep it secret)
Jul 12 19:46:54: ACCEPT: #-2 on port 7777 from localhost, port 56831
Jul 12 19:47:11: CONNECTED: Wizard (#5) on port 7777 from localhost, port 56831
And connecting:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Welcome to Stunt! For information about Stunt, check out http://stunt.io/. To
connect to the server, type "connect ".
connect 14FC3656E763CB43C5E16F4CE9A9B77EE742629677A29048C44423C640A59442
*** Connected ***
In truth, there's one more file that needs modification: exec.c, which uses goto as it was meant to be used but g++ doesn't like it. But that's a small obstacle to overcome.

UPDATE! Todd sent me a patch for exec.c. I've applied, compiled, tested, committed and pushed it.

Syndicated 2012-07-13 03:49:00 (Updated 2012-07-14 03:14:00) from Wainstead

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!