Now increasing the player login fail count, and displaying it to logging in players if non-zero.
Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
parent
d92c9960ba
commit
90f870c48a
@ -201,7 +201,10 @@ wmud_client_callback(GSocket *client_socket, GIOCondition condition, wmudClient
|
||||
" successful.\r\n", TELNET_IAC,
|
||||
TELNET_WONT, TELNET_ECHO);
|
||||
client->authenticated = TRUE;
|
||||
/* TODO: Send fail count if non-zero */
|
||||
if (client->player->fail_count > 0)
|
||||
{
|
||||
wmud_client_send("There %s %d failed login attempt%s with your account since your last visit\r\n", (client->player->fail_count == 1) ? "was" : "were", client->player->fail_count, (client->player->fail_count > 1) ? "s" : "");
|
||||
}
|
||||
client->state = WMUD_CLIENT_STATE_MENU;
|
||||
/* TODO: send MOTD */
|
||||
/* TODO: send menu items */
|
||||
@ -215,6 +218,7 @@ wmud_client_callback(GSocket *client_socket, GIOCondition condition, wmudClient
|
||||
" name would you like to be called? ",
|
||||
TELNET_IAC, TELNET_WONT, TELNET_ECHO);
|
||||
client->state = WMUD_CLIENT_STATE_FRESH;
|
||||
client->player->fail_count++;
|
||||
client->login_try_count++;
|
||||
if (client->login_try_count == 3)
|
||||
{
|
||||
|
@ -79,6 +79,7 @@ typedef struct _wmudPlayer {
|
||||
gchar *player_name;
|
||||
gchar *cpassword;
|
||||
gchar *email;
|
||||
gint fail_count;
|
||||
} wmudPlayer;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user