diff -puN new/comm.c src/comm.c
--- new/comm.c	2002-11-22 21:37:00.000000000 +0100
+++ src/comm.c	2002-11-27 17:07:04.000000000 +0100
@@ -82,7 +82,7 @@ extern const char *circlemud_version;
 extern int circle_restrict;
 extern int mini_mud;
 extern int no_rent_check;
-extern ush_int DFLT_PORT;
+extern int DFLT_PORT;
 extern const char *DFLT_DIR;
 extern const char *DFLT_IP;
 extern const char *LOGNAME;
@@ -114,6 +114,10 @@ FILE *logfile = NULL;		/* Where to send 
 const char *text_overflow = "**OVERFLOW**\r\n";
 int dg_act_check;		/* toggle for act_trigger */
 unsigned long pulse = 0;	/* number of pulses since game start */
+
+/* Port options ( These need to be altered in order to add more ports.) */
+int ports[10] = {4000,8080,1270,-1,-1,-1,-1,-1,-1,-1};
+socket_t mother_descs[10] = {4000,8080,1270,-1,-1,-1,-1,-1,-1,-1};
 
 /* functions in this file */
 RETSIGTYPE reread_wizlists(int sig);
@@ -127,9 +131,9 @@ void echo_off(struct descriptor_data *d)
 void echo_on(struct descriptor_data *d);
 void circle_sleep(struct timeval *timeout);
 int get_from_q(struct txt_q *queue, char *dest, int *aliased);
-void init_game(ush_int port);
+void init_game(int ports[]);
 void signal_setup(void);
-void game_loop(socket_t mother_desc);
+void game_loop(socket_t mother_descs[]);
 socket_t init_socket(ush_int port);
 int new_descriptor(socket_t s);
 int get_max_players(void);
