send_to_xxx

From: Edward J Glamkowski (eglamkowski@angelfire.com)
Date: 05/03/02


Updated stex.txt on the ftp site (untested, though):

comm.h:
void  send_to_except(struct char_data *ch, const char *messg, ...) __attribute__ ((format (printf, 2, 3)));

comm.c:
void  send_to_except(struct char_data *ch, const char *messg, ...)
{
        struct descriptor_data *i;
        va_list args;

        if (messg == NULL)
                return;

        for (i = descriptor_list; i; i = i->next)
        {
                if (STATE(i) != CON_PLAYING)
                        continue;

                if (i->character == ch)
                        continue;

                va_start(args, messg);
                vwrite_to_output(i, messg, args);
                va_end(args);
        }
}



And then added in a send_to_zone function which is tested:

comm.h:
void  send_to_zone(zone_rnum zone, const char *messg, ...) __attribute__ ((format (printf, 2, 3)));

comm.c:
void send_to_zone(zone_rnum zone, const char *messg, ...)
{
        struct descriptor_data *i;
        va_list args;

        if (messg == NULL)
                return;

        for (i = descriptor_list; i; i = i->next) {
                if (STATE(i) != CON_PLAYING)
                        continue;

                if (IN_ZONE(i->character) != zone)
                        continue;

                va_start(args, messg);
                vwrite_to_output(i, messg, args);
                va_end(args);
        }
}


For those not reading the weather email I just sent, here's the
IN_ZONE macro used above (put in utils.h after IN_ROOM macro):

#define IN_ZONE(ch)  (world[IN_ROOM((ch))].zone)




Is your boss reading your email? ....Probably
Keep your messages private by using Lycos Mail.
Sign up today at http://mail.lycos.com

--
   +---------------------------------------------------------------+
   | 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/25/03 PDT