[mw-devel] MW3 r1127 - in trunk: . scripthelp src talkhelp

welshbyte at sucs.org welshbyte at sucs.org
Thu Dec 10 15:40:21 GMT 2009


Author: welshbyte
Date: 2009-12-10 15:40:21 +0000 (Thu, 10 Dec 2009)
New Revision: 1127

Removed:
   trunk/mudhelp/
   trunk/rooms/
   trunk/scripthelp/mudexec
   trunk/scripthelp/mudexits
   trunk/scripthelp/mudmode
   trunk/src/mud.c
   trunk/src/mud.h
   trunk/src/mudtable.c
   trunk/src/mudtable.h
   trunk/talkhelp/mudmode
Modified:
   trunk/
   trunk/Makefile
   trunk/src/Makefile
   trunk/src/Parse.c
   trunk/src/bb.h
   trunk/src/chattable.c
   trunk/src/completion.c
   trunk/src/init.c
   trunk/src/log.c
   trunk/src/main.c
   trunk/src/proto.h
   trunk/src/rooms.c
   trunk/src/rooms.h
   trunk/src/scrcomplete.h
   trunk/src/script_inst.c
   trunk/src/script_inst.h
   trunk/src/sqlite.c
   trunk/src/sqlite.h
   trunk/src/talker.c
   trunk/src/talker.h
   trunk/src/talker_privs.c
   trunk/src/talker_privs.h
   trunk/src/who.c
Log:
Merge the nomud branch back into trunk. Mud mode is gone.


Property changes on: trunk
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/nomud:1115-1126

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/Makefile	2009-12-10 15:40:21 UTC (rev 1127)
@@ -5,7 +5,7 @@
 VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_TWEAK)
 
 # the non source files that should get installed
-INSTALLFILES = colour help login.banner mudhelp rooms scripthelp talkhelp wizhelp COPYING INSTALL LICENSE README
+INSTALLFILES = colour help login.banner scripthelp talkhelp wizhelp COPYING INSTALL LICENSE README
 
 ifndef TMPDIR
 rpm deb:

Deleted: trunk/scripthelp/mudexec
===================================================================
--- trunk/scripthelp/mudexec	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/scripthelp/mudexec	2009-12-10 15:40:21 UTC (rev 1127)
@@ -1 +0,0 @@
-link boardexec
\ No newline at end of file

Deleted: trunk/scripthelp/mudexits
===================================================================
--- trunk/scripthelp/mudexits	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/scripthelp/mudexits	2009-12-10 15:40:21 UTC (rev 1127)
@@ -1,13 +0,0 @@
-Miscellaneous Instructions
-
-NAME
-     MUDEXITS - Returns a list of MUD exits for the current room
-
-SYNOPSIS
-     MUDEXITS variable
-
-DESCRIPTION
-     Returns a space-delimited list of MUD exits for the current room to
-     variable.
-
- 
\ No newline at end of file

Deleted: trunk/scripthelp/mudmode
===================================================================
--- trunk/scripthelp/mudmode	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/scripthelp/mudmode	2009-12-10 15:40:21 UTC (rev 1127)
@@ -1,9 +0,0 @@
-NAME
-     MUDMODE - Turn mudmode on or off
-
-SYNOPSIS
-     MUDMODE <ON | OFF>
-
-DESCRIPTION
-     Equivalent to talker command .mudmode <on | off>.
-

Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/Makefile	2009-12-10 15:40:21 UTC (rev 1127)
@@ -98,7 +98,7 @@
 newmain.o init.o talker.o talker_privs.o colour.o bork.o rooms.o alarm.o\
 topten.o sort.o tidyup.o gags.o script_inst.o script.o\
 incoming.o command.o chattable.o alias.o frl.o hash.o vars.o expand.o\
-mud.o mudtable.o files.o completion.o sentinel.o iconv.o gagtable.o \
+files.o completion.o sentinel.o iconv.o gagtable.o \
 js.o sqlite.o ipc.o log.o uri.o
 	$(CC) $(LDFLAGS) $(LDLIBS) -o $@ $^
 
@@ -121,7 +121,7 @@
 test:
 	make TESTDIR=$(CURDIR)/mwtest $@
 else
-TESTFILES=../colour ../help ../login.banner ../mudhelp ../rooms ../scripthelp ../talkhelp ../wizhelp
+TESTFILES=../colour ../help ../login.banner ../scripthelp ../talkhelp ../wizhelp
 test:
 	mkdir -p $(TESTDIR)
 	cd $(TESTDIR) && mkdir -p mw run/mw log/mw lib/mw

Modified: trunk/src/Parse.c
===================================================================
--- trunk/src/Parse.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/Parse.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -11,7 +11,6 @@
 extern unsigned long rights;
 extern CommandList table[];
 extern CommandList chattable[];
-extern CommandList mudtable[];
 extern struct person *user;
 extern long userposn;
 
@@ -270,8 +269,6 @@
 	printf("Command '%s' not found.",dowhat);
 	if (backup==chattable)
 		printf(" Use %chelp for a list of commands.\n", CMD_TALK_CHAR);
-	else if (backup==mudtable)
-		printf(" Use %chelp for a list of commands.\n", CMD_MUD_CHAR);
 	else if (!cm_flags(user->chatmode, CM_ONCHAT, CM_MODE_ALL))
 		printf(" Use help for a list of commands.\n");
 	else

Modified: trunk/src/bb.h
===================================================================
--- trunk/src/bb.h	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/bb.h	2009-12-10 15:40:21 UTC (rev 1127)
@@ -31,17 +31,15 @@
 #define EDITOR		"/usr/bin/vim"
 #define SECUREEDITOR	"/bin/rnano"
 
-#define ROOMPATH	"rooms"
-
 #define HELPDIR		"help"
 #define WIZHELP		"wizhelp"
 #define SCRIPTHELP	"scripthelp"
 #define TALKHELP	"talkhelp"
-#define MUDHELPDIR	"mudhelp"
 
 #define USERSQL		"users.db"
 #define USERDB_PRIVATE	"private"
 #define USERDB_PUBLIC	"public"
+#define USERDB_ROOMS	"rooms"
 
 #define TEXT_END	".t"
 #define INDEX_END	".i"
@@ -52,8 +50,6 @@
 #define TRUE 		!FALSE
 #define SETALLLONG 	0xFFFFFFFF
 
-#define CMD_MUD_CHAR	'['
-#define CMD_MUD_STR	"["
 #define CMD_BOARD_CHAR	'!'
 #define CMD_BOARD_STR	"!"
 #define CMD_TALK_CHAR	'.'
@@ -198,15 +194,6 @@
 	int32_t posn;
 };
 
-typedef struct __dirinfo
-{
-	char *link;	/* direction command (eg, 'jump') */
-	char *from;     /* leave message (eg, 'jumped up') */
-	char *to;	/* entering message (eg, 'fallen from') */
-	char *leaving;	/* leaving message (eg, 'leaving main hall, falling down to') */
-	struct __dirinfo *next;
-} DirInfo;
-
 struct room_vis_info
 {
 	char *name;
@@ -223,15 +210,6 @@
 	int32_t hidden;				/* cant find room using 'room' command */
 	int32_t sproof;				/* soundproof? */
 	int32_t locked;				/* locked even if mudmode off? */
-	int32_t *dir;				/* room numbers can find from here */
-	int32_t *hidedir;				/* room is hidden */
-	char **link;				/* link text for directions off here */
-	char **dirdef;				/* direction name redefs */
-	char **fromdef;				/* direction leave redefs */
-	char **todef;				/* direction arrive redefs */
-	char **leavedef;			/* direction leaving redefs */
-
-	struct room_vis_info *vnames;		/* externally visible names */
 };
 
 typedef struct gag_info

Modified: trunk/src/chattable.c
===================================================================
--- trunk/src/chattable.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/chattable.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -17,7 +17,6 @@
 	  80 = summon
 	 100 = spy
 	 200 = script
-	 400 = mud
 	 800 = SU
 	1000 = Advanced Scripts
 	2000 = Developer Mode
@@ -48,7 +47,6 @@
 {"load"		,0x0200	,1, "Usage: load <file>", "Load script from file", t_load, 1},
 {"kick"		,0x0804	,1, "Usage: kick <user> [reason]", "Eject user from talker, ignoring protection", t_kick, 1},
 {"mrod"		,0x0008	,1, "Usage: mrod <user> [reason]", "Eject user from the BBS", t_mrod, 1},
