diff -rbBcpP --exclude=CircleMud circle-3.1/lib/etc/time circle-3.1 working/lib/etc/time
*** circle-3.1/lib/etc/time	Tue Dec 31 16:59:11 2002
--- circle-3.1 working/lib/etc/time	Tue Dec 31 18:19:24 2002
***************
*** 1 ****
! 650337026
--- 1 ----
! 650337189
diff -rbBcpP --exclude=CircleMud circle-3.1/src/Makefile circle-3.1 working/src/Makefile
*** circle-3.1/src/Makefile	Wed Dec 25 23:29:06 2002
--- circle-3.1 working/src/Makefile	Tue Dec 31 17:03:29 2002
*************** OBJFILES = act.comm.o act.informative.o 
*** 30,36 ****
  	graph.o handler.o house.o interpreter.o limits.o magic.o mail.o \
  	mobact.o modify.o objsave.o olc.o random.o shop.o spec_assign.o \
  	spec_procs.o spell_parser.o spells.o utils.o weather.o \
! 	bsd-snprintf.o string_replacer.o
  
  CXREF_FILES = act.comm.c act.informative.c act.item.c act.movement.c \
  	act.offensive.c act.other.c act.social.c act.wizard.c alias.c ban.c \
--- 30,36 ----
  	graph.o handler.o house.o interpreter.o limits.o magic.o mail.o \
  	mobact.o modify.o objsave.o olc.o random.o shop.o spec_assign.o \
  	spec_procs.o spell_parser.o spells.o utils.o weather.o \
! 	bsd-snprintf.o string_replacer.o color.o
  
  CXREF_FILES = act.comm.c act.informative.c act.item.c act.movement.c \
  	act.offensive.c act.other.c act.social.c act.wizard.c alias.c ban.c \
*************** CXREF_FILES = act.comm.c act.informative
*** 38,44 ****
  	graph.c handler.c house.c interpreter.c limits.c magic.c mail.c \
  	mobact.c modify.c objsave.c olc.c random.c shop.c spec_assign.c\
  	spec_procs.c spell_parser.c spells.c utils.c weather.c \
! 	bsd-snprintf.c string_replacer.c
  
  default: all
  
--- 38,44 ----
  	graph.c handler.c house.c interpreter.c limits.c magic.c mail.c \
  	mobact.c modify.c objsave.c olc.c random.c shop.c spec_assign.c\
  	spec_procs.c spell_parser.c spells.c utils.c weather.c \
! 	bsd-snprintf.c string_replacer.c color.c
  
  default: all
  
*************** class.o: class.c conf.h sysdep.h structs
*** 135,141 ****
    constants.h
  	$(CC) -c $(CFLAGS) class.c
  comm.o: comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h handler.h \
!   db.h house.h
  	$(CC) -c $(CFLAGS) comm.c
  config.o: config.c conf.h sysdep.h structs.h interpreter.h
  	$(CC) -c $(CFLAGS) config.c
--- 135,141 ----
    constants.h
  	$(CC) -c $(CFLAGS) class.c
  comm.o: comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h handler.h \
!   db.h house.h screen.h
  	$(CC) -c $(CFLAGS) comm.c
  config.o: config.c conf.h sysdep.h structs.h interpreter.h
  	$(CC) -c $(CFLAGS) config.c
*************** bsd-snprintf.o: bsd-snprintf.c conf.h sy
*** 207,209 ****
--- 207,211 ----
  	$(CC) -c $(CFLAGS) bsd-snprintf.c
  string_replacer.o: string_replacer.c conf.h sysdep.h structs.h utils.h string_replacer.h
  	$(CC) -c $(CFLAGS) string_replacer.c
+ color.o: color.c conf.h sysdep.h structs.h utils.h string_replacer.h screen.h
+ 	$(CC) -c $(CFLAGS) color.c
diff -rbBcpP --exclude=CircleMud circle-3.1/src/Makefile.amiga circle-3.1 working/src/Makefile.amiga
*** circle-3.1/src/Makefile.amiga	Wed Dec 25 23:21:26 2002
--- circle-3.1 working/src/Makefile.amiga	Tue Dec 31 17:03:29 2002
*************** OBJFILES = comm.o act.comm.o act.informa
*** 24,30 ****
  	castle.o class.o config.o constants.o db.o fight.o graph.o handler.o \
  	house.o interpreter.o limits.o magic.o mail.o mobact.o modify.o \
  	objsave.o olc.o shop.o spec_assign.o spec_procs.o spell_parser.o \
! 	spells.o utils.o weather.o alias.o string_replacer.o
  
  default: .accepted
  	$(MAKE) ../bin/circle
--- 24,30 ----
  	castle.o class.o config.o constants.o db.o fight.o graph.o handler.o \
  	house.o interpreter.o limits.o magic.o mail.o mobact.o modify.o \
  	objsave.o olc.o shop.o spec_assign.o spec_procs.o spell_parser.o \
! 	spells.o utils.o weather.o alias.o string_replacer.o color.o
  
  default: .accepted
  	$(MAKE) ../bin/circle
*************** castle.o: castle.c conf.h sysdep.h struc
*** 143,149 ****
  class.o: class.c conf.h sysdep.h structs.h db.h utils.h spells.h interpreter.h
  	$(CC) -c $(CFLAGS) class.c
  comm.o: comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h handler.h \
