Re: Netiquette? and show connection

From: Angus Mezick (angus@EDGIL.CCMAIL.COMPUSERVE.COM)
Date: 05/19/98


nitwit.(tony)
Please take the time to read the faq yourself and stop being a hypocrit.  I see
no circle related content.  Screw the [OFF TOPIC].  If you wish to be off topic
get it OFF the list.
--Angus

obcircle:
I don't know if i posted this before but here is a nice little util i came up
for finding what zones connected to a ceretain zone.
I leave it up to you to do the show connection part of the command.

void show_connections(struct char_data *ch,char *arg)
{
   int zone_num;
   int j,i,k,tele_targ;
   int start_room;
   char *buf;

   if(!*arg)
      {
      send_to_char("USAGE: show connections .\r\n",ch);
      send_to_char("USAGE: show connections <zone_num>\r\n",ch);
      return;
      }
   else if (*arg=='.')
      zone_num=world[ch->in_room].zone;
   else
      {
      j=atoi(arg);
      for(zone_num=0;zone_num<=top_of_zone_table;zone_num++)
    if(zone_table[zone_num].number==j)
       break;
      }
   if(zone_num>=0 && zone_num <=top_of_zone_table)
      {
      buf=get_buffer(32750);
      start_room=zone_table[zone_num].number*100;

      sprintf(buf,"Connections from %-30.30s\r\n"

"----------------------------------------------------------------------\r\n",
         zone_table[zone_num].name);

      for(i=0,k=0;i<=top_of_world;i++)
    {
    for(j=0;j<NUM_OF_DIRS;j++)
       {
       if(world[i].zone==zone_num    &&
          world[i].dir_option[j]     &&
          world[i].dir_option[j]->to_room!=-1 &&
          world[world[i].dir_option[j]->to_room].zone!=zone_num)
          {
          sprintf(buf+strlen(buf),"%3d: [%5d] %-23.23s -(%-5.5s)-> [%5d]
%-23.23s\r\n",++k,
             world[i].number, world[i].name,dirs[j],
             world[world[i].dir_option[j]->to_room].number,
             world[world[i].dir_option[j]->to_room].name);
          }
       }

    if((world[i].zone==zone_num) &&
       world[i].tele             &&
       (world[i].tele->targ!=0))
       {
       if(((tele_targ=real_room(world[i].tele->targ))>=0)&&
          (world[tele_targ].zone!=zone_num))
          {
          sprintf(buf+strlen(buf),"%3d: [%5d] %-23.23s -(%-5.5s)-> [%5d]
%-23.23s\r\n",++k,
             world[i].number, world[i].name,"tport",
             world[tele_targ].number,
             world[tele_targ].name);
          }
       }


    }
      sprintf(buf+strlen(buf),"\r\nConnections to %-30.30s\r\n"

"----------------------------------------------------------------------\r\n",
         zone_table[zone_num].name);
      for(i=0,k=0;i<=top_of_world;i++)
    {
    for(j=0;j<NUM_OF_DIRS;j++)
       {
       if(world[i].zone!=zone_num    &&
          world[i].dir_option[j]     &&
          world[i].dir_option[j]->to_room!=-1 &&
          world[world[i].dir_option[j]->to_room].zone==zone_num)
          {
          sprintf(buf+strlen(buf),"%3d: [%5d] %-23.23s -(%-5.5s)-> [%5d]
%-23.23s\r\n",++k,
             world[i].number, world[i].name,dirs[j],
             world[world[i].dir_option[j]->to_room].number,
             world[world[i].dir_option[j]->to_room].name);
          }
       }
    if((world[i].zone!=zone_num) &&
       world[i].tele             &&
       (world[i].tele->targ!=0))
       {
       if(((tele_targ=real_room(world[i].tele->targ))>=0)&&
          (world[tele_targ].zone==zone_num))
          {
          sprintf(buf+strlen(buf),"%3d: [%5d] %-23.23s -(%-5.5s)-> [%5d]
%-23.23s\r\n",++k,
             world[i].number, world[i].name,"tport",
             world[tele_targ].number,
             world[tele_targ].name);
          }
       }
    }
      for(i=0;i<=top_of_objt;i++)
    {
    if((obj_proto[i].obj_flags.type_flag==ITEM_PORTAL) &&
       (obj_proto[i].obj_flags.value[0]!=0))
       {
       if(((tele_targ=real_room(obj_proto[i].obj_flags.value[0]))>=0) &&
          (world[tele_targ].zone==zone_num))
          sprintf(buf+strlen(buf),"%3d: [%5d] %-23.23s -(%-5.5s)-> [%5d]
%-23.23s\r\n",++k,
             obj_index[i].virtual,
             obj_proto[i].short_description,
             "prtal",
             world[tele_targ].number,
             world[tele_targ].name);
       }
    }

      if(ch->desc)
    page_string(ch->desc,buf,1);
      release_buffer(buf);
      return;
      }
}


______________________________ Forward Header __________________________________
Subject: Re:  Netiquette? [OFF TOPIC]
Author:  INTERNET:CIRCLE@POST.QUEENSU.CA at CSERVE
Date:    5/18/98 5:52 PM
From: Tony Maro <tmaro@TACSYS.COM>

READ THE FAQ!  YES I AM YELLING!  Geez - everyone's
been through this before.  Don't attempt a MUD if you are
not a veteran programmer.  If you do, keep your mouth shut
and don't waist everyone's time with stupid questions.  The first
thing you read when you download the code is don't try it
if you aren't an experienced programmer!  I believe the statement
made by those who developed Circle is... A mud is NOT a
programming learning experience!

There.  I said it.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST