DLL Change Log
Date: 06 8, 2001 3:37:23 PM

# Developer Change Log - AM DLL

## 22.08.2004 2.50.60

#### Changes/Additions

- Added a 64bit Linux version for AMD64. The 64bit version uses 64bit script binaries which are not compatible with 32bit script binaries. They have the file extension .amx64. To compile for Linux 64bit, a new compiler is used: sc64. The compile and compile_all scripts have optional -32 and -64 switches to explicitely choose the compiler (for cross-compiling).
- Revised Windows installer install_admin.vbs to properly detect new Steam accounts and have a more consistent user interface. Works with CS:CZ Retail version. A missing listenserver.cfg is now automatically created by the installer. The uninstaller has been updated accordingly.
- Added cvar_exists() scripting function to check if a cvar exists or not. The function returns 1 if a cvar exists, 0 if not. (Patch 908067 by Kevin Masterson.
- Added get_timer() scripting function. It returns a value describing the status of the timer index passed in.
- Added valid_mapex() scripting function. It allows the valid map check to bypass the map.ini check and just check for the existance of the map.
- Admin Mod is now unloadable at any time. It is still only loadable on server start, though.
- Allow the use of the loopback IP 127.0.0.1 in the users.ini file. Improves listenserver support.
- Added format directives 'l' and 'h' for snprintf() to specify long or short values. Useful on AMD64 systems. See a Linux man page or MSDN help page for a description.

#### New CVARs

- mysql_port to set the port of the MySQL server if it differs from
- the default port. (Patch #888683, by Indan Zupancic)

#### Bug Fixes

- Fixed some issues in listenserver user detection.
- Fixed an exploit in admin_passwd.
- Fixed an exploit on servers with amv_private_server set. Users could join a server under their registered name and then change their nickname to an unregistered name without getting kicked.
- Fixed rare crashes due to NULL pointer access when starting plugins.
- Fixed the server crashing instead of exiting cleanly when Admin Mod calls
exit during startup, e.g. because the scripting engine could not be loaded.

## 05.10.2003 2.50.58

#### Changes/Additions:

- Reserved nicknames, reserved slots and private servers work correctly with Steam servers. This means full Steam support now.
- Fixed the problem of admins losing access rights upon mapchange.
- The plugin_info() function is no longer triggered in plugins before the
plugin_connect() function is called for a connecting player.
- Added support for #include directive to .ini config files which will include another config file. The filename must be enclosed in double quotes ("") or angular brackets (<>). When using #include "file" the file is searched relative to the directory that the including file is in. When using #include the file is searched relative to the MOD directory (e.g. cstrike). The former version is probably easier for most users.
- Added support for loading plugins from a directory either by specifying a directory name in the plugins.ini file or by using a directory name in admin_plugin_file. All files that end in .amx are loaded from the directory in alphabetical order. To prevent a file from loading, simply
add .noload to the end of the filename.
- A PostgreSQL version of Admin Mod is now available, donated by Idy and AKP.
- Allow for no plugins being loaded. A warning will still be written to the logs in case this wasn't what the admin intended.
- Added admin_cmd as a shorter version of admin_command. Both can be used.
- Made admin_version directly accessible from the server console.
- CS timelimit reporting is now accurate under Windows, too, for CS 1.6. This does not work with CS 1.5, where timelimit may still be off under Windows.
- Changed selfmessage() message buffer size to LARGE_BUF_SIZE.
- Reformatted userlist() output, added access right and immunity status.
- Changed plugin_CS to work with CS 1.6. Weapon restriction function has been changed considerably. Settings can be made permanent from the console, admin_restrict can be used with weapon names.

#### New CVARS:

- Read-only cvar ami_sv_maxplayers: contains the server's original maxplayers value. Can be used by third party server browsers.
- PostgreSQL version: pgsql_database pgsql_dbtable_ips pgsql_dbtable_models pgsql_dbtable_plugins pgsql_dbtable_users pgsql_dbtable_tags pgsql_dbtable_words pgsql_host pgsql_port pgsql_pass pgsql_user pgsql_preload pgsql_users_sql pgsql_tags_sql The pgsql_port cvar specifyies the port of the PostgreSQL server. For a local server using Unix Domain Sockets instead of TCP/IP the local UDS file is used, e.g. pgsql ".s.PGSQL.5432" with pgsql_host "/tmp". All other cvars work like their MySQL counterparts.

#### Bug Fixes:

- Fixed admin_tsay and admin_csay commands so that say text doesn't have to be enclosed in quotes.
- Another fix to the strbreak() scripting function.
- Fixed docpath and Specify() bugs in Win32 installer.
- Do not run plugin_info() for a kicked player.
- Fixed bug with CS timelimit not working correctly with Linux server.
- Fixed Linux version of Small compiler to handle DOS files and work when no PWD envvar is set.
- Fixed exploit which would allow players to switch their name to a reserved IP and gain access rights associated with that IP.
- Fixed free/reserved slot reporting to be more robust.
- Fixed exploit in plugin_antiflood.
- Have "" be accepted as "undefined" in adminmod.cfg for all file and string cvars.
- Fixed reject and kick messages to work with old and new clients.

#### Coding:

- VerifyUserAuth() gets called in any case in AddUserAuth(), no matter if mapchange, reconnect or new connet.
- INFO_KEYVAL_SIZE replaces BUF_SIZE for get_/set_serverinfo().
- Removed HAS_SNPRINTF macros. Everybody has snprintf().
- Changed the semnatics of auth_struct::head() to return the *current* head. Get the next head position with get_head() instead.
- Changed IsComment() to is_comment(). Overloaded to check for // instead for /.
- Added various utility functions to check and get a cvar value for cvars holding string values or filenames/paths: cvar_string_value_is_set(), cvar_string_is_set(), cvar_file_value_is_set(), cvar_file_is_set() get_cvar_string_value(), get_cvar_file_value().
- Added filesystem node abstraction AmFSNode and AmDir.

## 21.06.2002: 2.50.50

#### Changes/Additions:

- Added customized libc functions for efficiency.
- New scripting functions: get_userFrags(), get_userHealth(), get_userTeam(), get_userArmor().
- Added the option to use an IP in the users.ini file to grant access rights by IP.
- Script functions called from plugin_init() or as the result of a vote will be called with access rights of the server console.
- Changed DLL/DSO loading mechanism. The amx_admin.dll/.so will be loaded from the same location as the admin_MM DLL/DSO and can thus be moved out of the /dlls directory, too.
- mySQL: Changed name of mySQL version DLL to admin_MM_mysql.dll.
- mySQL: Added possibility to use the mySQL PASSWORD() function to encrypt passwords in the users/tags/models table. To switch from crypt() to PASSWORD() encryption, set mysql_use_sqlPASSWORD to 1.
- Added Steamid support. See Note about mySQL usage below.
- Changed to static linkage with libstdc++.
- Changed team lookup. Spectators will now be reported to be in team TEAM_SPECTATOR and HLTV proxies will be reported to be in team TEAM_PROXY.
- Added (BETA!) functionality to check for missing/broken entities. This is not a problem of Admin Mod but we may still be able to gather information for VALVe. Adding "melog1" to amv_beta_enable will switch on checking and logging of broken entities. Adding "mefix1" will attempt to fix them. A fix can also be triggered from during the game by using "admin_adm mefix".
- Added a warning in the log when a plugin cannot register all of its native functions.
- A vote no longer accounts for bots when admin_bot_protection is on.
- Match a player not only by IP but also by port when re-authenticating him.
- Better debug info for checking lost permissions on mapchange (hopefully).
- Corrections made to make nextmap() more accurate. Works only when maps are changed with admin_ commands.
- Changed player lookup in order to prevent exploits where players use the wonid of an admin as their name. Numbers to admin_commands can be escaped with a backslahs to prevent them from being interpreted as a name.
- Added console message to clients when connecting to a server with allow_client_exec enabled.
- Made leading underscore compulsory for password_field values

#### Bug Fixes:

- Fixed a bug kicking players with ';' in their nicks.
- Username length set to match engine limit of 33 chars.
- Fixed security hole in exec() scripting function. It does not allow unquoted semicolons anymore, nor the use of 'admin_command'. The following exception applies: strings starting with "logd_reg" or "sm_register" are allowed to contain "admin_command". This is to allow registering commands for LogD and StatsMe to work. Additional commands can be added for other third party MM plugins with the amv_register_cmds CVAR.
- Fixed a bug in the AM timer code.
- Fixed a bug causing player nicks starting with a number to be mistaken for a sessionid or wonid.
- Obsolete CVAR password_timeout removed.
- Fixed a bug that prevented the use of empty passwords in users.ini.
- Fixed a bug in player lookup function.
- Fixed a bug counting connected players incorrectly and thus filling reserved slots.
- Fixed playerinfo() function writing to default values of optional parameters.
- Changed users.ini parsing function not to bail out if a line with an entry ends with an comment.
- Fixed "Unknown command" message when executing a command without proper access permissions.
- Fixed a memory leak in the Small AMX which would result in heap-stack collisions.
- Fixed get_userorigin() to not print debug messages to the client.
- Fixed that the Highlander was not reevaluted when the current Highlander left the server.
- admin_reload did not have an immediate effect on connected player access rights.
- Removed stray line-endings from commands passed to plugins.

#### New CVARS:

- amv_log_passwords: (0/1, def:0) If set to 0, passwords will not be logged in cleartext by debug messages.
- amv_register_cmds: Space separated list of registering commands similar to "logd_reg" of LogD and "sm_register" of StatsMe to allow the use of "admin_command" with the exec() scripting function.
- mySQL: mysql_use_sqlPASSWORD: (0/1, def:0) If set, passwords will be encrypted with the mySQL PASSWORD() function.
- amv_vote_duration: (def:30) Controls how long a voting session takes.
- amv_enable_beta: to enable various beta options deisabled by default.

## 21.06.2002: 2.50.38

#### Changes/Additions:

- Added customized libc functions for efficiency.
- New scripting functions: get_userFrags(), get_userHealth(), get_userTeam(), get_userArmor().
- Added the option to use an IP in the users.ini file to grant access rights by IP.
- Script functions called from plugin_init() or as the result of a vote will be called with access rights of the server console.
- Changed DLL/DSO loading mechanism. The amx_admin.dll/.so will be loaded from the same location as the admin_MM DLL/DSO and can thus be moved out of the /dlls directory, too.
- mySQL: Changed name of mySQL version DLL to admin_MM_mysql.dll.
- mySQL: Added possibility to use the mySQL PASSWORD() function to encrypt passwords in the users/tags/models table. To switch from crypt() to PASSWORD() encryption, set mysql_use_SQLPASSWORD to 1.
- Added Steamid support. See Note about mySQL usage below.
- Changed to static linkage with libstdc++.
- Changed team lookup. Spectators will now be reported to be in team TEAM_SPECTATOR and HLTV proxies will be reported to be in team TEAM_PROXY.

#### Bug Fixes:

- Fixed a bug kicking players with ';' in their nicks.
- Username length set to match engine limit of 33 chars.
- Fixed security hole in exec() scripting function. It does not allow unquoted semicolons anymore, nor the use of 'admin_command'. The following exception applies: strings starting with "logd_reg" or "sm_register" are allowed to contain "admin_command". This is to allow registering commands for LogD and StatsMe to work. Additional commands can be added for other third party MM plugins with the amv_register_cmds CVAR.
- Fixed a bug in the AM timer code.
- Fixed a bug causing player nicks starting with a number to be mistaken for a sessionid or wonid.
- Obsolete CVAR password_timeout removed.
- Fixed a bug that prevented the use of empty passwords in users.ini.
- Fixed a bug in player lookup function.
- Fixed a bug counting connected players incorrectly and thus filling reserved slots.

#### New CVARS:

- amv_log_passwords: (0/1, def:0) If set to 0, passwords will not be logged in cleartext by debug messages.
- amv_register_cmds: Space separated list of registering commands similar to "logd_reg" of LogD and "sm_register" of StatsMe to allow the use of "admin_command" with the exec() scripting function.
- mySQL: mysql_use_SQLPASSWORD: (0/1, def:0) If set, passwords will be encrypted with the mySQL PASSWORD() function.

## 9.12.2001: 2.50.26

#### Changes/Additions:

- ban now takes three parameters. Possible to ban by IP or ID
- Added the Directmessage function to send messages to clients who are connecting and cannot be looked up normally.
- Added the print_pretty option for the messageex function, it prints to single user in csay text, csay restrictions apply.
- fixed Csay, it now >= tests line lengths. Messages of exactly 80 chars will not be allowed rather then simply not working
- The execclient restriction functionality has been changed.
- Added private server mode where only users authenticaed users can join.

#### Bug Fixes:

- Fixed Bot protection Cvar pointer
- Added code to help with Admin's getting dropped at map change.
- Many other miscelaneous changes to increase stability and functionality.

## 15.6.2001: 2.50e (2.50.26)

#### Changes/Additions:

- Added system error reports to CPlugin::LoadFile() function.
- Added the plugin_exec() function.
- Fixed the bot_protection in teleport() not showing special fx.
- Added #pragma pack() to the end of amx.h to stop the packing.
- Tried to move include directives so that amx.h always gets included last. This enabled MySQL support under Windows.

#### Bug Fixes:

- Fixed a bug in timer.cpp::IsValidTimer() checking for the wrong constant.
- Fixed a bug in the bad name detection. make_friendly replaces % now with spaces instead of deleting them.
- Fixed a bug in the logging functions of centersay et al which messed up the formatting.

2.6.2001: Changes since the admin-2_50-release CVS tag

CLinkList.cpp:

CLinkList.h:

The linked list and list item classes have been converted to templates. This is necessary because we can't use a void* pointer to store data in the items. Using a void* pointer will cause a memory leak since the destructor of an object stored will not be called. The template declaration includes an argument to specify if the list item object will be used to store a single element or an array of elements. This is necessary to call the correct delete operator on destruction. All other files have been adapted to use the templates. I removed some C-type casts which are unnecessary when using the templates. We should gradually change to C++-type casts if they are necessary.

The insertion was fixed which fixes a bug of registered commands not showing up in admin_help.

Makefile:

- Well, just a little cleanup, removing the double (and wrong) optimization flags. Removed linkfunc.ccp from the MM build.

admin_commands.cpp:

- The wrong time bug in ban() has been fixed. Log string size has been increased to LARGE_BUF_SIZE.

- Added debug message to plugin_register*() functions.

- tsay(), centersay() and rainbow() messages get logged in the logs with newlines replaced with "\n" strings.

- vote_multiple() function displays all options, not only the last one.

- Added const_casts on STRING() calls in order to use the original HLSDK STRING() function and get rid of those compiler warnings.

- Jag moved the contents of the getteamcount() function around. =)

- Added slay() function which is independent from the setting of allow_execclient.

- Added more bot protections if admin_bot_protection is on. It should work now also if admin_fx is turned on.

- Fixed gettarget() and pointto() crashes under Linux. The Linux version of CS and TFC don't like the HLSDK EyePosition() function.

admin_mod.cpp:

- Cvars added: admin_repeat_freq, admin_vote_echo, amv_autoban. Other CVars have changed default settings: admin_connect_msg, admin_repeat_msg.

- AM_ClientConnect(): Setting some structures to 0 seems to have fixed that mysterious crash when compiling optimized.

- Check for player names with non-printable characters. They are denied access. If they change name in mid-game, their HL is closed on the client machine and a 24h ban issued depending on the setting of amv_autoban.

- Metamod stuff changed to match new interface version.

- Added MM function GetEngineFunctions_Post()

- Changed DispatchObjectCollsionBox() to hide the timer entity.

extdll.h:

- Fixed MSVC compiling problems when compiling in DEBUG mode and added #pragma warning(disable : 4018) to hide the signed/unsigned mismatch warnings.

- Adapted to use the original STRING() function and updated functions UTIL_LogPrintfFNL() and make_friendly().

hexport.cpp:

- Catches engine functions to hide the timer entity. This removed the crashes in TFC.

make_pass:

- Updated to better make use of the new encryption scheme, improving usability.

MSVC schtuff:

- Oh well, updated the workspace files to work. Added resource file adminmod.rc which adds a version information to the Windows DLL.

timer.h:

timer.cpp:

- Added MaxVoteChoice member and access functions. Updated the StartVote() function to use ChoiceCount.

users.cpp:

- Removed ' * ' from the list of comment characters.

- MySQL fixes from Jon Paul Nollmann.

- Most changes are to use the new templates.

users.h:

- Added DEBUG_LOG and DEVEL_LOG macros to make it easier to log debug messages.

util.cpp:

- Changed make_friendly() to check for non-printable characters. The check is optional and can be enabled with the second.

- Added UTIL_LogPrintfFNL() function which acts like UTIL_LogPrintf() but converts newlines within the string to "\n" literals, if there is enough space in the array, else they are replaced with blanks.

- UTIL_LogPrintf() uses vsnprintf() instead of vnprintf() to prevent buffer overflow.

- CLIENT_PRINTF() replaced with SystemResponse(), fixing crash when the player lookup function found more than one match on a partial name.