!   db.h house.h
  	$(CC) -c $(CFLAGS) comm.c
  config.o: config.c conf.h sysdep.h structs.h
  	$(CC) -c $(CFLAGS) config.c
--- 143,149 ----
  class.o: class.c conf.h sysdep.h structs.h db.h utils.h spells.h interpreter.h
  	$(CC) -c $(CFLAGS) class.c
  comm.o: comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h handler.h \
!   db.h house.h screen.h
  	$(CC) -c $(CFLAGS) comm.c
  config.o: config.c conf.h sysdep.h structs.h
  	$(CC) -c $(CFLAGS) config.c
*************** utils.o: utils.c conf.h sysdep.h structs
*** 210,214 ****
  weather.o: weather.c conf.h sysdep.h structs.h utils.h comm.h handler.h \
    interpreter.h db.h
  	$(CC) -c $(CFLAGS) weather.c
! string_replacer.o: string_replacer.c conf.h sysdep.h structs.h utils.h 
  	$(CC) -c $(CFLAGS) string_replacer.c
--- 210,216 ----
  weather.o: weather.c conf.h sysdep.h structs.h utils.h comm.h handler.h \
    interpreter.h db.h
  	$(CC) -c $(CFLAGS) weather.c
! string_replacer.o: string_replacer.c conf.h sysdep.h structs.h utils.h string_replacer.h
  	$(CC) -c $(CFLAGS) string_replacer.c
+ color.o: color.c conf.h sysdep.h structs.h utils.h string_replacer.h screen.h
+ 	$(CC) -c $(CFLAGS) color.c
diff -rbBcpP --exclude=CircleMud circle-3.1/src/Makefile.arc circle-3.1 working/src/Makefile.arc
*** circle-3.1/src/Makefile.arc	Tue Dec 31 15:59:24 2002
--- circle-3.1 working/src/Makefile.arc	Tue Dec 31 17:03:29 2002
*************** OBJFILES = o.comm act.o.comm act.o.infor
*** 26,32 ****
  	o.castle o.class o.config o.constants o.db o.fight o.graph o.handler \
  	o.house o.interpreter o.limits o.magic o.mail o.mobact o.modify \
  	o.objsave o.olc o.random o.shop o.spec_assign o.spec_procs \
! 	o.spell_parser o.spells o.utils o.weather o.alias string_replacer.o
  
  default:	all
  
--- 26,33 ----
  	o.castle o.class o.config o.constants o.db o.fight o.graph o.handler \
  	o.house o.interpreter o.limits o.magic o.mail o.mobact o.modify \
  	o.objsave o.olc o.random o.shop o.spec_assign o.spec_procs \
! 	o.spell_parser o.spells o.utils o.weather o.alias string_replacer.o \
!         color.o
  
  default:	all
  
*************** o.castle: c.castle h.conf h.sysdep h.str
*** 86,92 ****
  o.class: c.class h.conf h.sysdep h.structs h.db h.utils h.spells h.interpreter
  	$(CC) -c $(CFLAGS) c.class
  o.comm: c.comm h.conf h.sysdep h.structs h.utils h.comm h.interpreter h.handler \
!   h.db h.house
  	$(CC) -c $(CFLAGS) c.comm
  o.config: c.config h.conf h.sysdep h.structs
  	$(CC) -c $(CFLAGS) c.config
--- 87,93 ----
  o.class: c.class h.conf h.sysdep h.structs h.db h.utils h.spells h.interpreter
  	$(CC) -c $(CFLAGS) c.class
  o.comm: c.comm h.conf h.sysdep h.structs h.utils h.comm h.interpreter h.handler \
!   h.db h.house h.screen
  	$(CC) -c $(CFLAGS) c.comm
  o.config: c.config h.conf h.sysdep h.structs
  	$(CC) -c $(CFLAGS) c.config
*************** o.weather: c.weather h.conf h.sysdep h.s
*** 155,157 ****
--- 156,160 ----
  	$(CC) -c $(CFLAGS) c.weather
  o.string_replacer: c.string_replacer h.conf h.sysdep h.structs h.utils h.string_replacer 
  	$(CC) -c $(CFLAGS) c.string_replacer
+ o.color: c.color h.conf h.sysdep h.structs h.utils h.string_replacer h.screen
+ 	$(CC) -c $(CFLAGS) c.color
diff -rbBcpP --exclude=CircleMud circle-3.1/src/Makefile.bcc circle-3.1 working/src/Makefile.bcc
*** circle-3.1/src/Makefile.bcc	Wed Dec 25 23:24:16 2002
--- circle-3.1 working/src/Makefile.bcc	Tue Dec 31 15:54:16 2002
*************** Dep_circledexe = \
*** 80,86 ****
     spec_assign.obj\
     utils.obj\
     weather.obj\
!    string_replacer.obj
  
  circle.exe : $(Dep_circledexe)
    $(TLINK32) @&&|
--- 80,87 ----
     spec_assign.obj\
     utils.obj\
     weather.obj\
!    string_replacer.obj\
!    color.obj
  
  circle.exe : $(Dep_circledexe)
    $(TLINK32) @&&|
*************** spec_procs.obj+
*** 123,129 ****
  spec_assign.obj+
  utils.obj+
  weather.obj+
! string_replacer.obj
  $<,$*
  C:\BC5\LIB\bidsfi.lib+
  C:\BC5\LIB\import32.lib+
--- 124,131 ----
  spec_assign.obj+
  utils.obj+
  weather.obj+
