version 1.42 | | version 1.43 |
---|
| | |
| | |
/* | | /* |
* static char *rcsid_loop_c = | | * static char *rcsid_loop_c = |
* "$Id: loop.c,v 1.42 2006/03/18 15:05:37 ryo_saeba Exp $"; | | * "$Id: loop.c,v 1.43 2006/03/19 01:51:46 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
} | | } |
if (!strcasecmp(ns->inbuf.buf, "listen")) { | | if (!strcasecmp(ns->inbuf.buf, "listen")) { |
if (cp) { | | if (cp) { |
char *buf="Socket switched to listen mode\n"; | | const char *buf="Socket switched to listen mode\n"; |
| | |
free(ns->comment); | | free(ns->comment); |
ns->comment = strdup_local(cp); | | ns->comment = strdup_local(cp); |
ns->old_mode = Old_Listen; | | ns->old_mode = Old_Listen; |
cs_write_string(ns, buf, strlen(buf)); | | cs_write_string(ns, buf, strlen(buf)); |
} else { | | } else { |
char *buf="Need to supply a comment/url to listen\n"; | | const char *buf="Need to supply a comment/url to listen\n"; |
cs_write_string(ns, buf, strlen(buf)); | | cs_write_string(ns, buf, strlen(buf)); |
} | | } |
return; | | return; |
| | |
while (isspace(*cp1)) cp1++; | | while (isspace(*cp1)) cp1++; |
} | | } |
if (!cp || !cp1) { | | if (!cp || !cp1) { |
char *buf="Need to provide a name/password to name\n"; | | const char *buf="Need to provide a name/password to name\n"; |
cs_write_string(ns, buf, strlen(buf)); | | cs_write_string(ns, buf, strlen(buf)); |
return; | | return; |
} | | } |
| | |
if (verify_player(cp, cp1)==0) { | | if (verify_player(cp, cp1)==0) { |
char *buf="Welcome back\n"; | | const char *buf="Welcome back\n"; |
free(ns->comment); | | free(ns->comment); |
ns->comment = strdup_local(cp); | | ns->comment = strdup_local(cp); |
ns->old_mode = Old_Player; | | ns->old_mode = Old_Player; |
| | |
else if (verify_player(cp, cp1)==2) { | | else if (verify_player(cp, cp1)==2) { |
ns->password_fails++; | | ns->password_fails++; |
if (ns->password_fails >= MAX_PASSWORD_FAILURES) { | | if (ns->password_fails >= MAX_PASSWORD_FAILURES) { |
char *buf="You failed to log in too many times, you will now be kicked.\n"; | | const char *buf="You failed to log in too many times, you will now be kicked.\n"; |
LOG(llevInfo, "A player connecting from %s in oldsocketmode has been dropped for password failure\n", | | LOG(llevInfo, "A player connecting from %s in oldsocketmode has been dropped for password failure\n", |
ns->host); | | ns->host); |
cs_write_string(ns, buf, strlen(buf)); | | cs_write_string(ns, buf, strlen(buf)); |
ns->status = Ns_Dead; | | ns->status = Ns_Dead; |
} | | } |
else { | | else { |
char *buf="Could not login you in. Check your name and password.\n"; | | const char *buf="Could not login you in. Check your name and password.\n"; |
cs_write_string(ns, buf, strlen(buf)); | | cs_write_string(ns, buf, strlen(buf)); |
} | | } |
} | | } |
else { | | else { |
char *buf="Could not login you in. Check your name and password.\n"; | | const char *buf="Could not login you in. Check your name and password.\n"; |
cs_write_string(ns, buf, strlen(buf)); | | cs_write_string(ns, buf, strlen(buf)); |
} | | } |
return; | | return; |