]> git.pond.sub.org Git - empserver/blobdiff - src/client/login.c
COPYING duplicates information from README. Remove. Move GPL from
[empserver] / src / client / login.c
index 869eb1deb657bfe12b8971888d2a728866ff9768..e88f6d57a86d057bfdc5242c95fc45a99f6505da 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -19,9 +19,9 @@
  *
  *  ---
  *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
@@ -32,6 +32,8 @@
  *     Steve McClure, 1998
  */
 
+#include <config.h>
+
 #include "misc.h"
 #include "proto.h"
 
@@ -55,8 +57,10 @@ login(int s, char *uname, char *cname, char *cpass, int kill_proc, int utf8)
     if (!expect(s, C_INIT, buf))
        return 0;
     (void)sendcmd(s, "user", uname);
-    if (!expect(s, C_CMDOK, buf))
+    if (!expect(s, C_CMDOK, buf)) {
+       fprintf(stderr, "Server rejects your user name\n");
        return 0;
+    }
     if (utf8) {
        sendcmd(s, "options", "utf-8");
        for (;;) {
@@ -71,6 +75,7 @@ login(int s, char *uname, char *cname, char *cpass, int kill_proc, int utf8)
     }
     if (cname == NULL) {
        (void)printf("Country name? ");
+       fflush(stdout);
        cname = fgets(tmp, sizeof(tmp), stdin);
        if (cname == NULL || *cname == 0)
            return 0;
@@ -80,7 +85,7 @@ login(int s, char *uname, char *cname, char *cpass, int kill_proc, int utf8)
        cname[len-1] = 0;
     (void)sendcmd(s, "coun", cname);
     if (!expect(s, C_CMDOK, buf)) {
-       (void)fprintf(stderr, "empire: no such country\n");
+       (void)fprintf(stderr, "No such country\n");
        return 0;
     }
     if (cpass == NULL) {
@@ -91,6 +96,7 @@ login(int s, char *uname, char *cname, char *cpass, int kill_proc, int utf8)
 #else
        printf("Note: This is echoed to the screen\n");
        printf("Your name? ");
+       fflush(stdout);
        cpass = fgets(tmp, sizeof(tmp), stdin);
        if (cpass == NULL || *cpass == 0)
            return 0;
@@ -129,5 +135,6 @@ login(int s, char *uname, char *cname, char *cpass, int kill_proc, int utf8)
        printf("   this version: %d, current version: %d\n",
               CLIENTPROTO, atoi(ptr));
     }
+    fflush(stdout);
     return 1;
 }