! string_replacer.obj+
! color.obj
  $<,$*
  C:\BC5\LIB\bidsfi.lib+
  C:\BC5\LIB\import32.lib+
*************** weather.obj :  weather.c
*** 319,324 ****
--- 321,331 ----
  string_replacer.obj :  string_replacer.c
    $(BCC32) -P- -c @&&|
   $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ string_replacer.c
+ |
+ 
+ color.obj :  color.c
+   $(BCC32) -P- -c @&&|
+  $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ color.c
  |
  
  # Compiler configuration file
diff -rbBcpP --exclude=CircleMud circle-3.1/src/Makefile.bcc55 circle-3.1 working/src/Makefile.bcc55
*** circle-3.1/src/Makefile.bcc55	Wed Dec 25 23:25:20 2002
--- circle-3.1 working/src/Makefile.bcc55	Tue Dec 31 15:54:10 2002
*************** Dep_circledexe = \
*** 81,87 ****
     spec_assign.obj\
     utils.obj\
     weather.obj\
!    string_replacer.obj
  
  circle.exe : $(Dep_circledexe)
    $(TLINK32) @&&|
--- 81,88 ----
     spec_assign.obj\
     utils.obj\
     weather.obj\
!    string_replacer.obj\
!    color.obj
  
  circle.exe : $(Dep_circledexe)
    $(TLINK32) @&&|
*************** spec_procs.obj+
*** 124,130 ****
  spec_assign.obj+
  utils.obj+
  weather.obj+
! string_replacer.obj
  $<,$*
  C:\BORLAND\BCC55\LIB\import32.lib+
  C:\BORLAND\BCC55\LIB\cw32i.lib
--- 125,132 ----
  spec_assign.obj+
  utils.obj+
  weather.obj+
! string_replacer.obj+
! color.obj
  $<,$*
  C:\BORLAND\BCC55\LIB\import32.lib+
  C:\BORLAND\BCC55\LIB\cw32i.lib
*************** weather.obj :  weather.c
*** 318,323 ****
--- 320,330 ----
  string_replacer.obj :  string_replacer.c
    $(BCC32) -P- -c @&&|
   $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ string_replacer.c
+ |
+ 
+ color.obj :  color.c
+   $(BCC32) -P- -c @&&|
+  $(CompOptsAt_circledexe) $(CompInheritOptsAt_circledexe) -o$@ color.c
  |
  
  # Compiler configuration file
diff -rbBcpP --exclude=CircleMud circle-3.1/src/Makefile.in circle-3.1 working/src/Makefile.in
*** circle-3.1/src/Makefile.in	Wed Dec 25 23:26:24 2002
--- circle-3.1 working/src/Makefile.in	Tue Dec 31 17:03:29 2002
*************** OBJFILES = act.comm.o act.informative.o 
*** 29,35 ****
  	graph.o handler.o house.o interpreter.o limits.o magic.o mail.o \
  	mobact.o modify.o objsave.o olc.o random.o shop.o spec_assign.o \
  	spec_procs.o spell_parser.o spells.o utils.o weather.o \
! 	bsd-snprintf.o string_replacer.o
  
  CXREF_FILES = act.comm.c act.informative.c act.item.c act.movement.c \
  	act.offensive.c act.other.c act.social.c act.wizard.c alias.c ban.c \
--- 29,35 ----
  	graph.o handler.o house.o interpreter.o limits.o magic.o mail.o \
  	mobact.o modify.o objsave.o olc.o random.o shop.o spec_assign.o \
  	spec_procs.o spell_parser.o spells.o utils.o weather.o \
! 	bsd-snprintf.o string_replacer.o color.o
  
  CXREF_FILES = act.comm.c act.informative.c act.item.c act.movement.c \
  	act.offensive.c act.other.c act.social.c act.wizard.c alias.c ban.c \
*************** CXREF_FILES = act.comm.c act.informative
*** 37,43 ****
  	graph.c handler.c house.c interpreter.c limits.c magic.c mail.c \
  	mobact.c modify.c objsave.c olc.c random.c shop.c spec_assign.c\
  	spec_procs.c spell_parser.c spells.c utils.c weather.c \
! 	bsd-snprintf.c string_replacer.c
  
  default: all
  
--- 37,43 ----
  	graph.c handler.c house.c interpreter.c limits.c magic.c mail.c \
  	mobact.c modify.c objsave.c olc.c random.c shop.c spec_assign.c\
  	spec_procs.c spell_parser.c spells.c utils.c weather.c \
! 	bsd-snprintf.c string_replacer.c color.c
  
  default: all
  
*************** class.o: class.c conf.h sysdep.h structs
*** 134,140 ****
    constants.h
  	$(CC) -c $(CFLAGS) class.c
  comm.o: comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h handler.h \
!   db.h house.h
  	$(CC) -c $(CFLAGS) comm.c
  config.o: config.c conf.h sysdep.h structs.h interpreter.h
  	$(CC) -c $(CFLAGS) config.c
--- 134,140 ----
    constants.h
  	$(CC) -c $(CFLAGS) class.c
  comm.o: comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h handler.h \
!   db.h house.h screen.h
  	$(CC) -c $(CFLAGS) comm.c
  config.o: config.c conf.h sysdep.h structs.h interpreter.h
  	$(CC) -c $(CFLAGS) config.c
*************** bsd-snprintf.o: bsd-snprintf.c conf.h sy
*** 206,208 ****
--- 206,210 ----
  	$(CC) -c $(CFLAGS) bsd-snprintf.c
  string_replacer.o: string_replacer.c conf.h sysdep.h structs.h utils.h string_replacer.h
  	$(CC) -c $(CFLAGS) string_replacer.c
+ color.o: color.c conf.h sysdep.h structs.h utils.h string_replacer.h screen.h
+ 	$(CC) -c $(CFLAGS) color.c
diff -rbBcpP --exclude=CircleMud circle-3.1/src/Makefile.lcc circle-3.1 working/src/Makefile.lcc
*** circle-3.1/src/Makefile.lcc	Tue Dec 31 16:00:21 2002
--- circle-3.1 working/src/Makefile.lcc	Tue Dec 31 17:03:29 2002
*************** OBJS=\
*** 53,59 ****
  	act.informative.obj \
  	act.comm.obj \
  	alias.obj \
!         string_replacer.obj
  
  
  LIBS=$(LCCDIR)\lib\wsock32.lib
--- 53,60 ----
  	act.informative.obj \
  	act.comm.obj \
  	alias.obj \
!         string_replacer.obj \
!         color.obj
  
  
  LIBS=$(LCCDIR)\lib\wsock32.lib
*************** COMM_C=\
*** 376,381 ****
--- 377,383 ----
      $(DISTDIR)\src\db.h\
      $(DISTDIR)\src\house.h\
      $(DISTDIR)\src\telnet.h\
+     $(DISTDIR)\src\screen.h\
  
  comm.obj: $(COMM_C) $(DISTDIR)\src\comm.c
      $(CC)  $(CFLAGS) $(DISTDIR)\src\comm.c
*************** alias.obj: $(ALIAS_C) $(DISTDIR)\src\ali
*** 567,578 ****
      $(CC)  $(CFLAGS) $(DISTDIR)\src\alias.c
  
  # Build STRING_REPLACER.C
! STRING_REPLACER_C=\
      $(DISTDIR)\src\sysdep.h\
      $(DISTDIR)\src\structs.h\
      $(DISTDIR)\src\utils.h\
      $(DISTDIR)\src\string_replacer.h\
  
! string_replacer.obj: $(STRING_REPLACER_C) $(DISTDIR)\src\string_replacer.c
      $(CC)  $(CFLAGS) $(DISTDIR)\src\string_replacer.c
  
--- 569,591 ----
      $(CC)  $(CFLAGS) $(DISTDIR)\src\alias.c
  
  # Build STRING_REPLACER.C
! STRING_REPLACE_C=\
      $(DISTDIR)\src\sysdep.h\
      $(DISTDIR)\src\structs.h\
      $(DISTDIR)\src\utils.h\
      $(DISTDIR)\src\string_replacer.h\
  
! string_replacer.obj: $(STRING_REPLACE_C) $(DISTDIR)\src\string_replacer.c
      $(CC)  $(CFLAGS) $(DISTDIR)\src\string_replacer.c
+ 
+ # Build COLOR.C
+ COLOR_C=\
+     $(DISTDIR)\src\sysdep.h\
+     $(DISTDIR)\src\structs.h\
+     $(DISTDIR)\src\utils.h\
+     $(DISTDIR)\src\string_replacer.h\
+     $(DISTDIR)\src\screen.h\
+ 
+ color.obj: $(STRING_REPLACE_C) $(DISTDIR)\src\color.c
+     $(CC)  $(CFLAGS) $(DISTDIR)\src\color.c
  
diff -rbBcpP --exclude=CircleMud circle-3.1/src/Makefile.msvc circle-3.1 working/src/Makefile.msvc
*** circle-3.1/src/Makefile.msvc	Wed Dec 25 23:27:20 2002
--- circle-3.1 working/src/Makefile.msvc	Tue Dec 31 17:03:29 2002
*************** OBJFILES = comm.obj act.comm.obj act.inf
*** 40,46 ****
          castle.obj class.obj config.obj constants.obj db.obj fight.obj graph.obj handler.obj \
          house.obj interpreter.obj limits.obj magic.obj mail.obj mobact.obj modify.obj \
          objsave.obj olc.obj shop.obj spec_assign.obj spec_procs.obj spell_parser.obj \
!         spells.obj utils.obj weather.obj random.obj alias.obj string_replacer.obj
  
  default: circle.exe
          $(MAKE) circle.exe
--- 40,47 ----
          castle.obj class.obj config.obj constants.obj db.obj fight.obj graph.obj handler.obj \
          house.obj interpreter.obj limits.obj magic.obj mail.obj mobact.obj modify.obj \
          objsave.obj olc.obj shop.obj spec_assign.obj spec_procs.obj spell_parser.obj \
!         spells.obj utils.obj weather.obj random.obj alias.obj string_replacer.obj \
!         color.c
  
  default: circle.exe
          $(MAKE) circle.exe
*************** castle.obj: castle.c conf.h sysdep.h str
*** 89,95 ****
  class.obj: class.c conf.h sysdep.h structs.h db.h utils.h spells.h interpreter.h
  	$(CC) -c $(CFLAGS) class.c
  comm.obj: comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h handler.h \
!   db.h house.h
  	$(CC) -c $(CFLAGS) comm.c
  config.obj: config.c conf.h sysdep.h structs.h
  	$(CC) -c $(CFLAGS) config.c
