[mw-devel] MW3 r1226 - trunk/webclient

tswsl1989 at sucs.org tswsl1989 at sucs.org
Sun Oct 17 21:16:23 BST 2010


Author: tswsl1989
Date: 2010-10-17 21:16:23 +0100 (Sun, 17 Oct 2010)
New Revision: 1226

Modified:
   trunk/webclient/say.js
Log:
Fix blank argument bug and return usage instructions on error


Modified: trunk/webclient/say.js
===================================================================
--- trunk/webclient/say.js	2010-10-15 09:51:13 UTC (rev 1225)
+++ trunk/webclient/say.js	2010-10-17 20:16:23 UTC (rev 1226)
@@ -142,6 +142,12 @@
 		sendCmdHandle('who', drawWho);
 		break;
 	case "room":
+                if (args == undefined){
+                        $('#textlist').append("<div class='error'>Usage: "+cmd+" &lt;number&gt;</div>");
+                }else{
+                        $.getJSON("send.php", {send: what});
+                }
+
 		sendCmd('channel '+args);
 		break;
 	case "e":
@@ -149,7 +155,11 @@
 	case "emote":
 	case "me":
 		var what = "emote "+args;
-                $.getJSON("send.php", {send: what});
+		if (args == undefined){
+			$('#textlist').append("<div class='error'>Usage: "+cmd+" &lt;text&gt;</div>");
+		}else{
+	                $.getJSON("send.php", {send: what});
+		}
 		break;
 	case "sayto":
 	case "sa":
@@ -157,6 +167,12 @@
 	case "whi":
 		var what = "sayto "+args;
 		$.getJSON("send.php", {send: what});
+                if (args == undefined||!args.match(" .* ")){
+			$('#textlist').append("<div class='error'>Usage: "+cmd+" &lt;user&gt; &lt;text&gt;</div>");
+		}else{
+		        $.getJSON("send.php", {send: what});
+		}
+
 		break;
 	case "q":
 	case "qq":




More information about the mw-devel mailing list