-{"mudmode"	,0x0000	,1, "Usage: mudmode <on|off>", "Toggle MUD Mode - allow MUD extensions", t_mudmode, 1},
 {"mwrc"		,0x0200	,0, "Usage: mwrc [filename]", "Set/View your mwrc startup file", t_mwrc, 1},
 {"notsayto"	,0x0003	,2, "Usage: notsayto <user> <message>", "Talk normally but exclude a single user", t_notsayto, 1},
 {"protect"	,0x0020	,1, "Usage: protect <user> [level]", "Protect user from harm [to optional level]", t_protect, 1},

Modified: trunk/src/completion.c
===================================================================
--- trunk/src/completion.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/completion.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -8,7 +8,6 @@
   modes:	0 - commands
   		1 - talker commands
   		2 - script function
-  		3 - mud command
   farg:		argument you want to tab-complete
   larg:		argument to tab-complete to (-1 for all)
 */

Modified: trunk/src/init.c
===================================================================
--- trunk/src/init.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/init.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -136,7 +136,7 @@
 	}
 
 	if ((a=strrchr(filename, '.'))!=NULL && strncasecmp(a, ".js", 3)==0) {
-		int ret = load_jsfile(file, filename);
+		load_jsfile(file, filename);
 		fclose(file);
 		return 0; // changed because if an error occured after this point the file exists, the js code has reported the error to the user and returning 1 will report to them that it doesn't exist
 	}

Modified: trunk/src/log.c
===================================================================
--- trunk/src/log.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/log.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -42,7 +42,6 @@
 extern int runautoexec;
 
 extern struct room myroom;
-extern DirInfo *roomlink;
 
 extern GagInfo gaglist[];
 

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/main.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -26,8 +26,6 @@
 
 #include "talker.h"
 #include "chattable.h"
-#include "mud.h"
-#include "mudtable.h"
 #include "completion.h"
 
 #include <readline/readline.h>
@@ -110,7 +108,6 @@
 
 /* readline stuff */
 int UseRL=0;
-char *list_mudcommands(const char *text, int state);
 char *list_commands(const char *text, int state);
 char *list_chat_commands(const char *text, int state);
 char *dummy_list(const char *text, int state);
@@ -667,10 +664,7 @@
 
 	init_colour();
 	
-	/* load in room directions */
-	LoadDirections();
 	RoomInit(&myroom);
-	LoadRoom(&myroom, user->room);
 
 /*	if (!(rights&65l))  a pleb - timeout of 10 mins 
 		user->timeout=600; */
@@ -749,34 +743,7 @@
 	else
 	{
 		if (cm_flags(user->chatmode,CM_ONCHAT,CM_MODE_ANY)) 
-		{
-			if (cp_flags(user->chatprivs,CP_MUD,CM_MODE_ANY))
-			{	
-				if (myroom.name!=NULL)
-				{
-					if (myroom.hidden>0)
-					{
-						if (myroom.prompt!=NULL)
-							snprintf(prompt,40, "%s%s}-* ",pre,myroom.prompt);
-						else
-							snprintf(prompt,40, "%s%s}-* ",pre,myroom.name);
-					}
-					else if (cm_flags(user->chatmode,CM_VERBOSE,CM_MODE_ALL))
-					{
-						if (myroom.prompt!=NULL)
-							snprintf(prompt,40, "%s%s,%d}-* ",pre,myroom.prompt,user->room);
-						else
-							snprintf(prompt,40, "%stalk{%d}-* ",pre,user->room);
-					}
-					else
-						snprintf(prompt,40, "%stalk{%d}-* ",pre,user->room);
-				}
-				else
-					snprintf(prompt,40, "%stalk{%d}-* ",pre,user->room);
-			}
-			else
-				snprintf(prompt,40, "%stalk{%d}-* ",pre,user->room);
-		}
+			snprintf(prompt,40, "%stalk{%d}-* ",pre,user->room);
 		else
 		if (u_god(user->status))
 			snprintf(prompt,40,"%s{%s}---* ",pre,fold->name);
@@ -873,11 +840,6 @@
 		{
 			set_talk_rights();
 			DoScript(&comm[1]);
-		}else
-		if (comm[0]==CMD_MUD_CHAR && cp_flags(user->chatprivs,CP_MUD,CM_MODE_ANY))
-		{
-			set_talk_rights();
-			c=DoCommand(&comm[1], mudtable);
 		}else {
 			char *event_name=NULL;
 			script_output=1;
@@ -976,7 +938,6 @@
 	ScriptCleanup();
 
 	RoomDestroy(&myroom);
-	DestroyDirections();
 	ClearStack();
 	stop_js();
 	alarm_cleanup();
@@ -1570,13 +1531,6 @@
 			tct = chattable;
 			set_talk_rights();
 		}else
-		if (rl_line_buffer[0]==CMD_MUD_CHAR && cp_flags(user->chatprivs,CP_MUD,CM_MODE_ANY))
-		{
-			strcpy(line, &rl_line_buffer[1]);
-			tct = mudtable;
-			mode=3;
-			set_talk_rights();
-		}else
 		if (rl_line_buffer[0]==CMD_SCRIPT_CHAR && cp_flags(user->chatprivs,CP_SCRIPT,CM_MODE_ANY))
 		{
 			strcpy(line, &rl_line_buffer[1]);
@@ -1611,8 +1565,6 @@
 			matches=rl_completion_matches(text, list_commands);
 		else if (mode==1)
 			matches=rl_completion_matches(text, list_chat_commands);
-		else if (mode==3)
-			matches=rl_completion_matches(text, list_mudcommands);
 		else
 			matches = rl_completion_matches(text, list_bind_rl);
 	}else if (mode==2)
@@ -1699,7 +1651,7 @@
 			}
 		}
 	}
-	else if ((mode==0) || (mode==1) || (mode==3 && cp_flags(user->chatprivs,CP_MUD,CM_MODE_ANY)))
+	else if ((mode==0) || (mode==1))
 	{
 		/* not a command name, or script, so check number of arguments.
 		   if not an argument we wish to tab-complete, then dont :) */
@@ -1847,35 +1799,6 @@
 	return(NULL);
 }	
 
