关于运行时配置文件的参数与相关函数(efun)

我们知道,MUD游戏需要驱动运行,如:driver config.ini ,这里config.ini就是游戏的运行时配置文件,在游戏驱动启动流程详解有相关介绍,这里进一步介绍下一配置文件的参数及相关的efun和apply。

先说明一下,运行时配置文件是MUDLIB必须的,但有一些开源的LIB又没有自带配置,这个就可以我们自己配置,因为配置文件的配置项是固定的,只是根据LIB修改参数的值。另外配置文件的文件名也是随意的,只是个人推荐使用.ini.cfg做扩展名,因为这二种扩展名用notepad++或vscode编辑器打开会自动识别格式,注释和配置不同颜色显示,方便编辑修改。

配置文件:https://gitee.com/mudren/lpmud-driver

MUDOS及FluffOS v2017的运行时配置文件

完整配置

###############################################################################
#                Customizable runtime config file for FluffOS                 #
###############################################################################
# NOTE: All paths specified here are relative to the mudlib directory except  #
#       for mudlib directory, and binary directory.                           #
# Lines beginning with a # or a newline are ignored.                          #
###############################################################################

# name of this mud
name : LPC-TEST

# for machines with multiple IP addresses, this specifies which one to use.  this
# replaces the SERVER_IP compile-time define.
# mud ip : 0.0.0.0

# port number to accept users on
port number : 5555

# the external ports we support
# external_port_1 : binary 3166
# external_port_2 : telnet 5555
# external_port_3 : telnet 6666

# absolute pathname of mudlib
mudlib directory : .

# absolute pathname of driver/config dir
binary directory : .

###############################################################################
# You shouldn't change anything below this point unless you know what         #
# you're changing.... =)                                                      #
###############################################################################

# debug.log and author/domain stats are stored here
log directory : /log

# the directories which are searched by #include <...>
# for multiple dirs, separate each path with a ':'
include directories : /include

# the file which defines the master object
master file : /system/kernel/master

# the file where all global simulated efuns are defined.
simulated efun file : /system/kernel/simul_efun

# file to swap out objects; not used if time to swap is 0
swap file : /swapfile

# alternate debug.log file name (assumed to be in specified 'log directory')
debug log file : debug.log

# The global include file is included automatically.
global include file : <globals.h>

# default no-matching-action message
default fail message : 什么?

