[mw-devel] MW3 r978 - in trunk: . src

arthur at sucs.org arthur at sucs.org
Sat Nov 3 14:41:12 GMT 2007


Author: arthur
Date: 2007-11-03 14:41:12 +0000 (Sat, 03 Nov 2007)
New Revision: 978

Modified:
   trunk/mw.spec
   trunk/src/Makefile
   trunk/src/edit.c
   trunk/src/newmain.c
   trunk/src/user.c
Log:
improve the timeouts a little


Modified: trunk/mw.spec
===================================================================
--- trunk/mw.spec	2007-10-26 10:27:02 UTC (rev 977)
+++ trunk/mw.spec	2007-11-03 14:41:12 UTC (rev 978)
@@ -1,6 +1,6 @@
 Summary: Milliways III talker and BBS
 Name: mw3
-Version: 2.15.2
+Version: 2.15.3
 Release: 0
 License: GPL
 Group: Applications/Communications

Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile	2007-10-26 10:27:02 UTC (rev 977)
+++ trunk/src/Makefile	2007-11-03 14:41:12 UTC (rev 978)
@@ -7,7 +7,7 @@
 VERSION_MAJOR= 2
 VERSION_MINOR= 15
 # Change this one on feature increases/fixes, return to 0 on branch
-VERSION_TWEAK= 2
+VERSION_TWEAK= 3
 
 # Full version number
 VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_TWEAK)

Modified: trunk/src/edit.c
===================================================================
--- trunk/src/edit.c	2007-10-26 10:27:02 UTC (rev 977)
+++ trunk/src/edit.c	2007-11-03 14:41:12 UTC (rev 978)
@@ -336,13 +336,23 @@
 	{
 		char	tt[20];
 		int	tv;
+		int	units=1;
 		printf(_("Timeout: %ld sec.\n"),(long)usr.timeout);
-		printf(_("New timeout value (seconds): "));
+		printf(_("New timeout value: "));
 		get_str(tt,CONTACTSIZE);
 		if (*tt)
 		{
-			tv = atoi(tt);
+			if (strchr(tt,'m') || strchr(tt,'M'))
+				units = 60;
+			else
+			if (strchr(tt,'h') || strchr(tt,'H'))
+				units = 3600;
+			else
+			if (strchr(tt,'d') || strchr(tt,'D'))
+				units = 86400;
 
+			tv = atoi(tt) * units;
+
 			if (tv==0)
 			{
 				if (usr.timeout != 0)
@@ -358,9 +368,9 @@
 					printf(_("TIMEOUT was already disabled.\n"));
 				}
 			}
-			else if ((tv<600 || tv> 10800) && (tv!=0))
+			else if (tv<600 && (tv!=0))
 			{
-				printf(_("TIMEOUT must be between 10 minutes (600), and 3 hours (10800), or 0 to disable.\n"));
+				printf(_("TIMEOUT must be be at least 10 minutes (600), or 0 to disable.\n"));
 			}
 			else
 			{

Modified: trunk/src/newmain.c
===================================================================
--- trunk/src/newmain.c	2007-10-26 10:27:02 UTC (rev 977)
+++ trunk/src/newmain.c	2007-11-03 14:41:12 UTC (rev 978)
@@ -845,10 +845,22 @@
 void c_timeout(CommandList *cm, int argc, char **argv, char *args)
 {
 	int z=atoi(argv[1]);
+	int units=1;
 
-	if (z<600 || z> 10800)
+	if (strchr(argv[1],'m') || strchr(argv[1],'M'))
+		units = 60;
+	else
+	if (strchr(argv[1],'h') || strchr(argv[1],'H'))
+		units = 3600;
+	else
+	if (strchr(argv[1],'d') || strchr(argv[1],'D'))
+		units = 86400;
+
+	z *= units;
+
+	if (z<600)
 	{
-		printf(_("TIMEOUT must be between 10 minutes (600), and 3 hours (10800).\n"));
+		printf(_("TIMEOUT must be at least 10 minutes.\n"));
 	}else
 	{
 		if (user->timeout!=z)

Modified: trunk/src/user.c
===================================================================
--- trunk/src/user.c	2007-10-26 10:27:02 UTC (rev 977)
+++ trunk/src/user.c	2007-11-03 14:41:12 UTC (rev 978)
@@ -280,7 +280,7 @@
 	tmp->chatmode=0;
 	tmp->chatprivs=0l;
 	/* default timeout value */
-	tmp->timeout = 1800;
+	tmp->timeout = 86400;
 
 
 /********************************************





More information about the mw-devel mailing list