-/* tab completion feature for mud commands */
-char *list_mudcommands(const char *text, int state)
-{
-	static int index, len;
-	char *name;
-	char *rtext;
-
-	if (state==0)
-	{
-		index=0;
-		len=strlen(text)-1;
-	}
-
-	rtext = strdup(&text[1]);
-
-	while ((name=mudtable[index].Command)!=NULL)
-	{
-		if (!strncasecmp(name, rtext, len))
-		{
-			free(rtext);
-			index++;
-			return (dupstr(name, CMD_MUD_STR));
-		}
-		index++;
-	}
-	free(rtext);
-	return(NULL);
-}	
-
 /* tab completion feature for talker commands */
 char *list_chat_commands(const char *text, int state)
 {

Deleted: trunk/src/mud.c
===================================================================
--- trunk/src/mud.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/mud.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -1,229 +0,0 @@
-#include <stdio.h>
-#include <signal.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-#include <arpa/telnet.h>
-#include <ctype.h>
-
-#include "bb.h"
-#include "Parse.h"
-#include "talker_privs.h"
-#include "special.h"
-#include "proto.h"
-#include "talker.h"
-#include "mud.h"
-#include "gags.h"
-#include "strings.h"
-
-#include "rooms.h"
-
-extern int busy; /* if true dont display messages  i.e. during new/write */
-extern unsigned long rights;
-
-extern struct person *user;
-extern struct folder *fold;
-extern long userposn;
-extern unsigned long loggedin; 
-extern int quietmode;
-
-extern struct room myroom;
-extern DirInfo *roomlink;
-
-extern GagInfo gaglist[];
-
-/* ignore list for current user */
-extern struct IgnoreList *ignored;
-
-extern CommandList mudtable[];
-
-void help_list(CommandList *cm, unsigned int hidestuff);
-
-
-void room_msg(int result)
-{
-	switch(result)
-	{
-	case 0:
-		/* success */
-		break;
-	case 1:
-		display_message(_("You cannot find that room"), 1, 1);
-		break;
-	case 2:
-		display_message(_("Sorry. You're frozen and can't change rooms."), 1, 1);
-		break;
-	case 3:
-		display_message(_("Sorry, you cannot go in that direction.\n"), 1, 1);
-		break;
-	case 4:
-		display_message(_("Invalid Room ID (0-65535 only)"), 1, 1);
-		break;
-	default:
-		display_message(_("Undefined Error changing room"), 1, 1);
-		break;
-	}
-}
-
-void m_north(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("north", 0));
-}
-
-void m_northeast(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("northeast", 0));
-}
-
-void m_east(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("east", 0));
-}
-
-void m_southeast(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("southeast", 0));
-}
-
-void m_south(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("south", 0));
-}
-
-void m_southwest(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("southwest", 0));
-}
-
-void m_west(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("west", 0));
-}
-
-void m_northwest(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("northwest", 0));
-}
-
-void m_up(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("up", 0));
-}
-
-void m_down(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("down", 0));
-}
-
-void m_in(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("in", 0));
-}
-
-void m_out(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_msg(ChangeRoom("out", 0));
-}
-
-void m_look(CommandList *cm, int argc, char **argv, char *args)
-{
-	if (myroom.name != NULL) RoomLook(&myroom, 1); else RoomLook(NULL, 1);
-}
-
-void m_users(CommandList *cm, int argc, char **argv, char *args)
-{
-	room_who_list();
-}
-
-void m_help(CommandList *cm, int argc, char **argv, char *args)
-{
-	if (argc > 1)
-		mud_help(argv[1]);
-	else
-		help_list(mudtable, 1);
-}
-
-
-void mud_help(char *args)
-{
-	CommandList	*c;
-	char		*x;
-	int		found=FALSE;
-
-	if (args!=NULL && (strchr(args,'.')!=NULL || strchr(args,'/')!=NULL))
-	{
-		printf(_("Sorry, no help available on that subject.\n"));
-		return;
-	}
-
-	if (args==NULL)
-	{
-		x = makepath(MUDHELPDIR,"/","general");
-		if (!access(x,00))
-			printfile(x);
-		else
-			printf(_("No general help available for talker commands.\n"));
-	}else
-	{
-		/* find the command in the list */
-		c = mudtable;
-		while (c->Command && strcasecmp(c->Command, args)) c++;
-
-		/* do a permissions check */
-		if (c->Command)
-		{
-			if ((rights & c->Rights) != c->Rights)
-			{
-				printf(_("Sorry, no help available on that subject.\n"));
-				return;
-			}
-		}
-
-		/* display the file */
-		x=makepath(MUDHELPDIR,"/",args);
-		if (!access(x,00))
-		{
-			printfile(x);
-			found=TRUE;
-		}
-		if (!found) printf(_("Sorry, no help available on that subject.\n"));
-	}
-}
-
-
-void m_verbose(CommandList *cm, int argc, char **argv, char *args)
-{
-	int		z=BoolOpt(argv[1]);
-	unsigned long	global=cm_flags(user->chatmode,CM_VERBOSE,CM_MODE_ALL);
-
-	if (z==1)
-	{
-		if (!global)
-		{
-			user->chatmode=cm_flags(user->chatmode,CM_VERBOSE,CM_MODE_SET);
-			display_message(_("MUD navigation is Verbosed."), 1, 1);
-		}else
-			display_message(_("Already in verbose mode."), 1, 1);
-	}else
-	if (z==0)
-	{
-		if (global)
-		{
-			user->chatmode=cm_flags(user->chatmode,CM_VERBOSE,CM_MODE_CLEAR);
-			display_message(_("MUD navigation is Brief."), 1, 1);
-		}else
-			display_message(_("Already in brief mode."), 1, 1);
-	}else
-		printf("%s\n",cm->ArgError);
-	update_user(user,userposn);
-}
-
-
-void m_rreload(CommandList *cm, int argc, char **argv, char *args)
-{
-	printf(_("Attempting to reload room %d... "), user->room);
-	RoomDestroy(&myroom);
-	RoomInit(&myroom);
-	printf("%s\n", LoadRoom(&myroom, user->room)?_("OK"):_("Failed"));
-}
-

Deleted: trunk/src/mud.h
===================================================================
--- trunk/src/mud.h	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/mud.h	2009-12-10 15:40:21 UTC (rev 1127)
@@ -1,23 +0,0 @@
-#include "Parse.h"
-
-/* talker.c */
-void m_north(CommandList *cm, int argc, char **argv, char *args);
-void m_northeast(CommandList *cm, int argc, char **argv, char *args);
-void m_east(CommandList *cm, int argc, char **argv, char *args);
-void m_southeast(CommandList *cm, int argc, char **argv, char *args);
-void m_south(CommandList *cm, int argc, char **argv, char *args);
-void m_southwest(CommandList *cm, int argc, char **argv, char *args);
-void m_west(CommandList *cm, int argc, char **argv, char *args);
-void m_northwest(CommandList *cm, int argc, char **argv, char *args);
-void m_in(CommandList *cm, int argc, char **argv, char *args);
-void m_out(CommandList *cm, int argc, char **argv, char *args);
-void m_up(CommandList *cm, int argc, char **argv, char *args);
-void m_down(CommandList *cm, int argc, char **argv, char *args);
-void m_look(CommandList *cm, int argc, char **argv, char *args);
-void m_users(CommandList *cm, int argc, char **argv, char *args);
-void m_help(CommandList *cm, int argc, char **argv, char *args);
-void m_rreload(CommandList *cm, int argc, char **argv, char *args);
-void m_verbose(CommandList *cm, int argc, char **argv, char *args);
-
-
-void mud_help(char *args);

Deleted: trunk/src/mudtable.c
===================================================================
--- trunk/src/mudtable.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/mudtable.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -1,38 +0,0 @@
-#include <stdlib.h>
-#include "Parse.h"
-#include "mudtable.h"
-
-/* command string table, whilst in talker mode
- * "command", perms, #args, usage, descr, function, showable
- * privs: NOT APPLICABLE - 0x0000
- */
-
-CommandList mudtable[]={
-/* name, privs, argc, usage, help, function, visible */
-{"down"		,0x0000 ,0 ,"Usage: down" ,"Move down", m_down, 1},
-{"e"		,0x0000 ,0 ,"Usage: e" ,"Move east", m_east, 0},
-{"east"		,0x0000	,0 ,"Usage: east" ,"Move east", m_east, 1},
-{"help"		,0x0000	,0, "Usage: help", "List of available commands", m_help, 1},
-{"in"		,0x0000 ,0 ,"Usage: in" ,"Move in", m_in, 1},
-{"look"		,0x0000 ,0 ,"Usage: look", "Shows Current Room Description", m_look, 1},
-{"n"		,0x0000	,0 ,"Usage: n" ,"Move north", m_north, 0},
-{"ne"		,0x0000	,0 ,"Usage: ne" ,"Move northeast", m_northeast, 0},
-{"north"	,0x0000	,0 ,"Usage: north" ,"Move north", m_north, 1},
-{"northeast"	,0x0000	,0 ,"Usage: northeast" ,"Move northeast", m_northeast, 1},
-{"northwest"	,0x0000	,0 ,"Usage: northwest" ,"Move northwest", m_northwest, 1},
-{"nw"		,0x0000	,0 ,"Usage: nw" ,"Move northwest", m_northwest, 0},
-{"out"		,0x0000 ,0 ,"Usage: out" ,"Move out", m_out, 1},
-{"rreload"      ,0x2400 ,0, "Usage: rreload", "Reloads the current room file", m_rreload, 1},
-{"s"		,0x0000	,0 ,"Usage: s" ,"Move south", m_south, 0},
-{"se"		,0x0000	,0 ,"Usage: se" ,"Move southeast", m_southeast, 0},
-{"south"	,0x0000	,0 ,"Usage: south" ,"Move south", m_south, 1},
-{"southeast"	,0x0000	,0 ,"Usage: southeast" ,"Move southeast", m_southeast, 1},
-{"southwest"	,0x0000	,0 ,"Usage: southwest" ,"Move southwest", m_southwest, 1},
-{"sw"		,0x0000	,0 ,"Usage: sw" ,"Move southwest", m_southwest, 0},
-{"u"		,0x0000 ,0 ,"Usage: u" ,"Move up", m_up, 0},
-{"up"		,0x0000 ,0 ,"Usage: up" ,"Move up", m_up, 1},
-{"users"	,0x0000 ,0 ,"Usage: users" ,"Shows the Users in the Current Room", m_users, 1},
-{"verbose"      ,0x0400 ,1, "Usage: verbose <on|off>", "Turns auto-look on and off in MUD navigation", m_verbose, 1},
-{"west"		,0x0000	,0 ,"Usage: west" ,"Move west", m_west, 1},
-{NULL		,0x0000	,0 ,"", "", NULL, 1}
-};

Deleted: trunk/src/mudtable.h
===================================================================
--- trunk/src/mudtable.h	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/mudtable.h	2009-12-10 15:40:21 UTC (rev 1127)
@@ -1,8 +0,0 @@
-#include "mud.h"
-#include "talker.h"
-#include "Parse.h"
-
-/* command string table, whilst in talker mode */
-extern CommandList mudtable[];
-
-/* Now defined in mudtable.c */

Modified: trunk/src/proto.h
===================================================================
--- trunk/src/proto.h	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/proto.h	2009-12-10 15:40:21 UTC (rev 1127)
@@ -45,7 +45,6 @@
 void list_matches(char **a);
 char *list_commands(const char *text, int state);
 char *list_chat_commands(const char *text, int state);
-char *list_mudcommands(const char *text, int state);
 char *find_folder(const char *text, int state);
 int word_count(char *text);
 char *part_who(const char *text, int status);
@@ -213,7 +212,6 @@
 void chat_sayto(char *to,char *text, int exclude);
 void set_talk_rights(void);
 void talk_send(char *text, int state, int channel);
-void talk_send_mud(char *text, char *mudtext, int state, int channel);
 void talk_single(char *to, char *text);
 void talk_sayto(char *text, char *to, int channel, int exclude);
 void apply_gag(char *text);

Modified: trunk/src/rooms.c
===================================================================
--- trunk/src/rooms.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/rooms.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -16,6 +16,7 @@
 #include "frl.h"
 #include "strings.h"
 #include "ipc.h"
+#include "sqlite.h"
 
 extern unsigned long rights;
 #define MAX_ARGC 128
@@ -29,180 +30,21 @@
 
 struct room myroom;
 
-DirInfo *roomlink = NULL;
-
 int isanum(char *a, int *result, int onlydecimal);
 
-
-void LoadDirections(void)
-{
-	char fname[1024];
-	FILE *file;
-	char *buff;
-	DirInfo *temp, *tail;
-
-	while (roomlink != NULL)
-	{
-		free(roomlink->link);
-		free(roomlink->to);
-		free(roomlink->from);
-		free(roomlink->leaving);
-		temp = roomlink;
-		roomlink = roomlink->next;
-		free(temp);
-	}
-	roomlink = NULL;
-
-	snprintf(fname, 1023, "%s/%s/defaults", HOMEPATH, ROOMPATH);
-	if ((file=fopen(fname, "r"))==NULL) {
-		return;
-	}
-
-	tail=NULL;
-	while(!feof(file) && ((buff = frl_line_nspace(file, "#"))!=NULL))
-	{
-		temp = malloc(sizeof(DirInfo));
-		temp->link = buff;
-		temp->to = frl_line_nspace(file, "#");
-		temp->from = frl_line_nspace(file, "#");
-		temp->leaving = frl_line_nspace(file, "#");
-		temp->next = NULL;
-		if (tail == NULL)
-			roomlink = temp;
-		else
-			tail->next = temp;
-		tail = temp;
-	}
-	
-	fclose(file);
-	return;
-}
-
-void DestroyDirections(void)
-{
-	DirInfo *temp;
-
-	while (roomlink != NULL)
-	{
-		free(roomlink->link);
-		free(roomlink->to);
-		free(roomlink->from);
-		free(roomlink->leaving);
-		temp = roomlink;
-		roomlink = roomlink->next;
-		free(temp);
-	}
-	roomlink = NULL;
-}
-
 void RoomInit(struct room *room)
 {
-	int i;
-	DirInfo *temp;
-
-	room->name=NULL;
-	room->desc=NULL;
-	room->prompt=NULL;
-	room->sproof=0;
-	room->num=-1;
-	room->hidden=0;
-	room->locked=0;
-
-	i=0;
-	temp = roomlink;
-	while(temp!=NULL)
-	{
-		temp = temp->next;
-		i++;
-	};
-	if (!i) i = 1; /* Prevent efence error (refuses to do malloc(0)) */
-
-	room->vnames=malloc(sizeof(struct room_vis_info));
-	room->vnames[0].name = NULL;
-
-	room->dir=malloc(sizeof(int) * i);
-	room->hidedir=malloc(sizeof(int) * i);
-	room->link=malloc(sizeof(char*) * i);
-	room->dirdef=malloc(sizeof(char*) * i);
-	room->todef=malloc(sizeof(char*) * i);
-	room->fromdef=malloc(sizeof(char*) * i);
-	room->leavedef=malloc(sizeof(char*) * i);
-
-	i=0;
-	temp = roomlink;
-	while(temp!=NULL)
-	{
-		room->dir[i]=-1;
-		room->hidedir[i]=-1;
-		room->link[i]=NULL;
-		room->dirdef[i]=NULL;
-		room->todef[i]=NULL;
-		room->fromdef[i]=NULL;
-		room->leavedef[i]=NULL;
-		i++;
-		temp = temp->next;
-	}
+	memset(room, 0, sizeof(struct room));
+	room->num = -1;
 }
 
 void RoomDestroy(struct room *room)
 {
-	int i;
-	DirInfo *temp;
-
 	SAFE_FREE(room->name);
 	SAFE_FREE(room->desc);
 	SAFE_FREE(room->prompt);
-
-	i=0;
-	temp = roomlink;
-	while(temp!=NULL)
-	{
-		SAFE_FREE(room->link[i]);
-		SAFE_FREE(room->dirdef[i]);
-		SAFE_FREE(room->todef[i]);
-		SAFE_FREE(room->fromdef[i]);
-		SAFE_FREE(room->leavedef[i]);
-		i++;
-		temp=temp->next;
-	}
-	SAFE_FREE(room->dir);
-	SAFE_FREE(room->hidedir);
-	SAFE_FREE(room->link);
-	SAFE_FREE(room->dirdef);
-	SAFE_FREE(room->todef);
-	SAFE_FREE(room->fromdef);
-	SAFE_FREE(room->leavedef);
-
-	i=0;
-	while(room->vnames[i].name!=NULL)
-	{
-		free(room->vnames[i].name);
-		i++;
-	}
-	SAFE_FREE(room->vnames);
 }
 
-char *room_name(struct room tmp, int roomnum)
-{
-	int i = 0;
-
-	while(tmp.vnames[i].name!=NULL)
-	{
-		if (tmp.vnames[i].rnum == roomnum) return(tmp.vnames[i].name);
-		i++;
-	}
-	return(tmp.name);
-}
-
-void string_lines(char *text)
-{
-	char *a;
-
-	if (text == NULL) return;
-
-	while ((a=strchr(text, '$'))!=NULL) *a='\n';
-}
-
 int str2num(char *in)
 {
 	int out;
@@ -221,183 +63,18 @@
 
 int LoadRoom(struct room *room, int num)
 {
-	char *buff;
-	char fname[1024];
-	FILE *file;
-	char *a, *b, *c, *d;
-	char *backup;
-	int i;
-	DirInfo *temp;
-	int loaded = 0;
-	StringList *inif = NULL;
-
 	if (room==NULL) return(0);
 	if (num < 0 || num > 65535) return(0);
 
-	snprintf(fname, 1023, "%s/%s/%d", HOMEPATH, ROOMPATH, num);
-	if ((file=fopen(fname, "r"))==NULL) return(0);
+	room->num=num;
+	room->name = db_room_get(num, "name");
+	room->desc = db_room_get(num, "desc");
+	room->prompt = db_room_get(num, "prompt");
+	room->hidden = str2num(db_room_get(num, "hidden"));
+	room->sproof = str2num(db_room_get(num, "soundproof"));
+	room->locked = str2num(db_room_get(num, "locked"));
 
-	inif = frl_buffer_ini(file, "#");
-
-	/* if we can load the name in from an ini file, then assume new mode */
-	if ((buff = frl_buffer_ini_string(inif, "general", "name")) == NULL)
-	{
-		rewind(file);
-
-		room->num=num;
-		while(!feof(file) && ((buff = frl_line_nspace(file, "#"))!=NULL))
-		{
-			backup = buff;
-			if ((a=strtok(buff, ":"))==NULL) { free(backup); continue; }
-			b=strtok(NULL,"\n\r");
-			if (b==NULL) { free(backup); continue; }
-			while (*b==' ' || *b=='\t') b++;
-			if (*b==0) { free(backup); continue; }
-
-			c=strchr(b,':');
-			if (c!=NULL)
-			{
-				d = c;
-				c++;
-				*d = 0;
-				while (*c==' ' || *c=='\t') c++;
-			}
-
-			if (!strcasecmp(a, "name")) {
-				loaded = 1;
-				room->name=strdup(b);
-				if (c!=NULL) { string_add(&(room->name), ":"); string_add(&(room->name), c); }
-			}else
-			if (!strcasecmp(a, "vname"))
-			{
-				i = 0;
-				while(room->vnames[i].name!=NULL) { i++; }
-
-				room->vnames = realloc(room->vnames, sizeof(struct room_vis_info) * (i + 1));
-				room->vnames[i].rnum=atoi(b);
-				room->vnames[i].name=strdup(c);
-				room->vnames[i+1].name=NULL;
-			}else
-			if (!strcasecmp(a, "desc")) {
-				room->desc=strdup(b);
-				if (c!=NULL) { string_add(&(room->desc), ":"); string_add(&(room->desc), c); }
-				string_lines(room->desc);
-			}else
-			if (!strcasecmp(a, "prompt")) {
-				room->prompt=strdup(b);
-				if (c!=NULL) { string_add(&(room->prompt), ":"); string_add(&(room->prompt), c); }
-			} else
-			if (!strcasecmp(a, "hide")) {
-				room->hidden=atoi(b);
-			} else
-			if (!strcasecmp(a, "sproof")) {
-				room->sproof=atoi(b);
-			} else
-			if (!strcasecmp(a, "locked")) {
-				room->locked=atoi(b);
-			} else
-			if (!strcasecmp(a, "redef"))
-			{
-				i=0;
-				temp = roomlink;
-				while (temp!=NULL)
-				{
-					if (!strcasecmp(temp->link, b))
-					{
-						room->dirdef[i]=strdup(c);
-					}
-					i++;
-					temp=temp->next;
-				}
-			} else
-			{
-				i=0;
-				temp = roomlink;
-				while (temp!=NULL)
-				{
-					if (!strcasecmp(temp->link, a))
-					{
-						room->dir[i]=atoi(b);
-						if (c!=NULL) {
-							room->link[i]=strdup(c);
-							string_lines(room->link[i]);
-						}
-					}
-					i++;
-					temp=temp->next;
-				}
-			}
-			free(backup);
-		}
-	}
-	else
-	{
-		StringList *sl = NULL;
-
-		/* set room to loaded, and set room number */
-		loaded = 1;
-		room->num = num;
-
-		/* store name */
-		room->name = buff;
-
-		/* read alternate prompt */
-		room->prompt = frl_buffer_ini_string(inif, "general", "prompt");
-
-		/* read and format description */
-		room->desc = frl_buffer_ini_string(inif, "general", "desc");
-		string_lines(room->desc);
-
-		/* read switch details */
-		room->hidden = str2num(frl_buffer_ini_string(inif, "switch", "hide"));
-		room->sproof = str2num(frl_buffer_ini_string(inif, "switch", "sproof"));
-		room->locked = str2num(frl_buffer_ini_string(inif, "switch", "locked"));
-
-		/* load in directional details */
-		i=0;
-		temp = roomlink;
-		while (temp!=NULL)
-		{
-			room->dirdef[i] = frl_buffer_ini_string(inif, temp->link, "name");
-			room->todef[i] = frl_buffer_ini_string(inif, temp->link, "leave");
-			room->fromdef[i] = frl_buffer_ini_string(inif, temp->link, "arrive");
-			room->leavedef[i] = frl_buffer_ini_string(inif, temp->link, "leaving");
-			room->dir[i] = str2num(frl_buffer_ini_string(inif, temp->link, "room"));
-			room->link[i] = frl_buffer_ini_string(inif, temp->link, "link");
-			string_lines(room->link[i]);
-			room->hidedir[i] = str2num(frl_buffer_ini_string(inif, temp->link, "hidden"));
-			i++;
-			temp=temp->next;
-		}
-
-		/* load in any external room names */
-		if ((sl = frl_buffer_ini_string_list(inif, "misc", "extern")) != NULL)
-		{
-			StringList *t = sl;
-
-			i=0;
-			while(t!=NULL)
-			{
-				b = strdup(t->text);
-				c = b;
-				if ((a=strsep(&b, ":"))!=NULL)
-				{
-					room->vnames = realloc(room->vnames, sizeof(struct room_vis_info) * (i + 1));
-					room->vnames[i].rnum=atoi(a);
-					room->vnames[i].name=strdup(b);
-					room->vnames[i+1].name=NULL;
-					i++;
-				}
-				free(c);
-				t=t->next;
-			}
-			frl_free_buffer(&sl);
-		}
-	}
-	frl_free_buffer(&inif);
-	fclose(file);
-
-	return(loaded);
+	return 1;
 }
 
 void room_who_list(void)
@@ -476,94 +153,6 @@
 	free(str);
 }
 
-
-void RoomExits(struct room *room)
-{
-	struct room tmp;
-	int count=0;
-	char *buff;
-	int i;
-	DirInfo *temp;
-
-	if (room==NULL) {
-		display_message("No room loaded.", 0, 1);
-		return;
-	}
-
-	i=0;
-	temp = roomlink;
-	while(temp!=NULL)
-	{
-		if (room->dir[i] >= 0 && room->hidedir[i] < 1)
-		{
-			buff = strdup("\03318 - ");
-			if (room->dirdef[i]!=NULL)
-				string_add(&buff, room->dirdef[i]);
-			else
-				string_add(&buff, temp->link);
-			string_add(&buff, " to ");
-
-			RoomInit(&tmp);
-			if (LoadRoom(&tmp, room->dir[i]))
-				string_add(&buff, room_name(tmp, user->room));
-			else
-				string_addnum(&buff, room->dir[i]);
-			if (count == 0)
-				display_message("\03318From this room, you can go:", 0, 1);
-			display_message(buff, 0, 1);
-			RoomDestroy(&tmp);
-
-			free(buff);
-			count++;
-		}
-		i++;
-		temp=temp->next;
-	}
-	if (!count) display_message("\03318There are no exits from this room", 0, 1);
-}
-
-void RoomLook(struct room *room, int full)
-{
-	char *text;
-
-	if (room==NULL)
-	{
-		text = strdup("\03317");
-		string_add(&text, "You are in an empty void.");
-		display_message(text, 0, 1);
-		free(text);
-	}
-	else
-	{
-		if (full) if (room->name!=NULL)
-		{
-			text = strdup("\03316");
-			string_add(&text, room->name);
-			display_message(text, 1, 1);
-			free(text);
-		}
-		if (room->desc!=NULL)
-		{
-			char *a;
-			char *buff;
-		
-			buff = strdup(room->desc);
-			a = strtok(buff, "\n");
-			while (a!=NULL)
-			{
-				text = strdup("\03317");
-				string_add(&text, a);
-				display_message(text, 0, 1);
-				free(text);
-				a = strtok(NULL, "\n");
-			}
-			free(buff);
-		}
-		RoomExits(room);
-	}
-	room_who_list();
-}
-
 void talker_who(int mode)
 {
 	struct person	u;
@@ -658,128 +247,16 @@
  */
 int ChangeRoom(char *room, int quiet)
 {
-	struct room rm, tmp;
-	DirInfo *temprl;
-	int indx;
-	int loaded;
+	struct room tmp;
 	int i;
 	unsigned short oldroom = user->room;
-	char buff[MAXTEXTLENGTH], mbuff[MAXTEXTLENGTH];
+	char buff[MAXTEXTLENGTH];
 
 	if (cm_flags(user->chatmode,CM_FROZEN,CM_MODE_ANY))
 	{
 		return(2);
 	}
 
-	if (cp_flags(user->chatprivs,CP_MUD,CM_MODE_ANY))
-	{
-		RoomInit(&rm);
-		if (LoadRoom(&rm, user->room))
-		{
-			int where=-1;
-			char *link=NULL;
-			char *enter=NULL;
-			char *leave=NULL;
-			char *leaving=NULL;
-
-			indx=0;
-			temprl=roomlink;
-			while (temprl!=NULL)
-			{
-				char *temp;
-				if (rm.dirdef[indx]!=NULL)
-					temp = strdup(rm.dirdef[indx]);
-				else
-					temp = strdup(temprl->link);
-				if (!strcasecmp(temp, room))
-				{
-					if (rm.dir[indx] >= 0)
-					{
-						where=rm.dir[indx];
-						if (rm.todef[indx]==NULL)
-							leave=strdup(temprl->to);
-						else
-							leave=strdup(rm.todef[indx]);
-						if (rm.fromdef[indx]==NULL)
-							enter=strdup(temprl->from);
-						else
-							enter=strdup(rm.fromdef[indx]);
-						if (rm.leavedef[indx]==NULL)
-							leaving=strdup(temprl->leaving);
-						else
-							leaving=strdup(rm.leavedef[indx]);
-						if (rm.link[indx]!=NULL) link=strdup(rm.link[indx]);
-					} else {
-						RoomDestroy(&rm);
-						free(temp);
-						return(3);
-					}
-				}
-				free(temp);
-				indx++;
-				temprl=temprl->next;
-			}
-
-			if (leave!=NULL)
-			{
-				RoomInit(&tmp);
-				if (!LoadRoom(&tmp, where))
-				{
-					tmp.name=strdup("a Nameless Void");
-					loaded = 0;
-				}
-				else loaded = 1;
-
-				snprintf(buff,MAXTEXTLENGTH-1,"\03312%s has arrived in room %d",user->name,where);
-				snprintf(mbuff,MAXTEXTLENGTH-1,"\03312%s has %s from %s",user->name,enter,room_name(rm, where));
-				if (!quiet) talk_send_raw(buff,where); /*talk_send_mud(buff,mbuff,2,where);*/
-				user->room=(unsigned short)where;
-				update_user(user,userposn);
-
-				RoomDestroy(&myroom);
-				RoomInit(&myroom);
-				LoadRoom(&myroom, user->room);
-
-				snprintf(buff,MAXTEXTLENGTH-1,"\03313%s has left to room %d",user->name,user->room);
-				snprintf(mbuff,MAXTEXTLENGTH-1,"\03313%s has %s to %s",user->name,leave,room_name(tmp, oldroom));
-				if (!quiet) talk_send_raw(buff,where); /*talk_send_mud(buff,mbuff,2,oldroom);*/
-
-				snprintf(buff,MAXTEXTLENGTH-1,"\03316Leaving %s %s to %s", rm.name, leaving, tmp.name);
-				if (!quiet) { display_message(buff, 1, 1); }
-
-				if (link!=NULL)
-				{
-					char *a;
-					char *backup = link;
-
-					a = strtok(link, "\n");
-					while (a!=NULL)
-					{
-						snprintf(buff, MAXTEXTLENGTH-1, "\03320%s", a);
-						if (!quiet) { display_message(buff, 1, 1); }
-						a = strtok(NULL, "\n");
-					}
-					free(backup);
-				}
-
-				if (cm_flags(user->chatmode,CM_VERBOSE,CM_MODE_ALL))
-				{
-					if (loaded) RoomLook(&tmp, 0); else RoomLook(NULL, 0);
-				}
-
-				free(enter);
-				free(leave);
-				free(leaving);
-
-				RoomDestroy(&tmp);
-				RoomDestroy(&rm);
-
-				return(0);
-			}
-		}
-		RoomDestroy(&rm);
-	}
-
 	i = 0;
 	if (isanum(room, &i, 1))
 	{
@@ -790,11 +267,7 @@
 			{
 				int found = 1;
 
-				if (cp_flags(user->chatprivs,CP_MUD,CM_MODE_ANY))
-				{
-					if (tmp.hidden>0 || tmp.locked>0) found = 0;
-				}
-				else if (tmp.locked>0) found = 0;
+				if (tmp.locked>0) found = 0;
 
 				if (!found)
 				{

Modified: trunk/src/rooms.h
===================================================================
--- trunk/src/rooms.h	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/rooms.h	2009-12-10 15:40:21 UTC (rev 1127)
@@ -1,12 +1,7 @@
 /* rooms.c */
-void LoadDirections(void);
-void DestroyDirections(void);
 void RoomInit(struct room *room);
 void RoomDestroy(struct room *room);
 int LoadRoom(struct room *room, int num);
-void RoomLook(struct room *room, int full);
-void RoomExits(struct room *room);
 void talker_who(int mode);
 void room_who_list(void);
-char *room_name(struct room tmp, int roomnum);
 int ChangeRoom(char *room, int quiet);

Modified: trunk/src/scrcomplete.h
===================================================================
--- trunk/src/scrcomplete.h	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/scrcomplete.h	2009-12-10 15:40:21 UTC (rev 1127)
@@ -9,7 +9,6 @@
 {"boardexec"	,list_commands},
 {"exec"		,list_chat_commands},
 {"script"	,list_script},
-{"mud"		,list_mudcommands},
 {"null"		,NULL},
 {NULL		,NULL}
 };

Modified: trunk/src/script_inst.c
===================================================================
--- trunk/src/script_inst.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/script_inst.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -15,7 +15,6 @@
 #include "special.h"
 #include "command.h"
 #include "chattable.h"
-#include "mudtable.h"
 #include "alarm.h"
 #include "rooms.h"
 #include "alias.h"
@@ -31,9 +30,7 @@
 extern Alias bind_list;
 
 extern struct room myroom;
-extern DirInfo *roomlink;
 
-
 /* current script runaway variable */
 extern long runaway;
 
@@ -79,9 +76,6 @@
 { "lt",		0x0000, 2, "Less than comparison check (<)", scr_compare },
 { "makestr",	0x0000, 3, "Create a string of multiple identical characters", scr_makestr },
 { "mod",	0x0000, 2, "Numerical modulus", scr_math },
-{ "mudexec",	0x0400, -1, "Feed command to mud command parser", scr_exec },
-{ "mudexits",	0x0400, 1, "Returns a list of MUD exits from the current room", scr_mudexit },
-{ "mudmode",	0x0000, 1, "Turn MUD mode ON or OFF", scr_mudmode },
 { "mul",	0x0000, 2, "Numerical multiply", scr_math },
 { "ne",		0x0000, 2, "Not equals comparison check (!=)", scr_compare },
 { "nprint",	0x0000, 1, "Print text to screen without newline appended", scr_print },
@@ -132,7 +126,7 @@
 { "userroom",	0x0000, 2, "Gets the room number of the specified user", scr_roomnum },
 { "version",	0x0000, 1, "Gets the milliways version string", scr_version },
 { "whenami",	0x0000, 1, "Gets the current timestamp (HH:MM)", scr_time },
-{ "whereami",	0x0000, 1, "Unless lost in MUD mode, gets your room number", scr_roomnum },
+{ "whereami",	0x0000, 1, "Gets your room number", scr_roomnum },
 { "whoami",	0x0000, 1, "Gets your username", scr_user },
 { "wholist",	0x0000, 1, "Gets a list of users currently on the talker", scr_wholist },
 { "xor",	0x0000, 2, "Bitwise XOR", scr_math },
@@ -353,37 +347,6 @@
 	free(what);
 }
 
-void scr_mudmode( struct code *pc, int fargc, char **fargv )
-{
-	char *what;
-	int i;
-
-	if (pc->argc != 1) {
-		if (script_debug) printf("Error in %s at %s, incorrect number of arguments.\n", pc->inst->name, pc->debug);
-		return;
-	}
-	what=eval_arg(pc->argv[0], fargc, fargv);
-	
-	if ((i=BoolOpt(what))==-1)
-	{
-		if (script_debug) printf("- MUDMODE: Error, invalid argument\n");
-	}
-	else
-	{
-		if (i) {
-			user->chatprivs=cp_flags(user->chatprivs,CP_MUD,CM_MODE_SET);
-			if (script_debug) printf("- MUDMODE: Mudmode enabled\n");
-		} else {
-			user->chatprivs=cp_flags(user->chatprivs,CP_MUD,CM_MODE_CLEAR);
-			if (script_debug) printf("- MUDMODE: Mudmode disabled\n");
-		}
-		update_user(user,userposn);
-	}
-
-	free(what);
-
-}
-
 void scr_wholist( struct code *pc, int fargc, char **fargv )
 {
 	struct person u2;
@@ -459,8 +422,8 @@
 		}
 		else
 		{
-			/* if have the global script priv, or not mudmode, then will always return your room number */
-			if (cm_flags(user->chatprivs, CP_CANGLOBAL, CM_MODE_ALL) || !cm_flags(user->chatprivs, CP_MUD, CM_MODE_ALL))
+			/* if have the global script priv, then will always return your room number */
+			if (cm_flags(user->chatprivs, CP_CANGLOBAL, CM_MODE_ALL))
 			{
 				snprintf(rn, 9, "%d", user->room);
 			}
@@ -518,14 +481,6 @@
 					if (cm_flags(u2.chatmode,CM_ONCHAT,CM_MODE_ANY))
 					{
 						rnum = u2.room;
-						if (cp_flags(user->chatprivs,CP_MUD,CM_MODE_ALL))
-						{
-							if (myroom.name != NULL)
-							{
-								if (myroom.hidden>0 && u2.room==user->room) rnum = -1;
-							}
-						}
-
 						snprintf(rn, 9, "%d", rnum);
 					}
 				}
@@ -540,62 +495,6 @@
 	free(what);
 }
 
-void scr_mudexit( struct code *pc, int fargc, char **fargv )
-{
-	char *what;
-	char *exits;
-	
-	if (pc->argc < 1) {
-		if (script_debug) printf("Error in %s at %s too few arguments.\n", pc->inst->name, pc->debug); 
-		return;
-	}
-	what=eval_arg(pc->argv[0], fargc, fargv);
-	exits = strdup("");
-
-	/* only calculate exits if on the talker */
-	if (cm_flags(user->chatmode, CM_ONCHAT, CM_MODE_ANY))
-	{
-		/* only add exits, if in mudmode */
-		if (cm_flags(user->chatprivs, CP_MUD, CM_MODE_ALL))
-		{
-			/* only return exits if a room is loaded */
-			if (myroom.name != NULL)
-			{
-				DirInfo *temp;
-				int i;
-				int count;
-
-				/* go through all available room directions */
-				i = 0;
-				temp = roomlink;
-				count=0;
-				while(temp!=NULL)
-				{
-					/* if direction is linked, and not 'invisible' */
-					if (myroom.dir[i] >= 0 && myroom.hidedir[i] < 1)
-					{
-						/* grab name, or redefined name */
-						if (count) string_add(&exits, " ");
-						if (myroom.dirdef[i]!=NULL)
-							string_add(&exits, myroom.dirdef[i]);
-						else
-							string_add(&exits, temp->link);
-						count++;
-					}
-					i++;
-					temp=temp->next;
-				}
-			}
-		}
-	}
-
-	if (script_debug) printf("- %s: visible exits: %s\n", pc->inst->name, strcmp(exits, "")?exits:"(none)");
-
-	var_str_force_2(what, strdup(exits));
-	free(what);
-	free(exits);
-}
-
 void scr_talkpriv( struct code *pc, int fargc, char **fargv )
 {
 	char *what;
@@ -611,7 +510,6 @@
 	/* Empty string "" means no privs. For every extra priv/mode available, the following character is added:
 	 *  T     - Timestamps enabled
 	 *  F     - Force
-	 *  M     - Mudmode enabled
 	 *  B     - Beeps on
 	 *  S     - Superuser
 	 *  <a-z> - chatmodes
@@ -620,7 +518,6 @@
 	mask &= ~(CM_ONCHAT);
 	mask &= ~(CM_STICKY);
 	if (s_timestamp(user->special)) buff = strdup("T"); else buff = strdup("");
-	if (cm_flags(user->chatprivs, CP_MUD, CM_MODE_ALL)) string_add(&buff, "M");
 	if (!u_beep(user->status)) string_add(&buff, "B");
 	if (u_god(user->status)) string_add(&buff, "S");
 	string_add(&buff, display_cmflags(user->chatmode & mask));
@@ -662,10 +559,6 @@
 			if (script_debug) printf("Error in function '%s' at %s invalid instruction execution.\n", pc->inst->name, pc->debug);
 		}
 	}
-	else if (!strcasecmp(pc->inst->name, "mudexec"))
-	{
-		if (cm_flags(user->chatmode, CM_ONCHAT, CM_MODE_ANY)) DoCommand(p, mudtable);
-	};
 
 	free(p);
 }

Modified: trunk/src/script_inst.h
===================================================================
--- trunk/src/script_inst.h	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/script_inst.h	2009-12-10 15:40:21 UTC (rev 1127)
@@ -23,8 +23,6 @@
 void scr_makestr( struct code *, int, char **);
 void scr_math( struct code *, int, char **);
 void scr_math2( struct code *, int, char **);
-void scr_mudexit( struct code *, int, char **);
-void scr_mudmode( struct code *, int, char **);
 void scr_output( struct code *, int, char **);
 void scr_print( struct code *, int, char **);
 void scr_qignore( struct code *, int, char **);

Modified: trunk/src/sqlite.c
===================================================================
--- trunk/src/sqlite.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/sqlite.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -354,3 +354,72 @@
 	}
 	db_free(old);
 }
+
+
+char * db_room_get(int room, const char *opt)
+{
+	char path[PATHSIZE];
+	struct db_result *old;
+	char *value;
+	char *out;
+
+	snprintf(path, PATHSIZE, "%s/%s", STATEDIR, USERSQL);
+
+	char *query = sqlite3_mprintf("SELECT * from "USERDB_ROOMS" WHERE room=%d AND opt=%Q", room, opt);
+	old  = db_query(path, query, 1);
+	sqlite3_free(query);
+
+	if (old == NULL) return NULL;
+	if (db_numrows(old) < 1) return NULL;
+
+	if ((value = db_item(old, 0, "arg"))==NULL)
+	{
+		db_free(old);
+		return NULL;
+	}
+	out = strdup(value);
+	db_free(old);
+	return out;
+}
+
+void db_room_set(int room, const char *opt, const char *arg)
+{
+	char path[PATHSIZE];
+	struct db_result *old;
+
+	snprintf(path, PATHSIZE, "%s/%s", STATEDIR, USERSQL);
+
+	char *query = sqlite3_mprintf("SELECT * from "USERDB_ROOMS" WHERE room=%d AND opt=%Q", room, opt);
+	old  = db_query(path, query, 1);
+	sqlite3_free(query);
+
+	/* set a new value */
+	struct db_result *res;
+	if (arg==NULL || *arg==0) {
+		char *query = sqlite3_mprintf("DELETE FROM "USERDB_ROOMS" WHERE room=%d AND opt=%Q", room, opt);
+		db_free(db_query(path, query, 1));
+		sqlite3_free(query);
+	}else
+	if (old != NULL && old->rows > 0) {
+		char *query = sqlite3_mprintf("UPDATE "USERDB_ROOMS" SET arg=%Q WHERE room=%d AND opt=%Q", arg, room, opt);
+		db_free(db_query(path, query, 1));
+		sqlite3_free(query);
+	} else {
+		char *query = sqlite3_mprintf("INSERT INTO "USERDB_ROOMS" (room, opt, arg) VALUES (%d,%Q,%Q)", room, opt, arg);
+		res = db_query(path, query, 1);
+		if (res == NULL) {
+			/* it failed, try to create the table */
+			char *create = "CREATE TABLE "USERDB_ROOMS" (room integer, opt text, arg text)";
+			res = db_query(path, create, 0);
+			sqlite3_free(create);
+			if (res != NULL) {
+				/* it worked, resubmit the insert */
+				db_free(res);
+				res = db_query(path, query, 0);
+			}
+		}
+		db_free(res);
+		sqlite3_free(query);
+	}
+	db_free(old);
+}

Modified: trunk/src/sqlite.h
===================================================================
--- trunk/src/sqlite.h	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/sqlite.h	2009-12-10 15:40:21 UTC (rev 1127)
@@ -28,4 +28,5 @@
 char * db_item(struct db_result *result, int row, const char *field);
 char * userdb_get(const char *table, const char *user, const char *opt);
 void userdb_set(const char *table, const char *user, const char *opt, const char *arg);
-
+char * db_room_get(int room, const char *opt);
+void db_room_set(int room, const char *opt, const char *arg);

Modified: trunk/src/talker.c
===================================================================
--- trunk/src/talker.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/talker.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -62,7 +62,6 @@
 extern int runautoexec;
 
 extern struct room myroom;
-extern DirInfo *roomlink;
 
 extern GagInfo gaglist[];
 
@@ -277,10 +276,7 @@
 
 void t_who(CommandList *cm, int argc, char **argv, char *args)
 {
-	if (cp_flags(user->chatprivs,CP_MUD,CM_MODE_ALL))
-		talker_who(0);
-	else
-		who_list(0);
+	who_list(0);
 }
 
 void t_what(CommandList *cm, int argc, char **argv, char *args)
@@ -481,9 +477,7 @@
 	setup_js();
 	
 	RoomDestroy(&myroom);
-	DestroyDirections();
 
-	LoadDirections();
 	RoomInit(&myroom);
 	LoadRoom(&myroom, user->room);
 
@@ -708,33 +702,6 @@
 	update_user(user,userposn);
 }
 
-void t_mudmode(CommandList *cm, int argc, char **argv, char *args)
-{
-	int z=BoolOpt(argv[1]);
-	unsigned long mm=cp_flags(user->chatprivs,CP_MUD,CM_MODE_ALL);
-
-	if (z==1)
-	{
-		if (!mm)
-		{
-			user->chatprivs=cp_flags(user->chatprivs,CP_MUD,CM_MODE_SET);
-			display_message("MUD mode Enabled.", 1, 1);
-		}else
-			display_message("Already in MUD mode.", 1, 1);
-	}else
-	if (z==0)
-	{
-		if (mm)
-		{
-			user->chatprivs=cp_flags(user->chatprivs,CP_MUD,CM_MODE_CLEAR);
-			display_message("MUD mode Disabled.", 1, 1);
-		}else
-			display_message("You are not in MUD mode.", 1, 1);
-	}else
-		printf("%s\n",cm->ArgError);
-	update_user(user,userposn);
-}
-
 /* SCRIPT HELP function */
 void t_scrhelp(CommandList *cm, int argc, char **argv, char *args)
 {
@@ -1446,7 +1413,7 @@
 	else
 		snprintf(mtext,MAXTEXTLENGTH-1,"\03310%s has just joined talker room %d",user->name, user->room);
 	snprintf(text,MAXTEXTLENGTH-1,"\03310%s has just joined talker room %d",user->name, user->room);
-	if (!quietmode) talk_send_rawbcast(text); /*talk_send_mud(text,mtext,3,0);*/
+	if (!quietmode) talk_send_rawbcast(text);
 	printf("\nNow entering the Talker. Use \".quit\" to leave and \".help\" for help.\n");
 
 	/* run the common stuff for entering the talker */
@@ -1504,7 +1471,6 @@
 	if (cp_flags(user->chatprivs,CP_SUMMON,CM_MODE_ANY)) rights|=0x0080;
 	if (cp_flags(user->chatprivs,CP_SPY,CM_MODE_ANY)) rights|=0x0100;
 	if (cp_flags(user->chatprivs,CP_SCRIPT,CM_MODE_ANY)) rights|=0x0200;
-	if (cp_flags(user->chatprivs,CP_MUD,CM_MODE_ANY)) rights|=0x0400;
 	if (u_god(user->status)) rights|=0x0800;
 	if (cp_flags(user->chatprivs,CP_ADVSCR,CM_MODE_ANY)) rights|=0x1000;
 	if (cp_flags(user->chatprivs,CP_DEVEL,CM_MODE_ANY)) rights|=0x2000;

Modified: trunk/src/talker.h
===================================================================
--- trunk/src/talker.h	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/talker.h	2009-12-10 15:40:21 UTC (rev 1127)
@@ -35,7 +35,6 @@
 void t_ungag(CommandList *cm, int argc, char **argv, char *args);
 void t_zod(CommandList *cm, int argc, char **argv, char *args);
 void t_mrod(CommandList *cm, int argc, char **argv, char *args);
-void t_mudmode(CommandList *cm, int argc, char **argv, char *args);
 void t_kick(CommandList *cm, int argc, char **argv, char *args);
 void t_remove(CommandList *cm, int argc, char **argv, char *args);
 void t_ignore(CommandList *cm, int argc, char **argv, char *args);

Modified: trunk/src/talker_privs.c
===================================================================
--- trunk/src/talker_privs.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/talker_privs.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -490,7 +490,7 @@
 		else
 			snprintf(mtext,MAXTEXTLENGTH-1,"\03310%s has just joined talker room %d",user->name, user->room);
 		snprintf(text,MAXTEXTLENGTH-1,"\03310%s has just joined talker room %d",user->name, user->room);
-		if (!quietmode) talk_send_rawbcast(text); /*talk_send_mud(text,mtext,3,0);*/
+		if (!quietmode) talk_send_rawbcast(text);
 
 		printf("\nNow entering the Talker. Use \".quit\" to leave and \".help\" for help.\n");
 
@@ -535,7 +535,6 @@
 	if (cm & CP_SUMMON) strcat(s, "S");
 	if (cm & CP_SPY) strcat(s, "Y");
 	if (cm & CP_SCRIPT) strcat(s, "s");
-	if (cm & CP_MUD) strcat(s, "m");
 	if (cm & CP_ADVSCR) strcat(s, "A");
 	if (cm & CP_DEVEL) strcat(s, "D");
 	return (s);
@@ -555,7 +554,6 @@
 	if (cp & CP_SUMMON) tmp[i++]='S'; else if (flag) tmp[i++]='-';
 	if (cp & CP_SPY) tmp[i++]='Y'; else if (flag) tmp[i++]='-';
 	if (cp & CP_SCRIPT) tmp[i++]='s'; else if (flag) tmp[i++]='-';
-	if (cp & CP_MUD) tmp[i++]='m'; else if (flag) tmp[i++]='-';
 	if (cp & CP_ADVSCR) tmp[i++]='A'; else if (flag) tmp[i++]='-';
 	if (cp & CP_DEVEL) tmp[i++]='D'; else if (flag) tmp[i++]='-';
 
@@ -583,7 +581,6 @@
 			case 'S': p=p|CP_SUMMON;break;
 			case 'Y': p=p|CP_SPY;break;
 			case 's': p=p|CP_SCRIPT;break;
-			case 'm': p=p|CP_MUD;break;
 			case 'A': p=p|CP_ADVSCR;break;
 			case 'D': p=p|CP_DEVEL;break;
 		};

Modified: trunk/src/talker_privs.h
===================================================================
--- trunk/src/talker_privs.h	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/talker_privs.h	2009-12-10 15:40:21 UTC (rev 1127)
@@ -39,7 +39,6 @@
 #define CP_SUMMON	0x00000080
 #define CP_SPY		0x00000100
 #define CP_SCRIPT	0x00000200
-#define CP_MUD		0x00000400
 #define CP_ADVSCR	0x00000800
 #define CP_DEVEL	0x00001000
 #define CP_PROTMASK	0x0000E000

Modified: trunk/src/who.c
===================================================================
--- trunk/src/who.c	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/src/who.c	2009-12-10 15:40:21 UTC (rev 1127)
@@ -159,28 +159,9 @@
 					mask&= ~(CM_PROTECTED);
 				else if (u.chatmode & CM_PROTMASK)
 					mask |= CM_PROTECTED; /* looks like temp protect */
-				if (cp_flags(user->chatprivs,CP_MUD,CM_MODE_ALL))
-				{
-					if (!strcmp(u.name, user->name))
-					{
-						if (myroom.name != NULL)
-						{
-							if(myroom.hidden>0)
-								snprintf(u.doing,DOINGSIZE, "------");
-							else
-								snprintf(u.doing,DOINGSIZE, "Room %d",u.room);
-						}
-						else
-							snprintf(u.doing,DOINGSIZE, "Room %d",u.room);
-					}
-					else if (myroom.hidden>0 && u.room==user->room)
-						snprintf(u.doing,DOINGSIZE, "------");
-					else
-						snprintf(u.doing,DOINGSIZE, "Room %d",u.room);
-				}
-				else
-					snprintf(u.doing,DOINGSIZE, "Room %d",u.room); 
 
+				snprintf(u.doing,DOINGSIZE, "Room %d",u.room);
+
 				off=strlen(u.doing);
 				snprintf(&u.doing[off],DOINGSIZE-off," (");
 				/* Show chatmode flags */

Deleted: trunk/talkhelp/mudmode
===================================================================
--- trunk/talkhelp/mudmode	2009-12-10 15:15:27 UTC (rev 1126)
+++ trunk/talkhelp/mudmode	2009-12-10 15:40:21 UTC (rev 1127)
@@ -1,14 +0,0 @@
-NAME
-     mudmode - Toggle MUD Mode - allow MUD extensions
-
-SYNOPSIS
-     mudmode on | off
-
-DESCRIPTION
-     Enables/disables the Multi User Dungeon (MUD) element of Milliways. When
-     enabled, you can go on an adventure through the Milliways virtual world.
-     
-     In mudmode, use the [verbose command to change between the
-     normal and MUD talker prompt.
-
-     For help on MUD Mode commands, use [help.
\ No newline at end of file




More information about the mw-devel mailing list