[mw-devel] [Git][arthur/mw][master] Don't warn about mwscript going away for .mwrc on .restart

Andrew Price welshbyte at sucs.org
Wed Oct 17 15:24:57 BST 2018


Andrew Price pushed to branch master at Justin Mitchell / mw


Commits:
c4b787b5 by Andrew Price at 2018-10-17T15:18:52+01:00
Don't warn about mwscript going away for .mwrc on .restart

Also clear eventin_list on .restart

- - - - -


2 changed files:

- src/client/init.c
- src/client/talker.c


Changes:

=====================================
src/client/init.c
=====================================
--- a/src/client/init.c
+++ b/src/client/init.c
@@ -56,6 +56,7 @@ static void warn_of_mwscript_death(const char *filename)
 	printf("*** mwscript support will be removed from mw on April 7th 2019.\n");
 }
 
+int do_warn_of_mwscript_death = 0;
 static int ReadInitFile(const char *base, const char *filename)
 {
 	FILE *file;
@@ -64,7 +65,6 @@ static int ReadInitFile(const char *base, const char *filename)
 	char *a, *b, *c;
 	int lineno;
 	struct stat stats;
-	static int do_warn = 0;
 
 	if (strncasecmp(filename, "http://", 7)==0
 	||  strncasecmp(filename, "https://", 8)==0) {
@@ -127,10 +127,10 @@ static int ReadInitFile(const char *base, const char *filename)
 
 	/* Warnings for the initial .mwrc are a little OTT for now but warn on
 	   subsequent mwscript loads */
-	if (do_warn)
+	if (do_warn_of_mwscript_death)
 		warn_of_mwscript_death(filename);
 	else
-		do_warn = 1;
+		do_warn_of_mwscript_death = 1;
 
 	lineno=0;
 	while (!feof(file))


=====================================
src/client/talker.c
=====================================
--- a/src/client/talker.c
+++ b/src/client/talker.c
@@ -341,6 +341,7 @@ void t_mwrc(CommandList *cm, int argc, const char **argv, char *args)
 	}
 }
 
+extern int do_warn_of_mwscript_death;
 void t_restart(CommandList *cm, int argc, const char **argv, char *args)
 {
 	extern var_list_t	var_list;
@@ -353,6 +354,7 @@ void t_restart(CommandList *cm, int argc, const char **argv, char *args)
 	DestroyAllLinks(&alias_list); alias_list = NULL;
 	DestroyAllLinks(&rpc_list); rpc_list = NULL;
 	DestroyAllLinks(&event_list); event_list = NULL;
+	DestroyAllLinks(&eventin_list); eventin_list = NULL;
 	DestroyAllLinks(&onoff_list); onoff_list = NULL;
 	DestroyAllLinks(&ipc_list); ipc_list = NULL;
 	DestroyAllLinks(&force_list); force_list = NULL;
@@ -363,6 +365,7 @@ void t_restart(CommandList *cm, int argc, const char **argv, char *args)
 
 	RoomDestroy(&user->room);
 
+	do_warn_of_mwscript_death = 0;
 	RoomInit(&user->room);
 	LoadRoom(&user->room, user->record.room);
 



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/c4b787b565bbe00d108253e9a188fce7fd81786d

-- 
View it on GitLab: https://projects.sucs.org/arthur/mw/commit/c4b787b565bbe00d108253e9a188fce7fd81786d
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20181017/cdd381ed/attachment-0001.html>


More information about the mw-devel mailing list