darope@0: darope@0: darope@0: darope@0: darope@0: darope@0: Using Metamod darope@0: darope@0: darope@0: darope@0:

Using Metamod darope@0:

darope@0: darope@0: darope@0:

Client Commands darope@0:

darope@0: darope@0: Similar to the server console interface, clients darope@0: can also issue commands to Metamod, of the following form: darope@0: darope@0: darope@0: darope@0:

Client Cvars darope@0:

darope@0: darope@0: Also available to client browser applications is a cvar darope@0: metamod_version that should report the version of Metamod darope@0: running on the server, ie: darope@0:

darope@0:

"metamod_version" is "1.17" darope@0: darope@0: darope@0:

Installation darope@0:

darope@0: darope@0: If you have installed AdminMod 2.50 darope@0: or later, then the AM installer has already installed Metamod for you. If darope@0: you only want to upgrade your Metamod with a more recent version, simply darope@0: grab the metamod.dll (win32) or metamod_i386.so (linux) file and darope@0: replace the file currently on your system. darope@0:

darope@0: If you want to install Metamod by hand, here's what you have to do: darope@0:

darope@0: darope@0:


darope@0:

Configuration darope@0:

darope@0: darope@0: Metamod has several ways to provide config options, partially because it darope@0: started with one method and then added other methods, but also because one darope@0: method can be more convenient than the other, varying with the situation. darope@0: darope@0:

darope@0: Generally speaking, the two methods of providing configuration darope@0: information to Metamod are: darope@0:

darope@0: darope@0:

darope@0: The confusing part can come when the pathnames to some of the config darope@0: files can be specified via command line options - or indeed, when the darope@0: pathnames to some config files can be specified in other darope@0: config files. darope@0: darope@0:

darope@0: In any case, here are the various config options and config files Metamod darope@0: uses, (listed in order of priority), where "$gamedir" darope@0: indicates the game directory, ie "cstrike": darope@0: darope@0:

darope@0: darope@0: darope@0:


darope@0:

File: plugins.ini darope@0:

darope@0: darope@0: Default location: $gamedir/addons/metamod/plugins.ini, ie darope@0: "cstrike/addons/metamod/plugins.ini". darope@0: darope@0:

Plugins are described in a file "plugins.ini" and each line describes a darope@0: plugin to load: darope@0: darope@0:

darope@0:
<platform> <filepath> [<description>] darope@0:
darope@0: darope@0:

Fields are whitespace delimited (tabs/spaces). darope@0: darope@0:

darope@0: darope@0: Comments are recognized at only the beginning of a line, and darope@0: can be in either shell style ("#") or c++ style ("//"). darope@0: darope@0:

For instance, in "cstrike/addons/metamod/plugins.ini" darope@0: these are all valid lines: darope@0: darope@0:

darope@0:     // linux    dlls/mybot.so
darope@0:     # win32     dlls/mybot-old.dll         Mybot old
darope@0:     win32       dlls/mybot.dll             Mybot current
darope@0:     linux       /tmp/stub_mm_i386.so
darope@0:     win32       /tmp/stub_mm_i386.dll
darope@0:     linux       ../dlls/trace_mm_i386.so
darope@0:     win32       ../dlls/trace_mm_i386.dll
darope@0:     linux       dlls/admin_MM_i386.so
darope@0:     win32       dlls/admin_MM_i386.dll
darope@0: 
darope@0: darope@0:

Note that order in the plugins.ini file is significant. darope@0: Plugins are loaded and accessed in the order specified, so ordering darope@0: can be important, depending on the plugin(s). darope@0: darope@0:

The file is re-read at changelevel, as well as on demand (via darope@0: "meta refresh" console command; see below). When the file darope@0: is re-read, it will: darope@0: darope@0:

darope@0: darope@0:

The game dll is auto-detected, along the same lines AdminMod operated darope@0: (looking at the "gamedir"); see "mm_gamedll" below if you want to use a darope@0: "bot" DLL. darope@0: darope@0:

You can override the name of this file by specifying it via the +localinfo field "mm_pluginsfile". darope@0: darope@0:

For compatibility with previous versions, Metamod will also look for a darope@0: file "metamod.ini" under the gamedir, ie "cstrike/metamod.ini". darope@0: darope@0: darope@0:


darope@0:

File: config.ini darope@0:

darope@0: darope@0: Default location: $gamedir/addons/metamod/config.ini, ie darope@0: "cstrike/addons/metamod/config.ini". darope@0: darope@0:

darope@0: This contains basic config information, at the moment duplicating most of darope@0: the +localinfo variables, but allowing for more darope@0: flexible expansion of config options in the future. Also, it provides darope@0: somewhat more reliable options setting, since +localinfo munges some darope@0: argument values (in particular, pathnames with leading dots, ie darope@0: "../dlls/blah.dll"). darope@0: darope@0:

darope@0: Basic format is: darope@0: darope@0:

darope@0:
<option> <value> darope@0:
darope@0: darope@0:

Fields are whitespace delimited (tabs/spaces). Comments are recognized darope@0: at only the beginning of a line, and can be in either shell darope@0: style ("#") or c++ style ("//"). darope@0: darope@0: The following is a list of currently recognized options, their defaults, darope@0: and examples of usage: darope@0: darope@0:

darope@0: darope@0:

You can override the name of this file by specifying it via the +localinfo field "mm_configfile". darope@0: darope@0: darope@0:


darope@0: darope@0:

File: exec.cfg darope@0:

darope@0: darope@0: Default location: $gamedir/addons/metamod/exec.cfg, ie darope@0: "cstrike/addons/metamod/exec.cfg". darope@0: darope@0: This is necessary for plugins that need to have settings specified prior darope@0: to early API routines like ServerActivate, since autoexec.cfg is darope@0: read too early and server.cfg is read to late. In particular, I darope@0: found this necessary for the Trace plugin, in order to trace routines like darope@0: RegUserMsg which are called during ServerActivate. darope@0: darope@0:

You can override the name of this file by specifying it via the +localinfo field "mm_execcfg". darope@0: darope@0:

For compatibility with previous versions, Metamod will also look for a darope@0: file "metaexec.cfg" under the gamedir, ie "cstrike/metaexec.cfg". darope@0: darope@0: darope@0:


darope@0: darope@174:

File: metagame.ini darope@0:

darope@0: darope@0: NOTE! This file is no longer supported! -- use instead the darope@0: +localinfo field darope@0: "mm_gamedll" or the config.ini option gamedll. darope@0: darope@0: darope@0:


darope@0: darope@0:

Commandline option: +localinfo darope@0:

darope@0: darope@0: Several of Metamod's configuration options can be specified by the darope@0: "+localinfo" facility on the hlds command line. This is similar to the darope@0: "setinfo" console command, where the syntax is: darope@0: darope@0:
darope@0:
+localinfo <field> <value> darope@0:
darope@0: darope@0: Current localinfo fields recognized by Metamod: darope@0: darope@0: darope@0:

Note that each localinfo field can have only one value. If darope@0: specified more than once on the command line, only the last one will darope@0: be recognized. (In particular, trying to use mm_gamedll to load multiple darope@0: dll-style bots will not work. In a case like that, the multiple darope@0: dll's must be chained together). darope@0: darope@0:

Some examples are: darope@0:

darope@0: 	./hlds_run -game cstrike +localinfo mm_pluginsfile mylist.ini
darope@0: 	./hlds_run -game cstrike +localinfo mm_execcfg mysettings.cfg
darope@0: 	./hlds_run -game cstrike +localinfo mm_gamedll dlls/pod_bot.so
darope@0: 	./hlds_run -game cstrike +localinfo mm_debug 7
darope@0: 
darope@0: darope@0:

Note, paths should use unix-style forward slashes (/) and darope@0: not backward slashes (\), even on windows platforms. darope@0: darope@0: darope@0:


darope@0: darope@0:

Commands darope@0:

darope@0: darope@0:

All console command functionality is provide by a single command "meta", darope@0: with multiple sub-commands: darope@0: darope@0:

darope@0:    usage: meta <command> [<arguments>]
darope@0:    valid commands are:
darope@0:       version                - display Metamod version info
darope@0:       list                   - list plugins currently loaded
darope@0:       cmds                   - list console cmds registered by plugins
darope@0:       cvars                  - list cvars registered by plugins
darope@0:       refresh                - load/unload any new/deleted/updated plugins
darope@0:       config                 - show config info loaded from config.ini
darope@0:       load <name>            - find and load a plugin with the given name
darope@0:       unload <plugin>        - unload a loaded plugin
darope@0:       reload <plugin>        - unload a plugin and load it again
darope@0:       info <plugin>          - show all information about a plugin
darope@0:       pause <plugin>         - pause a loaded, running plugin
darope@0:       unpause <plugin>       - unpause a previously paused plugin
darope@0:       retry <plugin>         - retry a plugin that previously failed its action
darope@0:       clear <plugin>         - clear a failed plugin from the list
darope@0:       force_unload <plugin>  - forcibly unload a loaded plugin
darope@0:       require <plugin>       - exit server if plugin not loaded/running
darope@0: 

darope@0: darope@0: where <plugin> can be either the plugin index number, or a non-ambiguous prefix darope@0: string matching description or file. darope@0: darope@0:

Also, a single cvar is available: darope@0:

darope@0:    meta_debug       - set debugging level
darope@0: 
darope@0: darope@0:

For instance with: darope@0: darope@0:

darope@0:   Currently loaded plugins:
darope@0:         description       stat pend  file               vers    src  load  unlod
darope@0:    [ 1] Trace HLSDK API   RUN   -    mm_trace_i386.so   v0.90   ini  ANY   Pause
darope@0:    [ 2] adminmod          RUN   -    admin_MM.so        v2.11   ini  Start Start
darope@0:    [ 3] stub              RUN   -    mm_stub_i386.so    v0.90   ini  ANY   Pause
darope@0:   2 plugins, 2 running
darope@0: 

darope@0: darope@0:

You could then do any of the following to unload the API Trace plugin: darope@0:

darope@0:    meta unload 1
darope@0:    meta unload trace
darope@0:    meta unload mm_trace
darope@0: 
darope@0: darope@0: darope@0:
darope@0: darope@0:

Plugin Loading/Unloading Process darope@0:

darope@0: darope@0: Through the process of loading and unloading, a plugin can be in one of darope@0: several different states ('stat' column in the 'meta list' output): darope@0: darope@0: darope@0: darope@0: Also through the operation process, a plugin can have a pending "action" to darope@0: next take (indicated by the 'pend' column in the 'meta list' output), and darope@0: can be one of: darope@0: darope@0: darope@0: darope@0: darope@0:
darope@0: darope@0:

Example Output darope@0:

darope@0:

Here's some other example output: darope@0: darope@0:

darope@0:    meta info admin
darope@0:             name: adminmod
darope@0:             desc: Adminmod
darope@0:           status: running
darope@0:           action: none
darope@0:         filename: dlls/admin_MM.so
darope@0:             file: admin_MM.so
darope@0:         pathname: /home/willday/test/cstrike/dlls/admin_MM.so
darope@0:            index: 3
darope@0:           source: ini file
darope@0:         loadable: at server startup
darope@0:       unloadable: at server startup
darope@0:          version: 2.11
darope@0:             date: 2001/02/04
darope@0:           author: Alfred Reynolds <alfred@mazuma.net.au>
darope@0:              url: http://www.adminmod.org/
darope@0:           logtag: ADMIN
darope@0:      last loaded: Mon Feb  5 02:06:34 2001
darope@0:    DLLAPI functions:
darope@0:       GameDLLInit
darope@0:       DispatchThink
darope@0:       ClientConnect
darope@0:       ClientCommand
darope@0:       ClientUserInfoChanged
darope@0:       ServerActivate
darope@0:    6 functions (dllapi)
darope@0:    No DLLAPI-Post functions.
darope@0:    No NEWAPI functions.
darope@0:    No NEWAPI-Post functions.
darope@0:    No Engine functions.
darope@0:    No Engine-Post functions.
darope@0:    Registered commands:
darope@0:       admin_command
darope@0:    1 commands
darope@0:    Registered cvars:                      float value  string value
darope@0:       users_file                             0.000000  users.ini
darope@0:       maps_file                              0.000000  mapvote.txt
darope@0:       default_access                         1.000000  1
darope@0:       ips_file                               0.000000  0
darope@0:       reserve_slots                          1.000000  1
darope@0:       reserve_slots_msg                      0.000000  0
darope@0:       admin_debug                            1.000000  1
darope@0:       password_field                         0.000000  admin_password
darope@0:       alarm_message                          0.000000  0
darope@0:       alarm_time                             0.000000  0
darope@0:       use_regex                              1.000000  1
darope@0:       models_password_field                  0.000000  0
darope@0:       models_file                            0.000000  models.ini
darope@0:       models_kick_msg                        0.000000  Invalid model
darope@0:       script_file                            0.000000  cstrike/dlls/admin.amx
darope@0:       help_file                              0.000000  admin_help.txt
darope@0:       vote_freq                            360.000000  360
darope@0:       encrypt_password                       1.000000  1
darope@0:       pretty_say                             1.000000  1
darope@0:       admin_mod_version                      2.110000  2.11
darope@0:       reserve_type                           1.000000  1
darope@0:       map_ratio                             60.000000  60
darope@0:       kick_ratio                            75.000000  75
darope@0:       words_file                             0.000000  0
darope@0:       password_timeout                    1800.000000  1800
darope@0:       file_access_read                       0.000000  0
darope@0:       file_access_write                      0.000000  0
darope@0:       public_slots_free                     20.000000  20.000000
darope@0:       allow_client_exec                      0.000000  0
darope@0:       admin_balance_teams                    0.000000  0
darope@0:    30 cvars
darope@0: 
darope@0:    meta cmds
darope@0:    Registered plugin commands:
darope@0:           plugin              command
darope@0:     [  1] API trace           trace_version
darope@0:     [  2] API trace           trace
darope@0:     [  3] API trace           untrace
darope@0:     [  4] API trace           showtrace
darope@0:     [  5] Adminmod            admin_command
darope@0:    5 commands, 5 available
darope@0: 
darope@0:    meta cvars
darope@0:    Registered plugin cvars:
darope@0:           plugin      cvar                   float value  string value
darope@0:     [  1] API trace   trace_debug               3.000000  3.000000
darope@0:     [  2] API trace   trace_dllapi              8.000000  8
darope@0:     [  3] API trace   trace_newapi              0.000000  0
darope@0:     [  4] API trace   trace_engine              8.000000  8
darope@0:     [  5] Adminmod    users_file                0.000000  users.ini
darope@0:     [  6] Adminmod    maps_file                 0.000000  mapvote.txt
darope@0:     [  7] Adminmod    default_access            1.000000  1
darope@0:     [  8] Adminmod    ips_file                  0.000000  0
darope@0:     [  9] Adminmod    reserve_slots             1.000000  1
darope@0:     [ 10] Adminmod    reserve_slots_msg         0.000000  0
darope@0:     [ 11] Adminmod    admin_debug               1.000000  1
darope@0:     [ 12] Adminmod    password_field            0.000000  admin_password
darope@0:     [ 13] Adminmod    alarm_message             0.000000  0
darope@0:     [ 14] Adminmod    alarm_time                0.000000  0
darope@0:     [ 15] Adminmod    use_regex                 1.000000  1
darope@0:     [ 16] Adminmod    models_password_fiel      0.000000  0
darope@0:     [ 17] Adminmod    models_file               0.000000  models.ini
darope@0:     [ 18] Adminmod    models_kick_msg           0.000000  Invalid model
darope@0:     [ 19] Adminmod    script_file               0.000000  cstrike/dlls/admin.amx
darope@0:     [ 20] Adminmod    help_file                 0.000000  admin_help.txt
darope@0:     [ 21] Adminmod    vote_freq               360.000000  360
darope@0:     [ 22] Adminmod    encrypt_password          1.000000  1
darope@0:     [ 23] Adminmod    pretty_say                1.000000  1
darope@0:     [ 24] Adminmod    admin_mod_version         2.110000  2.11
darope@0:     [ 25] Adminmod    reserve_type              1.000000  1
darope@0:     [ 26] Adminmod    map_ratio                60.000000  60
darope@0:     [ 27] Adminmod    kick_ratio               75.000000  75
darope@0:     [ 28] Adminmod    words_file                0.000000  0
darope@0:     [ 29] Adminmod    password_timeout       1800.000000  1800
darope@0:     [ 30] Adminmod    file_access_read          0.000000  0
darope@0:     [ 31] Adminmod    file_access_write         0.000000  0
darope@0:     [ 32] Adminmod    public_slots_free        20.000000  20.000000
darope@0:     [ 33] Adminmod    allow_client_exec         0.000000  0
darope@0:     [ 34] Adminmod    admin_balance_teams       0.000000  0
darope@0:    34 cvars, 34 available
darope@0: 
darope@0:    meta unload stub
darope@0:    Unloaded plugin 'Stub plugin'
darope@0:    Currently loaded plugins:
darope@0:          description       stat pend  file               vers   src  load  unlod
darope@0:     [ 1] Trace HLSDK API   RUN   -    mm_trace_i386.so   v0.90  ini  ANY   Pause
darope@0:     [ 2] adminmod          RUN   -    admin_MM.so        v2.11  ini  Start Start
darope@0:    2 plugins, 2 running
darope@0: 
darope@0:    meta load stub
darope@0:    Loaded plugin 'stub' successfully
darope@0:    Currently loaded plugins:
darope@0:          description       stat pend  file               vers   src  load  unlod
darope@0:     [ 1] Trace HLSDK API   RUN   -    mm_trace_i386.so   v0.90  ini  ANY   Pause
darope@0:     [ 2] adminmod          RUN   -    admin_MM.so        v2.11  ini  Start Start
darope@0:     [ 3] stub              RUN   -    mm_stub_i386.so    v0.90  cmd  ANY   Pause
darope@0:    3 plugins, 3 running
darope@0: 
darope@0: darope@0:

darope@0:


darope@0: darope@0: darope@0: