From 33e6a8c41b1024091dd78c9a438feff889cb9100 Mon Sep 17 00:00:00 2001 From: Rumble Date: Sun, 4 May 2008 21:49:11 +0000 Subject: [PATCH] [May 04 2008] - Rumble Fixed numerous warnings for gcc -g -O2 -W -Wshadow -Wcast-qual flags. Fixed zpurge mudlog to use zone vnum not rnum. (thanks Jamdog) Fix to parse_mobile conversion to 128 bits. (thanks Jamdog) Changed autorun.sh from 9091 to 4000. (thanks John Smith) [Apr 27 2008] - Rumble Removed some defunct gemote code. (thanks Fizban) [Apr 26 2008] - Rumble Added README.BSD. (thanks Blix) Cleaned up act.comm.c, mobs can now use comm channels. (thanks Rhade) --- autorun.sh | 2 +- changelog | 14 +++-- doc/README.BSD | 116 ++++++++++++++++++++++++++++++++++++++++++ lib/world/wld/12.wld | 12 +++++ src/act.informative.c | 2 +- src/act.wizard.c | 12 ++--- src/asciimap.c | 2 +- src/comm.c | 42 +++++++-------- src/db.c | 2 +- 9 files changed, 169 insertions(+), 35 deletions(-) create mode 100644 doc/README.BSD diff --git a/autorun.sh b/autorun.sh index ad198e4..15e6e44 100755 --- a/autorun.sh +++ b/autorun.sh @@ -33,7 +33,7 @@ ulimit -c unlimited # The port on which to run the MUD -PORT=9091 +PORT=4000 # Default flags to pass to the MUD server (see admin.txt for a description # of all flags). diff --git a/changelog b/changelog index 115fb41..421b918 100644 --- a/changelog +++ b/changelog @@ -3,6 +3,16 @@ help, find any bugs, or have ideas for improvement please stop by TBA at telnet://tbamud.com:9091 or email rumble@tbamud.com --Rumble tbaMUD 3.56 +[May 04 2008] - Rumble + Fixed numerous warnings for gcc -g -O2 -W -Wshadow -Wcast-qual flags. + Fixed zpurge mudlog to use zone vnum not rnum. (thanks Jamdog) + Fix to parse_mobile conversion to 128 bits. (thanks Jamdog) + Changed autorun.sh from 9091 to 4000. (thanks John Smith) +[Apr 27 2008] - Rumble + Removed some defunct gemote code. (thanks Fizban) +[Apr 26 2008] - Rumble + Added README.BSD. (thanks Blix) + Cleaned up act.comm.c, mobs can now use comm channels. (thanks Rhade) [Apr 07 2008] - Rumble Fixed typos in lib/misc/messages and socials.new [Apr 04 2008] - jeremyosborne @@ -169,7 +179,6 @@ used if Graphviz is not available. empty." message is now displayed. Merging changes to trunk for: utils.h, utils.c and structs.h doxygen comments Adding file dox_withGraphs.doxyfile - tbaMUD 3.55 [Jan 17 2008] - Rumble Updated files for 3.55 release. @@ -201,7 +210,6 @@ tbaMUD 3.55 [Dec 15 2007] - Rumble Showvnums shows [T#] for a single attached trig or [TRIGS] for multiple attached trigs (except for rooms since there is plenty of room to list all attached trigs). Fixed bug where showvnums would not show if attached. (thanks Sryth) - tbaMUD 3.54 [Nov 12 2007] - Rumble Updated users command to fix GET_INVIS_LEV bug. @@ -278,7 +286,6 @@ Increased the size of a mail message from 4k to 8k. [Aug 17 2007] - Rumble 128 bit fixes: pfile conversion, world sector conversion, and player flags. (thanks Jamdog) Added stop_fighting calls in do_flee to fix stock bug. (thanks Juras) - tbaMUD 3.53 [Jul 01 2007] - Rumble Added run_autowiz to do_cheat. (thanks Fizban) @@ -320,7 +327,6 @@ tbaMUD 3.53 Fixed nogos/nowiz from flagging everyone in who. Fixed numerous SYSERR's where mobs were using player only specials. Added 128 bits patch by Niese Petersen with numerous updates and fixes. - tbaMUD 3.52 [Apr 14 2007] - Rumble IP's only visible to LVL_GOD and above now for the paranoid people out there. diff --git a/doc/README.BSD b/doc/README.BSD new file mode 100644 index 0000000..2caafc9 --- /dev/null +++ b/doc/README.BSD @@ -0,0 +1,116 @@ + Compiling tbaMUD under BSD + based on UNIX readme for circlemud + by Jeremy Elson + For help, visit http://www.tbamud.com + +Compiling tbaMUD is easy using FreeBSD. If you plan on compiling on a +FreeBSD machine, these instructions are for you. If not, check the main +README file to get a list of other operating systems that can be used to +compile and run tbaMUD. + +Current versions of tbaMUD use the GNU 'autoconf' package to +automatically determine most of the important characteristics of your +system, so chances are good that tbaMUD will compile correctly on any +UNIX system -- even one that we have never seen before. However, if you +do have problems, please visit http://www.tbamud.com so that we +can try to make tbaMUD work with your system. + + +1) Download the latest version of tbaMUD. You can always find the + latest version at the following site: + + http://www.tbamud.com + + +2) Unpack the archive. If you have the .tar.gz version, uncompress it + using gzip (GNU unzip) and the tar archiver. (Both of these utilities + can be downloaded from ftp.gnu.ai.mit.edu:/pub/gnu if you don't have + them.) To unpack the archive on a UNIX system, type: + + gzip -dc tbaMUD-xxxx.tgz | tar xvf - + + +3) Configure tbaMUD for your system. tbaMUD must be configured using + the 'configure' program which attempts to guess correct values for + various system-dependent variables used during compilation. It uses + those values to create a 'Makefile' and a header file called 'conf.h'. + + From tbaMUD's root directory, type + + ./configure + + If you're using 'csh' on an old version of System V, csh might try to + execute 'configure' itself, giving you a message like "Permission denied" + when you try to run "./configure". If so, type "sh ./configure" instead. + + 'configure' can take several minutes if you're using a slow computer. + + 'configure' will attempt to use the 'gcc' compiler if it exists; if not, + it will try 'cc'. If you want to use a different compiler, set the + 'CC' environment variable to the name of the compiler you wish to use. + + For example, if you want to use the 'xlc' compiler, and your shell is + csh or tcsh: + + setenv CC xlc + ./configure + + Or, if you want to use the 'xlc' compiler, and your shell is sh or bash: + + CC=xlc ./configure + + This will tell 'configure' to use the 'xlc' compiler instead of 'gcc'. + + +4) Build the tbaMUD server. This must be done from the 'src' directory. + Type: + + cd src; gmake all + + This will build tbaMUD proper as well as its 10 or so ancillary + utilities, which can take anywhere from 5 minutes to an hour depending + on the speed of your computer. + + Note that in the future, when you need to recompile tbaMUD as you make + changes to the code, it is NOT necessary to run 'configure' again (it + should only be run once, after the first time you unpack tbaMUD from + its .tar file). If you move the source code to a different computer, + you should reconfigure it by deleting the file 'config.cache' and + running 'configure' again. + + The first time you try to compile tbaMUD, you will be asked to read the + tbaMUD license. Please read it! + + +5) Go back to tbaMUD's root directory (by typing "cd ..") and run the + tbaMUD server. The easiest way to do this the first time is + to use the 'autorun' script, which can be run in the background by + typing: + + ./autorun & + + Make sure to do this in tbaMUD's root directory, not the src directory + that you used for the previous step. A file called 'syslog' will start + growing in the same directory that contains tbaMUD's log messages. + + If you're using 'csh' on an old version of System V, csh might try to + execute 'autorun' itself, giving you a message like "Permission denied" + when you try to run "./autorun". If so, type "sh ./autorun &" instead. + + +6) Wait until the line 'No connections. Going to sleep.' appears in the + syslog. This indicates that the server is ready and waiting for + connections. It shouldn't take more than about 30 seconds for the MUD + to reach this state, though performance will vary depending on how fast + your computer is. + + If a file appears called 'syslog.CRASH', the MUD has terminated + (probably abnormally). Check the contents of syslog.CRASH to see + what error was encountered. + + +7) Type 'telnet localhost 4000' to connect. The first person to log in + will be made an implementor (level 34) with all powers. + + +(write to help@tbamud.com for help) diff --git a/lib/world/wld/12.wld b/lib/world/wld/12.wld index 7a3c578..0e01b08 100644 --- a/lib/world/wld/12.wld +++ b/lib/world/wld/12.wld @@ -31,6 +31,18 @@ The Ice Box Of The Gods~ and maybe someone will come and get you. ~ 12 1208 0 0 0 0 +E +test extra~ +This is a test extradesc. +If I am correct, the mud will not boot after this is saved. + + +The blank lines above this is the reason. +Ok, that did not work... + + Maybe this will + +~ S #1203 The Gods' Mortal Board Room~ diff --git a/src/act.informative.c b/src/act.informative.c index 4fb0ee6..6929f71 100644 --- a/src/act.informative.c +++ b/src/act.informative.c @@ -1639,7 +1639,7 @@ ACMD(do_where) ACMD(do_levels) { char buf[MAX_STRING_LENGTH], arg[MAX_STRING_LENGTH]; - size_t len = 0, nlen; + size_t len = 0, nlen; int i, ret, min_lev=1, max_lev=LVL_IMMORT, val; if (IS_NPC(ch)) { diff --git a/src/act.wizard.c b/src/act.wizard.c index 4c876a3..cee3854 100644 --- a/src/act.wizard.c +++ b/src/act.wizard.c @@ -2458,7 +2458,7 @@ ACMD(do_show) continue; } nlen = print_zone_to_buf(buf + len, sizeof(buf) - len, zrn, 0); - if (len + nlen >= sizeof(buf) || nlen < 0) + if (len + nlen >= sizeof(buf)) break; len += nlen; } @@ -2553,13 +2553,13 @@ ACMD(do_show) continue; if (W_EXIT(i,j)->to_room == 0) { nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: (void ) [%5d] %-*s%s (%s)\r\n", ++k, GET_ROOM_VNUM(i), count_color_chars(world[i].name)+40, world[i].name, QNRM, dirs[j]); - if (len + nlen >= sizeof(buf) || nlen < 0) + if (len + nlen >= sizeof(buf)) break; len += nlen; } if (W_EXIT(i,j)->to_room == NOWHERE && !W_EXIT(i,j)->general_description) { nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: (Nowhere) [%5d] %-*s%s (%s)\r\n", ++k, GET_ROOM_VNUM(i), count_color_chars(world[i].name)+ 40, world[i].name, QNRM, dirs[j]); - if (len + nlen >= sizeof(buf) || nlen < 0) + if (len + nlen >= sizeof(buf)) break; len += nlen; } @@ -2573,7 +2573,7 @@ ACMD(do_show) for (i = 0, j = 0; i <= top_of_world; i++) if (ROOM_FLAGGED(i, ROOM_DEATH)) { nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: [%5d] %s%s\r\n", ++j, GET_ROOM_VNUM(i), world[i].name, QNRM); - if (len + nlen >= sizeof(buf) || nlen < 0) + if (len + nlen >= sizeof(buf)) break; len += nlen; } @@ -2586,7 +2586,7 @@ ACMD(do_show) for (i = 0, j = 0; i <= top_of_world; i++) if (ROOM_FLAGGED(i, ROOM_GODROOM)) { nlen = snprintf(buf + len, sizeof(buf) - len, "%2d: [%5d] %s%s\r\n", ++j, GET_ROOM_VNUM(i), world[i].name, QNRM); - if (len + nlen >= sizeof(buf) || nlen < 0) + if (len + nlen >= sizeof(buf)) break; len += nlen; } @@ -4050,7 +4050,7 @@ ACMD(do_zpurge) purge_room(real_room(vroom)); } send_to_char(ch, "Purged zone #%d: %s.\r\n", zone_table[zone].number, zone_table[zone].name); - mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s purged zone %d (%s)", GET_NAME(ch), zone, zone_table[zone].name); + mudlog(NRM, MAX(LVL_GRGOD, GET_INVIS_LEV(ch)), TRUE, "(GC) %s purged zone %d (%s)", GET_NAME(ch), zone_table[zone].number, zone_table[zone].name); } else { for (room = 0; room <= top_of_world; room++) { diff --git a/src/asciimap.c b/src/asciimap.c index b1970e6..f25cb2c 100644 --- a/src/asciimap.c +++ b/src/asciimap.c @@ -232,7 +232,7 @@ static void MapArea(room_rnum room, struct char_data *ch, int x, int y, int min, continue; } - if ( (pexit = world[room].dir_option[door]) > 0 && + if ( (pexit = world[room].dir_option[door]) != NULL && (pexit->to_room > 0 ) && (pexit->to_room != NOWHERE) && (!IS_SET(pexit->exit_info, EX_CLOSED))) { /* A real exit */ diff --git a/src/comm.c b/src/comm.c index d9e178a..269ab9e 100644 --- a/src/comm.c +++ b/src/comm.c @@ -462,7 +462,7 @@ void copyover_recover() } /* Init sockets, run game, and cleanup sockets */ -static void init_game(ush_int port) +static void init_game(ush_int local_port) { /* We don't want to restart if we crash before we get up. */ touch(KILLSCRIPT_FILE); @@ -475,7 +475,7 @@ static void init_game(ush_int port) /* If copyover mother_desc is already set up */ if (!fCopyOver) { log ("Opening mother connection."); - mother_desc = init_socket (port); + mother_desc = init_socket (local_port); } event_init(); @@ -523,7 +523,7 @@ static void init_game(ush_int port) /* init_socket sets up the mother descriptor - creates the socket, sets * its options up, binds it, and listens. */ -static socket_t init_socket(ush_int port) +static socket_t init_socket(ush_int local_port) { socket_t s; struct sockaddr_in sa; @@ -598,7 +598,7 @@ static socket_t init_socket(ush_int port) memset((char *)&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; - sa.sin_port = htons(port); + sa.sin_port = htons(local_port); sa.sin_addr = *(get_bind_addr()); if (bind(s, (struct sockaddr *) &sa, sizeof(sa)) < 0) { @@ -694,7 +694,7 @@ static int get_max_players(void) * new connections, polling existing connections for input, dequeueing * output and sending it out to players, and calling "heartbeat" functions * such as mobile_activity(). */ -void game_loop(socket_t mother_desc) +void game_loop(socket_t local_mother_desc) { fd_set input_set, output_set, exc_set, null_set; struct timeval last_time, opt_time, process_time, temp_time; @@ -719,8 +719,8 @@ void game_loop(socket_t mother_desc) if (descriptor_list == NULL) { log("No connections. Going to sleep."); FD_ZERO(&input_set); - FD_SET(mother_desc, &input_set); - if (select(mother_desc + 1, &input_set, (fd_set *) 0, (fd_set *) 0, NULL) < 0) { + FD_SET(local_mother_desc, &input_set); + if (select(local_mother_desc + 1, &input_set, (fd_set *) 0, (fd_set *) 0, NULL) < 0) { if (errno == EINTR) log("Waking up to process signal."); else @@ -733,9 +733,9 @@ void game_loop(socket_t mother_desc) FD_ZERO(&input_set); FD_ZERO(&output_set); FD_ZERO(&exc_set); - FD_SET(mother_desc, &input_set); + FD_SET(local_mother_desc, &input_set); - maxdesc = mother_desc; + maxdesc = local_mother_desc; for (d = descriptor_list; d; d = d->next) { #ifndef CIRCLE_WINDOWS if (d->descriptor > maxdesc) @@ -786,8 +786,8 @@ void game_loop(socket_t mother_desc) return; } /* If there are new connections waiting, accept them. */ - if (FD_ISSET(mother_desc, &input_set)) - new_descriptor(mother_desc); + if (FD_ISSET(local_mother_desc, &input_set)) + new_descriptor(local_mother_desc); /* Kick out the freaky folks in the exception set and marked for close */ for (d = descriptor_list; d; d = next_d) { @@ -1070,7 +1070,7 @@ void echo_on(struct descriptor_data *d) /* Color replacement arrays. Renx -- 011100 */ #define A "\x1B[" -const char *ANSI[] = { "@", A"0m",A"0m",A"0;30m",A"0;34m",A"0;32m",A"0;36m",A"0;31m", +char *ANSI[] = { "@", A"0m",A"0m",A"0;30m",A"0;34m",A"0;32m",A"0;36m",A"0;31m", A"0;35m",A"0;33m",A"0;37m",A"1;30m",A"1;34m",A"1;32m",A"1;36m",A"1;31m", A"1;35m",A"1;33m",A"1;37m",A"40m",A"44m",A"42m",A"46m",A"41m",A"45m", A"43m",A"47m",A"5m",A"4m",A"1m",A"7m" @@ -1090,7 +1090,7 @@ static size_t proc_colors(char *txt, size_t maxlen, int parse) CREATE(d, char, maxlen); p = d; - for( ; *s && (d-p < maxlen); ) { + for( ; *s && ((size_t)(d-p) < maxlen); ) { /* no color code - just copy */ if (*s != '@') { *d++ = *s++; @@ -1119,7 +1119,7 @@ static size_t proc_colors(char *txt, size_t maxlen, int parse) if ((*s) == CCODE[i]) { /* if so :*/ /* c now points to the first char in color code*/ - for(c = (char *)ANSI[i] ; *c && (d-p < maxlen); ) + for(c = ANSI[i] ; *c && ((size_t)(d-p) < maxlen); ) *d++ = *c++; break; @@ -2696,7 +2696,7 @@ static void circle_sleep(struct timeval *timeout) static void handle_webster_file(void) { FILE *fl; struct char_data *ch = find_char(last_webster_teller); - char info[MAX_STRING_LENGTH], line[READ_SIZE]; + char retval[MAX_STRING_LENGTH], line[READ_SIZE]; size_t len = 0, nlen = 0; last_webster_teller = -1L; @@ -2706,7 +2706,7 @@ static void handle_webster_file(void) { fl = fopen("websterinfo", "r"); if (!fl) { - send_to_char(ch, "It seems Merriam-Webster is offline..\r\n"); + send_to_char(ch, "It seems the dictionary is offline..\r\n"); return; } @@ -2714,19 +2714,19 @@ static void handle_webster_file(void) { get_line(fl, line); while (!feof(fl)) { - nlen = snprintf(info + len, sizeof(info) - len, "%s\r\n", line); - if (len + nlen >= sizeof(info) || nlen < 0) + nlen = snprintf(retval + len, sizeof(retval) - len, "%s\r\n", line); + if (len + nlen >= sizeof(retval)) break; len += nlen; get_line(fl, line); } - if (len >= sizeof(info)) { + if (len >= sizeof(retval)) { const char *overflow = "\r\n**OVERFLOW**\r\n"; - strcpy(info + sizeof(info) - strlen(overflow) - 1, overflow); /* strcpy: OK */ + strcpy(retval + sizeof(retval) - strlen(overflow) - 1, overflow); /* strcpy: OK */ } fclose(fl); send_to_char(ch, "You get this feedback from Merriam-Webster:\r\n"); - page_string(ch->desc, info, 1); + page_string(ch->desc, retval, 1); } diff --git a/src/db.c b/src/db.c index 7d0e09d..13b256c 100644 --- a/src/db.c +++ b/src/db.c @@ -1634,7 +1634,7 @@ void parse_mobile(FILE *mob_f, int nr) exit(1); } - if (((retval = sscanf(line, "%s %s %s %s %s %s %s %s %d %c", f1, f2, f3, f4, f5, f6, f7, f8, t + 2, &letter)) == 10) && (bitwarning == TRUE)) { + if (((retval = sscanf(line, "%s %s %s %s %s %s %s %s %d %c", f1, f2, f3, f4, f5, f6, f7, f8, t + 2, &letter)) != 10) && (bitwarning == TRUE)) { /* Let's make the implementor read some, before converting his world files. */ log("WARNING: Conventional mobile files detected. See config.c."); exit(1);