/*
* 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
*
* ---
*
- * 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.
*
* ---
*
* Steve McClure, 1998
*/
+#include <config.h>
+
#include "misc.h"
#include "proto.h"
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 (;;) {
}
if (cname == NULL) {
(void)printf("Country name? ");
+ fflush(stdout);
cname = fgets(tmp, sizeof(tmp), stdin);
if (cname == NULL || *cname == 0)
return 0;
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) {
#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;
printf(" this version: %d, current version: %d\n",
CLIENTPROTO, atoi(ptr));
}
+ fflush(stdout);
return 1;
}