benmachine's contributions to Tremulous

Contents

  1. Server-side patches
    1. Build logging and revert
    2. Server info file handler and parser
    3. Notarget application in buildables
    4. IRC-like /me for use in chat
  2. Client-side patches
    1. Pre-fill chat field
    2. Make black text grey in console
  3. Mods requiring a client download
    1. Lovely weapons
  4. Bugfixes
    1. Admin commands with no permission report as unknown commands
    2. Admin message printing to console decolours even with com_ansiColor enabled
    3. Fall damage causes players to bounce
    4. Evolving near some map elements causes the player to get stuck
    5. A reactor that has not yet exploded still gives power
    6. G_SelectiveRadiusDamage called too many times in HReactor_Think
    7. Custom admin.dat commands counted incorrectly

  1. Server-side patches

    1. Build logging and revert
      • Links
        http://www.mercenariesguild.net/patches/?do=details&task_id=90
      • Summary
        SVN revisions: 964 and 1036
        Status: Moderately tested, somewhat buggy
        Admin flags: UR
        Admin commands: !buildlog, !revert
        Cvars: g_buildLogMaxLength

        Every event that changes the buildable layout, buildings, deconstructions, and destructions, is logged: this log can be read by the !buildlog command, using flag U. !buildlog can take arguments for entries by a specific player, on a specific team, or starting from a specific event ID (see argument syntax below). Entries in this log can be reverted by the !revert command (in my implementation, flag R, although due to conflicts the flag v is sometimes used instead). Revert can be configured to affect only one player, only one team, or admins can manually select log ID numbers to revert.
      • Description
        This is one of my longest-lasting, most ambitious, and most tested patches. Despite a general elimination of bugs, there come in constant reports of periodic inexplicable and total failiures: consequently, I have always maintained that revert is a very unsubtle tool and should be used with caution and kept to a minimum. It certainly should not be used to play basetests, make 8 reactors, or generally used lightly (of course you may do what you will, but don't say I didn't warn you). Some particulars of usage:
        • Buildable destruction is logged as soon as the buildable reaches 0 hp, not when it explodes: if you revert this destruction promptly, the dead buildable will be quietly removed and replaced by a new copy of itself.
        • If the space which the buildable would revert into is occupied by players, the model is placed intangibly and attempts to eject the occupying entities with considerable force. When the buildable is clear, it solidifies and resumes normal function.
        • Every time buildlog or revert is used, the server prints a message informing every client that something's up, and !revert prints a summary of all the actions that were undone.
        Note also that although the patch is against SVN r1036, the only difference is in the application of G_ClientNumbersFromString et al, and the 964-compatible versions are helpfully presented commented out.
        The syntax for usage of !buildlog is:
        !buildlog (xnum|#ID) (-name|num) (a|h)
        The order the arguments are presented in is actually immaterial, since the first character of each determines what it means.
        num specifies a number of buildlog entries to skip over, showing the user events further back in the log.
        ID specifies a log entry ID from which to start display. Note that this must exactly match an existing ID. !buildlog will make no effort to meet you in the middle here.
        Also note that current versions of buildlog do not allow specifying a skip count and an ID, and use only whichever comes last.
        name|num restricts buildlog to displaying only actions taken by the specified player
        a|h matches buildlog entries where the target buildable was on the specified team.
        !revert takes a syntax nearly identical in form but subtly different in meaning. !revert allows you to specify both xnum and #ID, which reverts num buildlog entries starting at #ID and working backwards. An example would be:
        !revert x5 #21 -4 h
        This would revert 5 actions from #21 backwards done by client #4 to human buildables.
      • Issues
        Both commands are abusable, and allow the building of bases which the game should normally render impossible, with more than one of normally unique buildables, for example.
        One known bug with !revert: using the force syntax to overwrite a placed buildable leaves that buildable's build entry orphaned and impossible to revert.
        Revert has been hypothesised to carry some of the same issues as layout: if especially close together, buildables may occasionally fail to spawn.

    2. Server info file handler and parser
      • Links
        http://www.mercenariesguild.net/patches/?do=details&task_id=43
      • Summary
        SVN revision: 1047
        Status: Recently re-released, basic testing
        Admin flags: H
        Admin commands: !info

        This command reads text files from the info directory on the server, parses escapes and makes substitutions, and prints them to the user. The syntax is:
        !info (subject)
      • Description
        !info recently underwent a complete rewrite, and the behaviour has changed somewhat. When a client requests info on a subject foo, the server checks for info/info-foo.txt, or info/info-default.txt if no subject was specified. If the requested file is not found, an error is printed - note that the latest version of info does not fall back on the default info file if the specified subject file does not exist. If a file is found, then it goes through a parser, which does the following:
        • The text is read until the first $ not preceded by a \
        • If the next character is a {, it skips it
        • It reads a variable name consisting of alphanumeric characters and underscores
        • If the next character is a }, it is skipped
        • The cvar name given, including the $, is substituted for its value as a string
        • When the entire string has been read and all cvarssubstituted, if any changes were made then the systemloops and cvar-substitutes the string again
        • If the system loops 100 times then it automatically stops looping and prints a warning to the console
        • Having completed cvar substitution, escapes are handled: \n becomes a newline, \$ becomes $, \\ becomes\ etc.
        The implications of this system are not obvious at first, so I shall present some examples. In each, the green represents console or config settings, the blue shows the contents of info files, and the red shows the output of relevant info commands.
        info/info-default.txt:
        Welcome to benmachine's server!


        ]/!info
        Welcome to benmachine's server!
        set g_motd "Careful of the dinosaurs in the basement!"

        info/info-motd.txt:
        $g_motd


        ]/!info motd
        Careful of the dinosaurs in the basement!
        set timelimit 60
        set g_suddenDeathTime 55


        info/info-timers.txt:
        Sudden Death: ${g_suddenDeathTime}min
        Timelimit: ${timelimit}min


        ]/!info timers
        Sudden Death: 55min
        Timelimit: 60min
        set bool "$bool_"
        set bool_1 "ON"
        set bool_0 "OFF"
        set g_unlagged 1
        set g_allowShare 0


        info/info-settings.txt:
        Unlagged: $bool$g_unlagged
        Share: $bool$g_allowShare


        ]/!info settings
        Unlagged: ON
        Share: OFF
      • Future developments
        This command is not really suitable for the admin system, and future versions may move it from !info to /info

    3. Notarget application in buildables
      • Links
        http://www.mercenariesguild.net/patches/?do=details&task_id=77
        http://bugzilla.icculus.org/show_bug.cgi?id=3243
      • Summary
        SVN revision: 948
        Status: Lightly tested, in common use

        Notarget was an old quake cheat command to make bots ignore you. Tremulous no longer has any bots, so the command exists but remains unused in standard code. This patch causes buildables from both teams to ignore a player who activates notarget, including beneficial effects such as booster poison and medistation healing. Usable buildables, the armoury, hovel, or reactor, forexample, are unaffected.
      • Description
        Most buildable think functions now skip over any players that have the notarget flag set. However, it is worth noting that if some area-of-effect buildables, such as acid tubes, reactors, or overminds, are already firing due to the presence of another target, they may also hurt a notargeted client. Acid tubes in particular may take several seconds after the activation of notarget to lose interest. Hives may in some cases hurt a player with notarget on, but swarms chasing a player who activates notarget should quickly abandon their pursuit. Also of note is the refusal of boosters or medistations to help you with notarget on - you should be able to use /give health or poison in these situations.
        Finally, humans with notarget are not slowed by creep.

    4. IRC-like /me for use in chat
      • Links
        http://www.mercenariesguild.net/patches/?do=details&task_id=5
      • Summary
        SVN revision: 1055
        Status: Rewritten, untested since
        Console commands: /me /me_team
        Cvars: g_actionPrefix

        Allows a greater range of expression in chat by replicating IRC's /me command, usable in console and messagemode lines (i.e. /me is equivalent to /say /me, and /me_team is equivalent to /say_team /me). The message is printed white (unless a colour escape is used) and preceded by g_actionPrefix. If the actionPrefix string is empty, the functionality is disabled (if you want an empty string, try " ").