From ddf8b91984265a34b74294f33de1b9bf3da882ba Mon Sep 17 00:00:00 2001 From: Spoike Date: Mon, 17 Sep 2007 20:55:15 +0000 Subject: [PATCH] Gave meaningful error messages, should be more obvious how to use it now git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2662 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- plugins/jabber/jabberclient.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/jabber/jabberclient.c b/plugins/jabber/jabberclient.c index d41f54459..e632853ea 100644 --- a/plugins/jabber/jabberclient.c +++ b/plugins/jabber/jabberclient.c @@ -125,7 +125,7 @@ void JCL_Command(void); int JCL_ExecuteCommand(int *args) { - char cmd[8]; + char cmd[256]; Cmd_Argv(0, cmd, sizeof(cmd)); if (!strcmp(cmd, COMMANDPREFIX)) { @@ -1098,6 +1098,11 @@ void JCL_Command(void) Con_Printf("You are already connected\nPlease /quit first\n"); return; } + if (!*arg[1]) + { + Con_Printf("%s \n", arg[0]+1); + return; + } jclient = JCL_Connect(arg[1], 5223, true, arg[2], arg[3]); } else if (!strcmp(arg[0]+1, "open") || !strcmp(arg[0]+1, "connect")) @@ -1107,6 +1112,11 @@ void JCL_Command(void) Con_Printf("You are already connected\nPlease /quit first\n"); return; } + if (!*arg[1]) + { + Con_Printf("%s \n", arg[0]+1); + return; + } jclient = JCL_Connect(arg[1], 5222, false, arg[2], arg[3]); } else if (!jclient) @@ -1148,6 +1158,10 @@ void JCL_Command(void) Con_SubPrintf(jclient->defaultdest, "%s: "COLOURYELLOW"%s\n", ">>", msg); } else + { Con_Printf("Not connected\ntype \"" COMMANDPREFIX " /connect JABBERSERVER USERNAME@DOMAIN PASSWORD\" to connect\n"); + if (BUILTINISVALID(Net_SetTLSClient)) + Con_Printf("eg: " COMMANDPREFIX " /tlsconnect talk.google.com myusername@gmail.com mypassword\n"); + } } }