# default message when error() occurs (optional)
default error message : [1;33m你发现事情不大对了,但是又说不上来。[2;37;0m

# if an object is left alone for a certain time, then the
# function clean_up will be called. This function can do anything,
# like destructing the object. If the function isn't defined by the
# object, then nothing will happen.
# This time should be substantially longer than the swapping time.
time to clean up : 900

# How many seconds until an object is reset again.
# This value should be somewhere reasonable in between 'time to clean up' and
# 'time to swap'.
time to reset : 600

# How long time until an unused object is swapped out.
# Machine with too many players and too little memory: 900 (15 minutes)
# Machine with few players and lot of memory: 10000
# Machine with infinite memory: 0 (never swap).
time to swap : 300

# Define the size of the compiler stack. This defines how complex
# expressions the compiler can parse.  (unused currently)
# compiler stack size : 600

# Define the maximum stack size of the stack machine. This stack will also
# contain all local variables and arguments.
# evaluator stack size : 6000

# Max inherit chain size
inherit chain size : 30

# Maximum amount of "eval cost" per thread - execution is halted when
# it is exceeded.
maximum evaluation cost : 80008000

# Max number of local variables in a function.
# maximum local variables : 50

# Set the maximum call depth for functions.
# maximum call depth : 150

# This is the maximum array size allowed for one single array.
maximum array size : 15000

# This is the maximum allowed size of a variable of type 'buffer'.
maximum buffer size : 400000

# Max size for a mapping
maximum mapping size : 150000

# maximum length of a string variable
maximum string length : 200000

# Maximum number of bits in a bit field. They are stored in printable
# strings, 6 bits per byte.
maximum bits in a bitfield : 12000

# max number of bytes you allow to be read and written with read_bytes
# and write_bytes
maximum byte transfer : 200000

# Max size of a file allowed to be read by 'read_file()'.
maximum read file size : 200000

# Define the size of the shared string hash table.  This number should
# a prime, probably between 1000 and 30000; if you set it to about 1/5
# of the number of distinct strings you have, you will get a hit ratio
# (number of comparisons to find a string) very close to 1, as found strings
# are automatically moved to the head of a hash chain.  You will never
# need more, and you will still get good results with a smaller table.
hash table size : 7001

# Object hash table size.
# Define this like you did with the strings; probably set to about 1/4 of
# the number of objects in a game, as the distribution of accesses to
# objects is somewhat more uniform than that of strings.
object table size : 1501

# There is a hash table for living objects, used by find_living().
# This must be one of 4, 16, 64, 256, 1024, 4096
# living hash table size : 256

# Set the granularity of game-time (shortest time interval visible ingame)
# gametick msec : 1000

# Set heartbeat interval in milliseconds (ms).
# heartbeat interval msec : 1000

# explode():
#
# The old behavior (#undef both of the below) strips any number of delimiters
# at the start of the string, and one at the end.  So explode("..x.y..z..",
# ".") gives ({ "x", "y", "", "z", "" })
#
# sane explode string strips off at most one leading delimiter, and still
# strips off one at the end, so the example above gives
# ({ "", "x", "y", "", "z", "" }).
#
# reversible explode string overrides SANE_EXPLODE_STRING, and makes it so
# that implode(explode(x, y), y) is always x; i.e. no delimiters are ever
# stripped.  So the example above gives
# ({ "", "", "x", "y", "", "z", "", "" }).
# sane explode string : 1
# reversible explode string : 0

# SANE_SORTING: Use system provided fastest sorting routine for various
# sorting, including sort_array EFUN.
#
# This replace the old internal version qsort which only sorts to one
# direction repetitively. so following LPC code:
#
#    sort_array(({4,3,2,1}), (: -($1<$2) :));
#
# can still return ({1,2,3,4}), even though it only returns -1 and 0.
#
# It is recommended to fix your LPC code to not rely on this behavior.
#
# Your LPC code should return 1, 0, -1 for situation where first argument
# is less than, equal to, or greater than the second argument. This will
# will work with both implementation.
#
# Old code should work fine with this added, easy to inspect by searching
# for sort_array.
# sane sorting : 1

# WARN_TAB: Some versions of the editor built in indent function use tabs for
# indenting. This options turns on a warning message for files indented with
# tabs instead of spaces.
# warn tab : 0

# WOMBLES: Don't allow spaces between start/end of array/mapping/functional token
# chars so ({1,2,3}) still works, but ( { 1 , 2 , 3 } ) doesn't and
# ({ 1 , 2 , 3 }) does.
# wombles : 0

# Enable type checking for call_other() (-> operator on objects)
# call other type check : 0

# Make it warning instead of errors
# call other warn : 0

# If you set this, the driver doesn't do any handling of runtime errors,
# other than to turn the heartbeats of objects off.  Information about the
# error is passed in a mapping to the error_handler() function in the master
# object.  Whatever is returned is put in the debug.log.
#
# A good mudlib error handler is one of the best tools for tracking down
# errors.  Unfortunately, you need to have one.  Check the testsuite or other
# libs for an example.
# mudlib error handler : 1

# NO_RESETS: Completely disable the periodic calling of reset()
# no resets : 0

# LAZY_RESETS: If this option is set, an object will only have reset() called in it when
# it is touched via call_other() or move_object() (assuming enough time has
# passed since the last reset).  If it is unset, then reset() will be called
# as always (which guaranteed that reset would always be called at least
# once).  The advantage of lazy resets is that reset doesn't get called in an
# object that is touched once and never again (which can save memory since
# some objects won't get reloaded that otherwise would).
# lazy resets : 0

# RANDOMIZED_RESETS: if this is defined, the reset() will be called in
# randomized time interval. The interval vary from TIME_TO_RESET/2 to TIME_TO_RESET-1 .
# if this is undefined, the reset() will be called among all objects at the
# same time, with the interval as TIME_TO_RESET
# randomized resets : 1

# NO_ANSI: Set if you wish to disallow users from typing in commands that contain ANSI
# escape sequences.  Setting NO_ANSI causes all escapes (ASCII 27) to be
# replaced with a space ' ' before the string is passed to the action
# routines added with add_action.
# no ansi : 1

# STRIP_BEFORE_PROCESS_INPUT allows the location where the stripping is
# done to be controlled.  If it is defined, then process_input() doesn't
# see ANSI characters either; if it is undefined ESC chars can be processed
# by process_input(), but are stripped before add_actions are called.
# Note that if NO_ADD_ACTION is defined, then #define NO_ANSI without
# #define STRIP_BEFORE_PROCESS_INPUT is the same as #undef NO_ANSI.
#
# If you anticipate problems with users intentionally typing in ANSI codes to
# make your terminal flash, etc set this.
# strip before process input : 1

# THIS_PLAYER_IN_CALL_OUT: Set this if you wish this_player() to be usable from within call_out()
# callbacks.
# this player in call_out : 1

# TRACE: Set this to enable the trace() and traceprefix() efuns.  (keeping this
# unset will cause the driver to run faster).
# trace : 1

# TRACE_CODE: Set this to enable code tracing (the driver will print out the previous
# lines of code to an error) eval_instruction() runs about twice as fast when
# this is not set (for the most common eoperators).
# trace code : 0

# INTERACTIVE_CATCH_TELL: Set this if you want catch_tell called on interactives
# as well as NPCs. If this is set, the user object will need a catch_tell(msg)
# method that calls receive(msg);
# interactive catch tell : 0

# RECEIVE_SNOOP: Set this if you want snoop text to be sent to the receive_snoop() function
# in the snooper object (instead of being sent directly via add_message()).
# This is useful if you want to build a smart client that does something
# different with snoop messages.
# receive snoop : 1

# SNOOP_SHADOWED: Set this if you want snoop to report what is sent to the player even
# in the event that the player's catch_tell() is shadowed and the player may not be
# seeing what is being sent.  Messages of this sort will be prefixed with $$.
# snoop shadowed : 0

# REVERSE_DEFER:
# If not defined executes defer functions in LIFO mode.
# If defined executes defer functions in FIFO mode.
# reverse defer : 0

# HAS_CONSOLE: If defined, the driver can take the argument -C
# which will give the driver an interactive console (you can type
# commands at the terminal.)  Backgrounding the driver will turn off
# the console, but sending signal SIGTTIN (kill -21) to the driver can
# turn it back on.  Typing 'help' will display commands available.
# The intent is to allow the inspection of things that are difficult
# to inspect from inside the mud.
# has console : 1

# NONINTERACTIVE_STDERR_WRITE: if defined, all writes/tells/etc to
# noninteractive objects will be written to stderr prefixed with a ']'
# (old behavior).
# Compat status: Easy to support, and also on the "It's a bug!  No, it's
# a feature!" religious war list.
# noninteractive stderr write : 1

# Set this if you want FluffOS to call crash() in master.c and then shutdown
# when signals are received that would normally crash the driver.
# trap crashes : 1

# OLD_TYPE_BEHAVIOR: reintroduces a bug in type-checking that effectively
# renders compile time type checking useless.  For backwards compatibility.
# Compat status: dealing with all the resulting compile errors can be
# a huge pain even if they are correct, and the impact on the code is
# small.
# old type behavior : 0

# OLD_RANGE_BEHAVIOR: define this if you want negative indexes in string
# or buffer range values (not lvalue, i.e. x[-2..-1]; for e.g. not
# x[-2..-1] = foo, the latter is always illegal) to mean counting from the
# end
# Compat status: Not horribly difficult to replace reliance on this, but not
# trivial, and cannot be simulated.
# old range behavior : 0

# define to get a warning for code that might use the old range behavior
# when you're not actually using the old range behavior
# warn old range behavior : 1

# suppress warnings about unused arguments; only warn about unused local
# variables.  Makes older code (where argument names were required) compile
# more quietly.
# suppress argument warnings : 1

# add_action: Make enable_commands() always re-call init(). same as
# calling enable_commands(1).
# enable_commands call init : 1

# sprintf: Make format like "%10s" ignore ANSI escape code length, as they
# are not visible in the client.
# sprintf add_justified ignore ANSI colors : 1

# call_out(0) loop prvention:
# This is the number of call_out(.., 0) call can be scheduled on the same
# gametick.
# call_out(0) next level : 1000

###############################################################################
#          The following aren't currently used or implemented (yet)           #
###############################################################################

# maximum number of users in the game (unused currently)
# maximum users : 256

# the address server is an external program that lets the mud translate
# internet names to numbers (and vice versa).  select an unused port.
# address server ip : localhost
# address server port : 3990

# Directory to save binaries in.  (if BINARIES is defined)
save binaries directory : /binaries

# Reserve an extra memory area from malloc(), to free when we run out
# of memory; so begins Armageddon.
# If this value is 0, no area will be reserved.
# reserved size : 10000

# Defines the number of bits to use in the call_other cache (in interpret.c).
#
# Memory overhead is (1 << APPLY_CACHE_BITS)*16.
# [assuming 32 bit pointers and 16 bit shorts]
#
# ACB:     entries:     overhead:
#   6           64            1k
#   8          256            4k
#  10        1,024           16k
#  12        4,096           64k
#  14       16,384          256k
#  16       65,536            1M
#  20    1,048,576           16M
#  22    4,194,304           64M
# apply cache bits : 22

精简配置

# fluffos v2017 运行时配置文件
name : MiniMud
port number : 4001
mudlib directory : .
binary directory : .
log directory : /log
include directories : /include
global include file : <globals.h>
master file : /system/kernel/master
simulated efun file : /system/kernel/simul_efun
debug log file : debug.log
swap file : /tmp/swapfile

FluffOS v2019的运行时配置文件

完整配置

###############################################################################
#                Customizable runtime config file for FluffOS                 #
###############################################################################
# NOTE: All paths specified here are relative to the mudlib directory except  #
#       for mudlib directory, and binary directory.                           #
# Lines beginning with a # or a newline are ignored.                          #
###############################################################################

# name of this mud
name : 炎黃群俠傳

# for machines with multiple IP addresses, this specifies which one to use.  this
# replaces the SERVER_IP compile-time define.
# mud ip : 0.0.0.0

# port number to accept users on
# port number : 3160

# the external ports we support(telnet/binary/ascii/MUD/websocket)
external_port_1 : telnet 5566
external_port_2 : telnet 6666
# external_port_2_tls : cert=cert.crt key=cert.key
external_port_3 : websocket 8888
# external_port_3_tls : cert=cert.crt key=cert.key
# external_port_4 : binary 4000
# external_port_5 : ascii 4001

# absolute pathname of mudlib
mudlib directory : .

# pathname of websocket http dir
websocket http dir : www

# External commands(100 external cmds are supported)
external_cmd_1 : /usr/bin/curl
external_cmd_2 : C:\ProgramData\chocolatey\bin\curl.exe

###############################################################################
# You shouldn't change anything below this point unless you know what         #
# you're changing.... =)                                                      #
###############################################################################

# debug.log and author/domain stats are stored here
log directory : /log

# the directories which are searched by #include <...>
# for multiple dirs, separate each path with a ':'
include directories : /include:/mudcore/include

# the file which defines the master object
master file : /adm/single/master

# the file where all global simulated efuns are defined.
simulated efun file : /adm/single/simul_efun

# alternate debug.log file name (assumed to be in specified 'log directory')
debug log file : debug.log

# The global include file is included automatically.
global include file : <globals.h>

# default no-matching-action message
default fail message : [35m指令错误,请输入 help 查看游戏帮助。[0m

# default message when error() occurs (optional)
default error message : [31m你发现事情不大对了,但是又说不上来。[0m

##############################################################
#               ==== Runtime Config Table ====               #
##############################################################

# if an object is left alone for a certain time, then the
# function clean_up will be called. This function can do anything,
# like destructing the object. If the function isn't defined by the
# object, then nothing will happen.
# This time should be substantially longer than the swapping time.
# time to clean up : 600

# How many seconds until an object is reset again.
# This value should be somewhere reasonable in between 'time to clean up' and
# 'time to swap'.
# time to reset : 900

# How long time until an unused object is swapped out.
# Machine with too many players and too little memory: 900 (15 minutes)
# Machine with few players and lot of memory: 10000
# Machine with infinite memory: 0 (never swap).
# time to swap : 300

# Define the maximum stack size of the stack machine. This stack will also
# contain all local variables and arguments.
# evaluator stack size : 65536

# Max inherit chain size
# inherit chain size : 30

# Maximum amount of "eval cost" per thread - execution is halted when
# it is exceeded.
# maximum evaluation cost : 30000000

# Max number of local variables in a function.
# maximum local variables : 64

# Set the maximum call depth for functions.
# maximum call depth : 150

# This is the maximum array size allowed for one single array.
maximum array size : 30000

# This is the maximum allowed size of a variable of type 'buffer'.
# maximum buffer size : 1048576

# Max size for a mapping
# maximum mapping size : 150000

# maximum length of a string variable
# maximum string length : 1048576

# Maximum number of bits in a bit field. They are stored in printable
# strings, 6 bits per byte.
# maximum bits in a bitfield : 12000

# max number of bytes you allow to be read and written with read_bytes
# and write_bytes
# maximum byte transfer : 262144

# Max size of a file allowed to be read by 'read_file()'.
# maximum read file size : 262144

# Define the size of the shared string hash table.  This number should
# a prime, probably between 1000 and 30000; if you set it to about 1/5
# of the number of distinct strings you have, you will get a hit ratio
# (number of comparisons to find a string) very close to 1, as found strings
# are automatically moved to the head of a hash chain.  You will never
# need more, and you will still get good results with a smaller table.
# hash table size : 65536

# Object hash table size.
# Define this like you did with the strings; probably set to about 1/4 of
# the number of objects in a game, as the distribution of accesses to
# objects is somewhat more uniform than that of strings.
# object table size : 4096

# There is a hash table for living objects, used by find_living().
# This must be one of 4, 16, 64, 256, 1024, 4096
living hash table size : 2048

# Define the size of the compiler stack. This defines how complex
# expressions the compiler can parse.  (unused currently)
# compiler stack size : 600

# Set the granularity of game-time (shortest time interval visible ingame)
# gametick msec : 1000

# Set heartbeat interval in milliseconds (ms).
# heartbeat interval msec : 1000

# explode():
#
# The old behavior (#undef both of the below) strips any number of delimiters
# at the start of the string, and one at the end.  So explode("..x.y..z..",
# ".") gives ({ "x", "y", "", "z", "" })
#
# sane explode string strips off at most one leading delimiter, and still
# strips off one at the end, so the example above gives
# ({ "", "x", "y", "", "z", "" }).
#
# reversible explode string overrides SANE_EXPLODE_STRING, and makes it so
# that implode(explode(x, y), y) is always x; i.e. no delimiters are ever
# stripped.  So the example above gives
# ({ "", "", "x", "y", "", "z", "", "" }).
# sane explode string : 1
# reversible explode string : 0

# SANE_SORTING: Use system provided fastest sorting routine for various
# sorting, including sort_array EFUN.
#
# This replace the old internal version qsort which only sorts to one
# direction repetitively. so following LPC code:
#
#    sort_array(({4,3,2,1}), (: -($1<$2) :));
#
# can still return ({1,2,3,4}), even though it only returns -1 and 0.
#
# It is recommended to fix your LPC code to not rely on this behavior.
#
# Your LPC code should return 1, 0, -1 for situation where first argument
# is less than, equal to, or greater than the second argument. This will
# will work with both implementation.
#
# Old code should work fine with this added, easy to inspect by searching
# for sort_array.
# sane sorting : 1

# WARN_TAB: Some versions of the editor built in indent function use tabs for
# indenting. This options turns on a warning message for files indented with
# tabs instead of spaces.
warn tab : 1

# WOMBLES: Don't allow spaces between start/end of array/mapping/functional token
# chars so ({1,2,3}) still works, but ( { 1 , 2 , 3 } ) doesn't and
# ({ 1 , 2 , 3 }) does.
# wombles : 0

# Enable type checking for call_other() (-> operator on objects)
# call other type check : 0

# Make it warning instead of errors
# call other warn : 0

# If you set this, the driver doesn't do any handling of runtime errors,
# other than to turn the heartbeats of objects off.  Information about the
# error is passed in a mapping to the error_handler() function in the master
# object.  Whatever is returned is put in the debug.log.
#
# A good mudlib error handler is one of the best tools for tracking down
# errors.  Unfortunately, you need to have one.  Check the testsuite or other
# libs for an example.
# mudlib error handler : 1

# NO_RESETS: Completely disable the periodic calling of reset()
# no resets : 0

# LAZY_RESETS: If this option is set, an object will only have reset() called in it when
# it is touched via call_other() or move_object() (assuming enough time has
# passed since the last reset).  If it is unset, then reset() will be called
# as always (which guaranteed that reset would always be called at least
# once).  The advantage of lazy resets is that reset doesn't get called in an
# object that is touched once and never again (which can save memory since
# some objects won't get reloaded that otherwise would).
# lazy resets : 0

# RANDOMIZED_RESETS: if this is defined, the reset() will be called in
# randomized time interval. The interval vary from TIME_TO_RESET/2 to TIME_TO_RESET-1 .
# if this is undefined, the reset() will be called among all objects at the
# same time, with the interval as TIME_TO_RESET
# randomized resets : 1

# NO_ANSI: Set if you wish to disallow users from typing in commands that contain ANSI
# escape sequences.  Setting NO_ANSI causes all escapes (ASCII 27) to be
# replaced with a space ' ' before the string is passed to the action
# routines added with add_action.
# no ansi : 1

# STRIP_BEFORE_PROCESS_INPUT allows the location where the stripping is
# done to be controlled.  If it is defined, then process_input() doesn't
# see ANSI characters either; if it is undefined ESC chars can be processed
# by process_input(), but are stripped before add_actions are called.
# Note that if NO_ADD_ACTION is defined, then #define NO_ANSI without
# #define STRIP_BEFORE_PROCESS_INPUT is the same as #undef NO_ANSI.
#
# If you anticipate problems with users intentionally typing in ANSI codes to
# make your terminal flash, etc set this.
# strip before process input : 1

# THIS_PLAYER_IN_CALL_OUT: Set this if you wish this_player() to be usable from within call_out()
# callbacks.
# this player in call_out : 1

# TRACE: Set this to enable the trace() and traceprefix() efuns.  (keeping this
# unset will cause the driver to run faster).
# trace : 1

# TRACE_CODE: Set this to enable code tracing (the driver will print out the previous
# lines of code to an error) eval_instruction() runs about twice as fast when
# this is not set (for the most common eoperators).
# trace code : 0

# INTERACTIVE_CATCH_TELL: Set this if you want catch_tell called on interactives
# as well as NPCs. If this is set, the user object will need a catch_tell(msg)
# method that calls receive(msg);
# interactive catch tell : 0

# RECEIVE_SNOOP: Set this if you want snoop text to be sent to the receive_snoop() function
# in the snooper object (instead of being sent directly via add_message()).
# This is useful if you want to build a smart client that does something
# different with snoop messages.
# receive snoop : 1

# SNOOP_SHADOWED: Set this if you want snoop to report what is sent to the player even
# in the event that the player's catch_tell() is shadowed and the player may not be
# seeing what is being sent.  Messages of this sort will be prefixed with $$.
# snoop shadowed : 0

# REVERSE_DEFER:
# If not defined executes defer functions in LIFO mode.
# If defined executes defer functions in FIFO mode.
# reverse defer : 0

# HAS_CONSOLE: If defined, the driver can take the argument -C
# which will give the driver an interactive console (you can type
# commands at the terminal.)  Backgrounding the driver will turn off
# the console, but sending signal SIGTTIN (kill -21) to the driver can
# turn it back on.  Typing 'help' will display commands available.
# The intent is to allow the inspection of things that are difficult
# to inspect from inside the mud.
# has console : 1

# NONINTERACTIVE_STDERR_WRITE: if defined, all writes/tells/etc to
# noninteractive objects will be written to stderr prefixed with a ']'
# (old behavior).
# Compat status: Easy to support, and also on the "It's a bug!  No, it's
# a feature!" religious war list.
# noninteractive stderr write : 0

# Set this if you want FluffOS to call crash() in master.c and then shutdown
# when signals are received that would normally crash the driver.
# trap crashes : 1

# OLD_TYPE_BEHAVIOR: reintroduces a bug in type-checking that effectively
# renders compile time type checking useless.  For backwards compatibility.
# Compat status: dealing with all the resulting compile errors can be
# a huge pain even if they are correct, and the impact on the code is
# small.
# old type behavior : 0

# OLD_RANGE_BEHAVIOR: define this if you want negative indexes in string
# or buffer range values (not lvalue, i.e. x[-2..-1]; for e.g. not
# x[-2..-1] = foo, the latter is always illegal) to mean counting from the
# end
# Compat status: Not horribly difficult to replace reliance on this, but not
# trivial, and cannot be simulated.
# old range behavior : 0

# define to get a warning for code that might use the old range behavior
# when you're not actually using the old range behavior
# warn old range behavior : 1

# suppress warnings about unused arguments; only warn about unused local
# variables.  Makes older code (where argument names were required) compile
# more quietly.
# suppress argument warnings : 1

# add_action: Make enable_commands() always re-call init(). same as
# calling enable_commands(1).
# enable_commands call init : 1

# sprintf: Make format like "%10s" ignore ANSI escape code length, as they
# are not visible in the client.
# sprintf add_justified ignore ANSI colors : 1

# call_out(0) loop prevention:
# This is the number of call_out(.., 0) call can be scheduled on the same
# gametick.
# call_out(0) next level : 1000

# TRACE: set this to 1 to collect context information during LPC traces.
# trace lpc execution context : 0

# TRACE: set this to 1 to collect LPC instruction information during LPC traces.
# trace lpc instructions : 0

# telnet extensions support
# enable mxp : 0
enable gmcp : 1
# enable zmp : 0
# enable mssp : 1
# enable msp : 1

###############################################################################
#          The following aren't currently used or implemented (yet)           #
###############################################################################

# maximum number of users in the game (unused currently)
# maximum users : 256

# Defines the number of bits to use in the call_other cache (in interpret.c).
#
# Memory overhead is (1 << APPLY_CACHE_BITS)*16.
# [assuming 32 bit pointers and 16 bit shorts]
#
# ACB:     entries:     overhead:
#   6           64            1k
#   8          256            4k
#  10        1,024           16k
#  12        4,096           64k
#  14       16,384          256k
#  16       65,536            1M
#  20    1,048,576           16M
#  22    4,194,304           64M
# apply cache bits : 22

###############################################################################
#                               obsolete config                               #
###############################################################################

# the address server is an external program that lets the mud translate
# internet names to numbers (and vice versa).  select an unused port.
# address server ip : localhost
# address server port : 3990

# Reserve an extra memory area from malloc(), to free when we run out
# of memory; so begins Armageddon.
# If this value is 0, no area will be reserved.
# reserved size : 10000

# absolute pathname of driver/config dir
# binary directory : .

# Directory to save binaries in.  (if BINARIES is defined)
# save binaries directory : /binaries

# file to swap out objects; not used if time to swap is 0
# swap file : /swapfile

精简配置

# fluffos v2019 运行时配置文件
name : MiniMud
port number : 4002
mudlib directory : .
log directory : /log
include directories : /include
global include file : <globals.h>
master file : /system/kernel/master
simulated efun file : /system/kernel/simul_efun
debug log file : debug.log

以下是炎黄MUD的精简配置,可参考:

# 精简版运行时配置文件
## 必须配置
name : 炎黄群侠转
mudlib directory : .
log directory : /log
include directories : /include:/mudcore/include
master file : /adm/single/master
## 必要配置
simulated efun file : /adm/single/simul_efun
global include file : <globals.h>
debug log file : debug.log
external_port_1 : telnet 5555
external_port_2 : telnet 6666
external_port_3 : websocket 80
websocket http dir : www
## 推荐配置
default fail message : [35m指令错误,请输入 help 查看游戏帮助。[0m
default error message : [31m你发现事情不大对了,但是又说不上来。[0m
## 特殊配置
external_cmd_1 : /usr/bin/curl
external_cmd_2 : C:\ProgramData\chocolatey\bin\curl.exe
## ==== Runtime Config Table ====
enable gmcp : 1
warn tab : 1
## ==============================

参数说明

特别说明:port numberexternal_port_x不要同时使用,如果你只开一个telnet端口,使用port number : 端口即可,如果要开多个端口,请用external_port_x : kind #,其中x为数字1~5,kind为 telnet, binary, ascii, MUD 或 websocket,#为端口。

相关efun

get_config()

set_config()

京ICP备13031296号-4