--- 90,96 ----
  class.obj: class.c conf.h sysdep.h structs.h db.h utils.h spells.h interpreter.h
  	$(CC) -c $(CFLAGS) class.c
  comm.obj: comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h handler.h \
!   db.h house.h screen.h
  	$(CC) -c $(CFLAGS) comm.c
  config.obj: config.c conf.h sysdep.h structs.h
  	$(CC) -c $(CFLAGS) config.c
*************** weather.obj: weather.c conf.h sysdep.h s
*** 158,160 ****
--- 159,163 ----
  	$(CC) -c $(CFLAGS) weather.c
  string_replacer.obj: string_replacer.c conf.h sysdep.h structs.h utils.h string_replacer.h
  	$(CC) -c $(CFLAGS) string_replacer.c
+ color.obj: color.c conf.h sysdep.h structs.h utils.h string_replacer.h screen.h
+ 	$(CC) -c $(CFLAGS) color.c
diff -rbBcpP --exclude=CircleMud circle-3.1/src/Makefile.os2 circle-3.1 working/src/Makefile.os2
*** circle-3.1/src/Makefile.os2	Wed Dec 25 23:28:07 2002
--- circle-3.1 working/src/Makefile.os2	Tue Dec 31 17:03:29 2002
*************** OBJFILES = comm.o act.comm.o act.informa
*** 26,32 ****
          castle.o class.o config.o constants.o db.o fight.o graph.o handler.o \
          house.o interpreter.o limits.o magic.o mail.o mobact.o modify.o \
          objsave.o olc.o shop.o spec_assign.o spec_procs.o spell_parser.o \
!         spells.o utils.o weather.o random.o alias.o string_replacer.o
  
  default: .accepted
          $(MAKE) ../bin/circle
--- 26,32 ----
          castle.o class.o config.o constants.o db.o fight.o graph.o handler.o \
          house.o interpreter.o limits.o magic.o mail.o mobact.o modify.o \
          objsave.o olc.o shop.o spec_assign.o spec_procs.o spell_parser.o \
!         spells.o utils.o weather.o random.o alias.o string_replacer.o color.o
  
  default: .accepted
          $(MAKE) ../bin/circle
*************** castle.o: castle.c conf.h sysdep.h struc
*** 145,151 ****
  class.o: class.c conf.h sysdep.h structs.h db.h utils.h spells.h interpreter.h
          $(CC) -c $(CFLAGS) class.c
  comm.o: comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h handler.h \
!   db.h house.h
          $(CC) -c $(CFLAGS) comm.c
  config.o: config.c conf.h sysdep.h structs.h
          $(CC) -c $(CFLAGS) config.c
--- 145,151 ----
  class.o: class.c conf.h sysdep.h structs.h db.h utils.h spells.h interpreter.h
          $(CC) -c $(CFLAGS) class.c
  comm.o: comm.c conf.h sysdep.h structs.h utils.h comm.h interpreter.h handler.h \
!   db.h house.h screen.h
          $(CC) -c $(CFLAGS) comm.c
  config.o: config.c conf.h sysdep.h structs.h
          $(CC) -c $(CFLAGS) config.c
*************** weather.o: weather.c conf.h sysdep.h str
*** 214,216 ****
--- 214,218 ----
          $(CC) -c $(CFLAGS) weather.c
  string_replacer.o: string_replacer.c conf.h sysdep.h structs.h utils.h string_replacer.h
          $(CC) -c $(CFLAGS) string_replacer.c
