• The power of printfile_random()

    From Xenos #1@60.Wwivnet@11:1/101 to All on Wed Sep 11 03:12:35 2024

    If you look at our codebase, we have this powerful function called printfile_random(). What it does is take the basename of the file, checks in gfiles/ directory if a file with the basename and .0 "extension" exists. If a dot-zero file exists, it will check for files with extension .{number-here} then display one of these randomly.

    In our codebase, it is used only ONCE, in lilo.cpp when it displays the WELCOME file. If you put a bunch of welcome.0 welcome.1 welcome.2 files in gfiles, it will randomly show one of those.

    We can mod our source to allow for this kind of behavior for all sorts of files that we display in our BBS.

    -x

    A .-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
    /*\ | /\liens' /\lcove! WWIV on Linux, Taguig, Metro Manila, Philippines |
    / v \`-=-=-=-=-=-=-=-=-=-=-=-[ WWIV Development ]-=-=--=-=-=-=-=-=-=-=-=-=-'

                 
    --- WWIVToss v.1.52
    * Origin: http://www.weather-station.org * Bel Air, MD -USA (11:1/101.0)
  • From Rushfan #1@513.Wwivnet@11:1/101 to Xenos #1 on Fri Sep 13 10:00:07 2024


    We can mod our source to allow for this kind of behavior for all sorts
    of files

    Great find, yes this was probably added as part of 4.3 which was essentially a "take 4.24 and add a bunch of mods that most people wanted into the product". The biggest changes were Zu's menu mod and Atani's FOSSIL mod but many other great mods were incorporated (I joined in about half way through that dev cycle before pivoting to a win32 native 4.31 which turned into 5.0)

    It'd be good to use that in more places and make sure there is a menu command that can invoke it.

    rushfan



    --- WWIVToss v.1.52
    * Origin: http://www.weather-station.org * Bel Air, MD -USA (11:1/101.0)