[NEWBIE] manualcolour 3.1 and buffer problems

From: Tom York (tyork@durge.org)
Date: 04/02/03


Hello all,

I've taken the manualcolour 3.1 snippet that was uploaded to the
developer's resources site a couple of days ago and used it (the codebase
I'm using is 3.0bpl22). Initially it all seemed fine, and I happily played
about colouring in titles and bits of room descriptions for a while.

I've run into a fairly serious problem. My version of do_score involves
quite a lot of colours, so I wanted to replace the endless CCYEL, CCNRM
(etc) calls with &y, &n, whatever. The first application of this works
fine:

  send_to_char(ch, "Level: &y%d&n  Sex: &c%s&n  Race: &c%s&n  Sphere:
&c%s&n  Career: &c%s&n\r\n",
      GET_LEVEL(ch), sbuf, racetitle[GET_RACE(ch)], buf,
      career_info[GET_CAREER(ch)].name);

replacing

  send_to_char(ch, "Level: %s%d%s  Sex: %s%s%s  Race: %s%s%s  Sphere:
%s%s%s  Career: %s%s%s\r\n",
      CCYEL(ch, C_NRM), GET_LEVEL(ch), CCNRM(ch, C_NRM),
      CCCYN(ch, C_NRM), sbuf, CCNRM(ch, C_NRM),
      CCCYN(ch, C_NRM), racetitle[GET_RACE(ch)], CCNRM(ch, C_NRM),
      CCCYN(ch, C_NRM), buf, CCNRM(ch, C_NRM),
      CCCYN(ch, C_NRM), career_info[GET_CAREER(ch)].name, CCNRM(ch, C_NRM));

(Sorry about the line lengths...)

However, when I try to do the same thing to the next line (which is the
character's six ability scores, so twelve colour codes get put in)
something very odd happens: that line gets displayed correctly, but no
more of the score output, and instead we get repeated fragments of the
*previous* output (a room description).

Having looked through the archives it seemed fairly likely that I was
getting a buffer overflow. I've tried increasing the size of (what I
believe to be) the relevant buffers (LARGE_BUFSIZE, and, although I didn't
really want to mess with it, MAX_SOCK_BUF). Several of the other buffers
have already been enlarged to cope with things like an augmented skill
list. The ones that are changed are:

SMALL_BUFSIZE           from 8192 to 24576
MAX_STRING_LENGTH       from 8192 to 24576
MAX_INPUT_LENGTH        from 256 to 1024
MAX_RAW_INPUT_LENGTH    from 1024 to 2048

I returned MAX_SOCK_BUF (and thereby LARGE_BUFSIZE) to their original
values, as that didn't solve the problem.

So, any ideas? Is it just that I'm trying to send too many colour codes at
once, and, if so, which buffer needs to be enlarged? Is it because the
snippet is in some way Circle 3.1-specific, so my 3.0 codebase can't cope?

Thanks in advance for any help...

Tom
--
Tension, apprehension, and dissention have begun.

        -Alfred Bester

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/26/03 PDT