+ color.o: color.c conf.h sysdep.h structs.h utils.h string_replacer.h screen.h
+         $(CC) -c $(CFLAGS) color.c
diff -rbBcpP --exclude=CircleMud circle-3.1/src/color.c circle-3.1 working/src/color.c
*** circle-3.1/src/color.c	Wed Dec 31 18:00:00 1969
--- circle-3.1 working/src/color.c	Tue Dec 31 18:15:15 2002
***************
*** 0 ****
--- 1,173 ----
+ #define _color_c_
+ #include "conf.h"
+ #include "sysdep.h"
+ #include "structs.h"
+ #include "screen.h"
+ #include "utils.h"
+ #include "string_replacer.h"
+ 
+ #define COLOR_COLOR 	0
+ #define COLOR_CURSOR 	1
+ #define COLOR_MISC 		2
+ 
+ /* this struct holds the min level for the color code and the type of color code it is. it is used in the user_type of the parse struct */
+ struct color_info_struct {
+     int level;
+     int type;
+ };
+ 
+ /* array of levels and codes */
+ struct color_info_struct the_info[] = {
+     {0, COLOR_COLOR}, /* 0 */
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR}, /* 5 */
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR}, /* 10 */
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR},
+     {0, COLOR_COLOR}, /* 15 */
+     {31, COLOR_COLOR},
+     {31, COLOR_COLOR},
+     {31, COLOR_COLOR},
+     {31, COLOR_COLOR},
+     {31, COLOR_COLOR}, /* 20 */
+     {31, COLOR_COLOR},
+     {31, COLOR_COLOR},
+     {31, COLOR_COLOR},
+     {31, COLOR_COLOR},
+     {31, COLOR_COLOR}, /* 25 */
+     {31, COLOR_COLOR},
+     {31, COLOR_COLOR},
+     {31, COLOR_COLOR},
+     {31, COLOR_CURSOR},
+     {31, COLOR_CURSOR}, /* 30 */
+     {31, COLOR_CURSOR},
+     {31, COLOR_CURSOR},
+     {31, COLOR_CURSOR},
+     {31, COLOR_CURSOR},
+     {31, COLOR_CURSOR}, /* 35 */
+     {31, COLOR_MISC}
+     };
+ 
+ /* if you don't understand the_info+# it just means the address of the struct above plus the size of the struct times the number */
+ struct parse_struct the_colors[] = {
+     { "00", the_info, COL_NRM},
+     { "01", the_info+1, COL_RED },
+     { "02", the_info+2, COL_GREEN },
+     { "03", the_info+3, COL_YELLOW },
+ 	{ "04", the_info+4, COL_BLUE },
+ 	{ "05", the_info+5, COL_MAGENTA },
+ 	{ "06", the_info+6, COL_CYAN },
+ 	{ "07", the_info+7, COL_WHITE },
+ 	{ "08", the_info+8, COL_E_BLACK },
+ 	{ "09", the_info+9, COL_E_RED },
+ 	{ "10", the_info+10, COL_E_GREEN },
+ 	{ "11", the_info+11, COL_E_YELLOW },
+ 	{ "12", the_info+12, COL_E_BLUE },
+ 	{ "13", the_info+13, COL_E_MAGENTA },
+ 	{ "14", the_info+14, COL_E_CYAN },
+ 	{ "15", the_info+15, COL_E_WHITE },
+ 	{ "16", the_info+16, COL_E_BLACK },
+ 	{ "17", the_info+17, COL_BK_RED },
+ 	{ "18", the_info+18, COL_BK_GREEN },
+ 	{ "19", the_info+19, COL_BK_YELLOW },
+ 	{ "20", the_info+20, COL_BK_BLUE },
+ 	{ "21", the_info+21, COL_BK_MAGENTA },
+ 	{ "22", the_info+22, COL_BK_CYAN },
+ 	{ "23", the_info+23, COL_BK_WHITE },
+ 	{ "24", the_info+24, COL_BK_BLACK },
+ 	{ "25", the_info+25, STYLE_UNDERLINE },
+ 	{ "26", the_info+26, STYLE_FLASH },
+ 	{ "27", the_info+27, BNRM },
+ 	{ "28", the_info+28, STYLE_FLASH },
+ 	{ "29", the_info+29, C_UP },
+ 	{ "30", the_info+30, C_DOWN },
+ 	{ "31", the_info+31, C_RIGHT },
+ 	{ "32", the_info+32, C_LEFT },
+ 	{ "33", the_info+33, C_HOME },
+ 	{ "34", the_info+34, C_CLR },
+ 	{ "35", the_info+35, COL_OFF },
+ 	{ "36", the_info+36, "\0" },
+ 	{ "\0", 0, '\0' }
+  };
+ 
+ #define START_CHAR '&'     /* a forward slash followed by c or C or b
+ 				and a number */
+ 
+ /******* You can change START_CHAR to whatever you wish, like '^' *******/
+ 
+ int isColorLegal(char *buffer, void *user_type, void *userData)
+ {
+     struct color_info_struct *color_info = (struct color_info_struct*)user_type;
+     int *clr_lvl = (int *)userData;
+ 	int has_color  = (*clr_lvl > 1), 
+ 	    has_cursor = ((*clr_lvl == 1) || (*clr_lvl == 3));
+         int type = color_info->type;
+         
+ 	if((type == COLOR_COLOR && has_color) ||
+ 		 (type == COLOR_CURSOR && has_cursor))
+ 		return (1);
+ 	else
+ 		return (0);
+ }
+ 
+ char *doColorCalc(const char *inBuffer, char *outBuffer, int *inpos, int index, void *userData)
+ {
+ 	switch(index) {
+ 		case 37:
+ 			if(inBuffer[*inpos] == START_CHAR) {				 
+ 		  	outBuffer[0] = inBuffer[*inpos++];
+ 				outBuffer[1] = '\0';
+ 		  }
+ 			break;
+ 		default:
+ 			outBuffer[0] = '\0';
+ 			break;
+ 	}
+ 	return(outBuffer);
+ }
+  
+ 
+ char *proc_color(const char *inbuf, int color_lvl)
+ {
+ 	SetIsLegal(isColorLegal);
+ 	SetCalc(doColorCalc);
+ 	return(StringReplacer(inbuf, the_colors, START_CHAR, &color_lvl, 1));
+ }
+ 
+ /*  This function can filter colors out based on a characters level. This 
+ is used to 
+ 	restrict certian colors to immortals or higher. This function can 
+ also completly
+ 	filter color codes out of text by passing a -1 value. if passed a 
+ -1 the function
+ 	will return the new string to preserve the old one. if not it 
+ returns NULL and
+ 	copies the new string to inbuf */
+ 
+ int isColorFiltered(void *user_type, void *userData)
+ {
+     struct color_info_struct *color_info = (struct color_info_struct*)user_type;
+     int *chr_lvl = (int *)userData;
+     int level = color_info->level;
+     
+     if(level > *chr_lvl)
+ 		return (1);
+ 	else
+ 		return (0);
+ }
+ 
+ char *filter_color(const char *inbuf, int char_lvl)
+ {
+ 	SetDoFilter(isColorFiltered);
+ 	return(FilterString(inbuf, the_colors, START_CHAR, &char_lvl, 1));
+ }	
+ 
diff -rbBcpP --exclude=CircleMud circle-3.1/src/comm.c circle-3.1 working/src/comm.c
*** circle-3.1/src/comm.c	Wed Nov 13 12:02:18 2002
--- circle-3.1 working/src/comm.c	Tue Dec 31 16:41:07 2002
***************
*** 59,64 ****
--- 59,65 ----
  #include "handler.h"
  #include "db.h"
  #include "house.h"
+ #include "screen.h"
  
  #ifdef HAVE_ARPA_TELNET_H
  #include <arpa/telnet.h>
*************** void free_messages(void);
*** 163,168 ****
--- 164,171 ----
  void Board_clear_all(void);
  void free_social_messages(void);
  void Free_Invalid_List(void);
+ char *proc_color(const char *inbuf, int color_lvl);
+ char *filter_color(const char *inbuf, int color_lvl);
  
  #ifdef __CXREF__
  #undef FD_ZERO
*************** void game_loop(socket_t mother_desc)
*** 723,728 ****
--- 726,736 ----
        if (!get_from_q(&d->input, comm, &aliased))
          continue;
  
+       if(d->character)
+           strcpy(comm, filter_color(comm, GET_LEVEL(d->character)));
+       else
+         strcpy(comm, filter_color(comm, 0));
+ 
          if (d->character) {
  	/* Reset the idle timer & pull char back from void if necessary */
  	d->character->char_specials.timer = 0;
*************** void game_loop(socket_t mother_desc)
*** 767,773 ****
      /* Print prompts for other descriptors who had no other output */
      for (d = descriptor_list; d; d = d->next) {
        if (!d->has_prompt && d->bufptr == 0) {
! 	write_to_descriptor(d->descriptor, make_prompt(d));
  	d->has_prompt = TRUE;
        }
      }
--- 775,781 ----
      /* Print prompts for other descriptors who had no other output */
      for (d = descriptor_list; d; d = d->next) {
          if (!d->has_prompt && d->bufptr == 0) {
!             write_to_descriptor(d->descriptor, proc_color(make_prompt(d), 0));
              d->has_prompt = TRUE;
          }
      }
*************** size_t vwrite_to_output(struct descripto
*** 1118,1123 ****
--- 1126,1134 ----
    static char txt[MAX_STRING_LENGTH];
    size_t wantsize;
    int size;
+   int clvl = 0;
+ 
+   if(t->character) clvl = COLOR_LEV(t->character);
    
    /* if we're in the overflow state already, ignore this new output */
    if (t->bufspace == 0)
*************** size_t vwrite_to_output(struct descripto
*** 1125,1130 ****
--- 1136,1145 ----
  
    wantsize = size = vsnprintf(txt, sizeof(txt), format, args);
    /* If exceeding the size of the buffer, truncate it for the overflow message */
+   /* ok now to colorize the string  */
+   strncpy(txt, proc_color(txt, clvl), MAX_STRING_LENGTH);
+  wantsize = size = strlen(txt);
+  
    if (size < 0 || wantsize >= sizeof(txt)) {
      size = sizeof(txt) - 1;
      strcpy(txt + size - strlen(text_overflow), text_overflow);	/* strcpy: OK */
*************** int new_descriptor(socket_t s)
*** 1396,1402 ****
  int process_output(struct descriptor_data *t)
  {
    char i[MAX_SOCK_BUF], *osb = i + 2;
!   int result;
  
    /* we may need this \r\n for later -- see below */
    strcpy(i, "\r\n");	/* strcpy: OK (for 'MAX_SOCK_BUF >= 3') */
--- 1411,1419 ----
  int process_output(struct descriptor_data *t)
  {
    char i[MAX_SOCK_BUF], *osb = i + 2;
!   int result, clvl = 0;
! 
!   if(t->character) clvl=COLOR_LEV(t->character);
   
    /* we may need this \r\n for later -- see below */
    strcpy(i, "\r\n");	/* strcpy: OK (for 'MAX_SOCK_BUF >= 3') */
*************** int process_output(struct descriptor_dat
*** 1413,1419 ****
      strcat(osb, "\r\n");	/* strcpy: OK (osb:MAX_SOCK_BUF-2 reserves space) */
  
    /* add a prompt */
!   strcat(i, make_prompt(t));	/* strcpy: OK (i:MAX_SOCK_BUF reserves space) */
  
    /*
     * now, send the output.  If this is an 'interruption', use the prepended
--- 1430,1436 ----
      strcat(osb, "\r\n");	/* strcpy: OK (osb:MAX_SOCK_BUF-2 reserves space) */
  
    /* add a prompt */
!   strcat(i, proc_color(make_prompt(t), clvl));	/* strcpy: OK (i:MAX_SOCK_BUF reserves space) */
  
    /*
     * now, send the output.  If this is an 'interruption', use the prepended
*************** int write_to_descriptor(socket_t desc, c
*** 1592,1598 ****
    ssize_t bytes_written;
    size_t total = strlen(txt), write_total = 0;
  
!   while (total > 0) {
      bytes_written = perform_socket_write(desc, txt, total);
  
      if (bytes_written < 0) {
--- 1609,1615 ----
    ssize_t bytes_written;
    size_t total = strlen(txt), write_total = 0;
        
! while (total > 0) {
      bytes_written = perform_socket_write(desc, txt, total);
  
      if (bytes_written < 0) {
*************** int write_to_descriptor(socket_t desc, c
*** 1609,1615 ****
      }
    }
  
!   return (write_total);
  }
  
  
--- 1626,1632 ----
      }
    }
  
! return (write_total);
  }
  
  
diff -rbBcpP --exclude=CircleMud circle-3.1/src/screen.h circle-3.1 working/src/screen.h
*** circle-3.1/src/screen.h	Wed Mar  4 23:37:14 1998
--- circle-3.1 working/src/screen.h	Tue Dec 31 16:30:03 2002
***************
*** 8,21 ****
  *  CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.               *
  ************************************************************************ */
  
! #define KNRM  "\x1B[0m"
! #define KRED  "\x1B[31m"
! #define KGRN  "\x1B[32m"
! #define KYEL  "\x1B[33m"
! #define KBLU  "\x1B[34m"
! #define KMAG  "\x1B[35m"
! #define KCYN  "\x1B[36m"
! #define KWHT  "\x1B[37m"
  #define KNUL  ""
  
  /* conditional color.  pass it a pointer to a char_data and a color level. */
--- 8,80 ----
  *  CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.               *
  ************************************************************************ */
  
! 
! /* The standard ANSI colors */
! #define COL_NONE	""
! #define CNUL  ""
! #define COL_OFF 	"\x1B[0;37m"
! 
! #define COL_NRM  "\x1B[0;0m"	/* %00 */
! #define COL_RED 	"\x1B[0;31m"
! #define COL_GREEN 	"\x1B[0;32m"
! #define COL_YELLOW 	"\x1B[0;33m"
! #define COL_BLUE 	"\x1B[0;34m"
! #define COL_MAGENTA "\x1B[0;35m"
! #define COL_CYAN 	"\x1B[0;36m"
! #define COL_WHITE 	"\x1B[0;37m"
! #define COL_BLACK	"\x1B[0;30m"
! #define COL_FG_OFF	"\x1B[38m" /* works on normal terminals but not
! 					color_xterms */
! 
! /* The bold or extended ANSI colors */
! #define COL_E_RED 		"\x1B[1;31m"
! #define COL_E_GREEN 	"\x1B[1;32m"
! #define COL_E_YELLOW 	"\x1B[1;33m"
! #define COL_E_BLUE 		"\x1B[1;34m"
! #define COL_E_MAGENTA 	"\x1B[1;35m"
! #define COL_E_CYAN 		"\x1B[1;36m"
! #define COL_E_WHITE 	"\x1B[1;37m"
! #define COL_E_BLACK		"\x1B[1;30m" /* /cl */
! 
! /* The background colors */
! 	
! #define COL_BK_RED 			"\x1B[41m"
! #define COL_BK_GREEN 		"\x1B[42m"
! #define COL_BK_YELLOW 		"\x1B[43m"
! #define COL_BK_BLUE 		"\x1B[44m"
! #define COL_BK_MAGENTA 		"\x1B[45m"
! #define COL_BK_CYAN 		"\x1B[46m"
! #define COL_BK_WHITE 		"\x1B[47m"
! #define COL_BK_BLACK    	"\x1B[40m" /* /cL */
! 
! /*         Underline, Flashing, etc         */
! #define STYLE_UNDERLINE   	"\x1B[4m" /* /cu */
! #define STYLE_FLASH	  		"\x1B[5m" /* /cf */
! #define BNRM   "\x1B[1m"	/* %27 */
! #define STYLE_REVERSE	  	"\x1B[7m" /* /cv */
! #define SPACE  " "		/* %28 */
! #define BACKSPACE "\x8"*/		/* %29 */
! /*#define BACKSPACE	"\x101"*/
! /*#define BSMILEY	 "\x101"*/	/* %30 */
! /*#define WSMILEY	 "\x102"*/	/* %31 */
! 
! /* Cursor controls */
! #define C_UP    		"\x1B[A"
! #define C_DOWN  		"\x1B[B"
! #define C_RIGHT 		"\x1B[C"
! #define C_LEFT  		"\x1B[D"
! #define C_HOME  		"\x1B[H"
! #define C_CLR   C_HOME	"\x1B[J"
! 
! /* Circle's Standard color defines */
! #define KNRM  "\033[0m"
! #define KRED  "\033[31m"
! #define KGRN  "\033[32m"
! #define KYEL  "\033[33m"
! #define KBLU  "\033[34m"
! #define KMAG  "\033[35m"
! #define KCYN  "\033[36m"
! #define KWHT  "\033[37m"
  #define KNUL  ""
  
  /* conditional color.  pass it a pointer to a char_data and a color level. */
diff -rbBcpP --exclude=CircleMud circle-3.1/src/string_replacer.h circle-3.1 working/src/string_replacer.h
*** circle-3.1/src/string_replacer.h	Tue Dec 31 18:23:29 2002
--- circle-3.1 working/src/string_replacer.h	Tue Dec 31 17:45:29 2002
***************
*** 6,12 ****
  
  struct parse_struct {
  	char *code; /* holds the tag after the start character */
! 	void *user_type; /* holds user specfies type be it an int or struct */
  	char *real_code; /* actual code for tage or \0 for a calculateded code */
  };
  
--- 6,12 ----
  
  struct parse_struct {
  	char *code; /* holds the tag after the start character */
! 	void *user_type; /* holds the level of the character that can embed this in a string */
  	char *real_code; /* actual code for tage or \0 for a calculateded code */
  };
  

