From: nveid Date: Mon, 9 Apr 2007 03:51:14 +0000 (+0000) Subject: Changed the way we convert flag tables when coming from pennmush. X-Git-Tag: 0.72p4~18 X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=a7124cb79ab5bdc120d5ad12c1e3eccb88c1d2d3;p=cobramush.git Changed the way we convert flag tables when coming from pennmush. (cherry picked from commit 716fcf28d1e2db23752f71d19bfaa04058b76be5) --- diff --git a/game/txt/changes/0.72p4 b/game/txt/changes/0.72p4 index f4c26b3..7d4d7ac 100644 --- a/game/txt/changes/0.72p4 +++ b/game/txt/changes/0.72p4 @@ -13,6 +13,8 @@ CobraMUSH Version 0.72p4 * Parts of the RPMODE_SYS were not appropriately enclosed in ifdef statements, causing all non-privileged players to be rpgagged on channels. [RLB] + * Improved PennMUSH to CobraMUSH flag conversion code for flags that are + set to be of 'ANY' type. [RLB] * Fixed a bug related to uninitialized lastmod entries [AEJ] * Fixed SHS 64-bit incompatability, to allow password encryption to work properly on 64-bit platforms [AEJ] diff --git a/hdrs/flags.h b/hdrs/flags.h index 96f7588..d087bd1 100644 --- a/hdrs/flags.h +++ b/hdrs/flags.h @@ -122,6 +122,7 @@ extern void decompile_flags(dbref player, dbref thing, const char *name); #define NOTYPE 0xFFFF #define ALLTYPES (0 | TYPE_ROOM | TYPE_THING | TYPE_EXIT | TYPE_PLAYER | TYPE_DIVISION) +#define ALL_PENNMUSH_TYPES (0 | TYPE_ROOM | TYPE_THING | TYPE_EXIT | TYPE_PLAYER) diff --git a/hdrs/mushdb.h b/hdrs/mushdb.h index 2ccafc6..c87497b 100644 --- a/hdrs/mushdb.h +++ b/hdrs/mushdb.h @@ -222,6 +222,8 @@ int unfindable(dbref); #define HAS_COBRADBFLAG(x,y) (!(x & DBF_TYPE_GARBAGE) && (x & y)) /* Macro exists so cobra & penn dbflags can exist as same DBFs */ +#define IS_COBRA_DB(x) (!(x & DBF_TYPE_GARBAGE)) + /* Reboot DB flag macros - these should be defined whether or not the * corresponding system option is defined * They are successive binary numbers diff --git a/src/bsd.c b/src/bsd.c index d9668e8..2f6a8bb 100644 --- a/src/bsd.c +++ b/src/bsd.c @@ -586,10 +586,10 @@ main(int argc, char **argv) } #endif #ifdef HAS_TEXTDOMAIN - textdomain("pennmush"); + textdomain("cobramush"); #endif #ifdef HAS_BINDTEXTDOMAIN - bindtextdomain("pennmush", "../po"); + bindtextdomain("cobramush", "../po"); #endif /* Build the locale-dependant tables used by PCRE */ diff --git a/src/flags.c b/src/flags.c index c956d48..5f6439e 100644 --- a/src/flags.c +++ b/src/flags.c @@ -498,8 +498,12 @@ flag_read(FILE * in) db_read_this_labeled_string(in, "type", &tmp); if(!strcmp(tmp, "ANY")) f->type = ALLTYPES; - else + else { f->type = string_to_privs(type_privs, tmp, 0); + /* Check to See if we're converting from Penn.. if so, change their Any to include our Any */ + if(!IS_COBRA_DB(flagdb_flags) && f->type == ALL_PENNMUSH_TYPES) + f->type = ALLTYPES; + } db_read_this_labeled_string(in, "perms", &tmp); f->perms = string_to_privs(flag_privs, tmp, 0); db_read_this_labeled_string(in, "negate_perms", &tmp); @@ -711,6 +715,8 @@ init_flag_table(const char *ns) return; } + do_rawlog(LT_ERR, T("Initializing flag table.")); + ptab_init(n->tab); /* do regular flags first */ for (f = n->flag_table; f->name; f++) { @@ -727,6 +733,8 @@ init_flag_table(const char *ns) T("FLAG INIT: flag alias %s matches no known flag."), a->alias); } flag_add_additional(); + + do_rawlog(LT_ERR, T("Flag table initialization complete.")); } /* This is where the developers will put flag_add statements to create