@@ -210,8 +214,8 @@ void gettimeofday(struct timeval *t, str
 
 int main(int argc, char **argv)
 {
-  ush_int port;
-  int pos = 1;
+  extern int ports[10];
+  int i = 0, pos = 1;
   const char *dir;
 
 #if CIRCLE_GNU_LIBC_MEMORY_TRACK
@@ -227,8 +231,8 @@ int main(int argc, char **argv)
   /* Initialize the GUSI library calls.  */
   GUSIDefaultSetup();
 #endif
-
-  port = DFLT_PORT;
+  
+  ports[0] = DFLT_PORT;
   dir = DFLT_DIR;
 
   while ((pos < argc) && (*(argv[pos]) == '-')) {
@@ -299,8 +303,8 @@ int main(int argc, char **argv)
     if (!isdigit(*argv[pos])) {
       printf("Usage: %s [-c] [-m] [-q] [-r] [-s] [-d pathname] [port #]\n", argv[0]);
       exit(1);
-    } else if ((port = atoi(argv[pos])) <= 1024) {
-      printf("SYSERR: Illegal port number %d.\n", port);
+	} else if (!(ports[i] = atoi(argv[pos]))) {
+      printf("SYSERR: Illegal port number.\n");
       exit(1);
     }
   }
@@ -322,11 +326,9 @@ int main(int argc, char **argv)
 
   if (scheck)
     boot_world();
-  else {
-    log("Running game on port %d.", port);
-    init_game(port);
-  }
-
+  else 
+    init_game(ports);
+  
   log("Clearing game world.");
   destroy_db();
 
@@ -350,10 +352,11 @@ int main(int argc, char **argv)
 
 
 /* Init sockets, run game, and cleanup sockets */
-void init_game(ush_int port)
+void init_game(int ports[])
 {
-  socket_t mother_desc;
-
+  int i;
+  extern socket_t mother_descs[10];
+ 
   /* We don't want to restart if we crash before we get up. */
   touch(KILLSCRIPT_FILE);
 
@@ -361,10 +364,13 @@ void init_game(ush_int port)
 
   log("Finding player limit.");
   max_players = get_max_players();
-
-  log("Opening mother connection.");
-  mother_desc = init_socket(port);
-
+
+  log("Binding interface to ports:");
+  for (i = 0; ports[i] != -1;i++) {
+    log( "   Opening port %d ...", ports[i]);
+    mother_descs[i] = init_socket(ports[i]);
+  }
+ 
   event_init();
 
   boot_db();
@@ -379,15 +385,16 @@ void init_game(ush_int port)
 
   log("Entering game loop.");
 
-  game_loop(mother_desc);
+  game_loop(mother_descs);
 
   Crash_save_all();
 
   log("Closing all sockets.");
   while (descriptor_list)
     close_socket(descriptor_list);
-
-  CLOSE_SOCKET(mother_desc);
+
+  for (i = 0; mother_descs[i] != -1;i++)
+    close(mother_descs[i]);
 
   if (circle_reboot != 2)
     save_all();
@@ -595,14 +602,14 @@ int get_max_players(void)
  * 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 mother_descs[])
 {
   fd_set input_set, output_set, exc_set, null_set;
   struct timeval last_time, opt_time, process_time, temp_time;
   struct timeval before_sleep, now, timeout;
   char comm[MAX_INPUT_LENGTH];
   struct descriptor_data *d, *next_d;
-  int missed_pulses = 0, maxdesc, aliased;
+  int missed_pulses = 0, maxdesc, aliased, i;
 
   /* initialize various time values */
   null_time.tv_sec = 0;
@@ -620,8 +627,10 @@ 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) {
+    for (i = 0;mother_descs[i] != -1;i++) 
+      FD_SET(mother_descs[i], &input_set);
+
+      if (select(mother_descs[i-1] + 1, &input_set, (fd_set *) 0, (fd_set *) 0, NULL) < 0) {
 	if (errno == EINTR)
 	  log("Waking up to process signal.");
 	else
@@ -634,14 +643,17 @@ 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);
-
-    maxdesc = mother_desc;
+    
+    maxdesc = -1;
+	/* add all mother sockets */
+	for (i = 0; mother_descs[i] != -1;i++) {
+      FD_SET(mother_descs[i], &input_set);
+      if (mother_descs[i] > maxdesc)
+        maxdesc = mother_descs[i];
+	}
     for (d = descriptor_list; d; d = d->next) {
-#ifndef CIRCLE_WINDOWS
       if (d->descriptor > maxdesc)
-	maxdesc = d->descriptor;
-#endif
+        maxdesc = d->descriptor;
       FD_SET(d->descriptor, &input_set);
       FD_SET(d->descriptor, &output_set);
       FD_SET(d->descriptor, &exc_set);
@@ -691,9 +703,10 @@ 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);
-
+    for (i = 0; mother_descs[i] != -1;i++) {
+      if (FD_ISSET(mother_descs[i], &input_set))
+        new_descriptor(mother_descs[i]);
+	}
     /* Kick out the freaky folks in the exception set and marked for close */
     for (d = descriptor_list; d; d = next_d) {
       next_d = d->next;
@@ -1227,9 +1240,7 @@ struct in_addr *get_bind_addr()
   }
 
   /* Put the address that we've finally decided on into the logs */
-  if (bind_addr.s_addr == htonl(INADDR_ANY))
-    log("Binding to all IP interfaces on this host.");
-  else
+  if (!bind_addr.s_addr == htonl(INADDR_ANY))
     log("Binding only to IP address %s", inet_ntoa(bind_addr));
 
   return (&bind_addr);
diff -puN new/config.c src/config.c
--- new/config.c	2002-11-22 21:37:00.000000000 +0100
+++ src/config.c	2002-11-27 16:41:48.000000000 +0100
@@ -243,7 +243,7 @@ room_vnum donation_room_3 = NOWHERE;	/* 
  * Change the PORT= line in autorun instead of (or in addition to)
  * changing this.
  */
-ush_int DFLT_PORT = 4000;
+int DFLT_PORT = 4000;
 
 /*
  * IP address to which the MUD should bind.  This is only useful if
Common subdirectories: new/doc and src/doc
Common subdirectories: new/oasis and src/oasis
Common subdirectories: new/util and src/util

