Patch_list Patch Version: Version 1.0 (Initial Release) Date: 2003/06/15 Author: Ken Ray (kenr86@hotmail.com) If you are like me, you probably have several different Circle codebases running concurrently on your server. One may be the stock release, another your current production mud, and one or two others testing some mew code feature or smippet. How do you know what one you are running at any one time? Any what code have you added to a particular codebase? I added this as an extension to the standard "version" command, which for immortals, will give a list of those patches that have been added. For example: Welcome to the land of CircleMUD! May your visit here be... Interesting. [ 1204] The Immortal Board Room [ INDOORS ] The main hang out of the Gods, the Immortal Board Room is the place to be. Gods exchange messages here most every day. The mortal board room is to the east and the meeting room for the gods is to the south. To the north is the Gods' Inn and to the west is a post office for Gods. There is a large staircase leading down to the main temple in the city of Midgaard. In the northeast corner you spot a small staircase leading upwards. [ Exits: n e s w u d ] A large bulletin board is mounted on a wall here. It glows with a faint aura. > version CircleMUD, version 3.1 The following patches have been installed: 0: Patch list version 1.0 (2003/06/15) > The code is real simple, only three files are changed. You can snip the lines below and feed them friectly into patch if you want. =============================================================================== diff -BbuprN -x '*.o' circle-3.1-stock/src/act.informative.c circle-3.1-ken/src/act.informative.c --- circle-3.1-stock/src/act.informative.c 2003-06-01 11:58:26.000000000 -0500 +++ circle-3.1-ken/src/act.informative.c 2003-06-15 19:55:04.000000000 -0500 @@ -1250,6 +1250,8 @@ ACMD(do_users) /* Generic page_string function for displaying text */ ACMD(do_gen_ps) { + int patch_num; + switch (subcmd) { case SCMD_CREDITS: page_string(ch->desc, credits, 0); @@ -1283,6 +1285,11 @@ ACMD(do_gen_ps) break; case SCMD_VERSION: send_to_char(ch, "%s\r\n", circlemud_version); + if (GET_LEVEL(ch) >= LVL_IMMORT) { + send_to_char(ch, "The following patches have been installed:\r\n"); + for (patch_num = 0; **(patch_list + patch_num) != '\n'; patch_num++) + send_to_char(ch, "%d: %s\r\n", patch_num, patch_list[patch_num]); + } break; case SCMD_WHOAMI: send_to_char(ch, "%s\r\n", GET_NAME(ch)); diff -BbuprN -x '*.o' circle-3.1-stock/src/constants.c circle-3.1-ken/src/constants.c --- circle-3.1-stock/src/constants.c 2002-11-18 11:28:06.000000000 -0600 +++ circle-3.1-ken/src/constants.c 2003-06-15 19:52:11.000000000 -0500 @@ -17,6 +17,12 @@ cpp_extern const char *circlemud_version = "CircleMUD, version 3.1"; +const char *patch_list[] = +{ + "Patch list version 1.0 (2003/06/15)", + "\n" +}; + /* strings corresponding to ordinals/bitvectors in structs.h ***********/ diff -BbuprN -x '*.o' circle-3.1-stock/src/constants.h circle-3.1-ken/src/constants.h --- circle-3.1-stock/src/constants.h 2001-09-14 05:08:57.000000000 -0500 +++ circle-3.1-ken/src/constants.h 2003-06-15 19:33:15.000000000 -0500 @@ -38,3 +38,4 @@ extern size_t action_bits_count; extern size_t affected_bits_count; extern size_t extra_bits_count; extern size_t wear_bits_count; +extern const char *patch_list[]; =============================================================================== All you need to do is once you add a patch to code base, add a suitablely descriptive line to the "patch_list" array in constants.c - before the final "\n" line of course. How you format the line is completely up to you, of course. Use and enjoy, Ken Ray (kenr86@hotmail.com)