diff --git a/src/networking.c b/src/networking.c index 5f5c7b1..81f0e9d 100644 --- a/src/networking.c +++ b/src/networking.c @@ -316,6 +316,7 @@ wmud_client_start_login(wmudClient *client) else { client->state = WMUD_CLIENT_STATE_PASSWAIT; + client->player = player; wmud_client_send(client, "Please provide us your password: %c%c%c", TELNET_IAC, TELNET_WONT, TELNET_ECHO); } } diff --git a/src/players.c b/src/players.c index 67f6d0b..dc5eaa2 100644 --- a/src/players.c +++ b/src/players.c @@ -35,6 +35,9 @@ wmud_player_auth(wmudClient *client) { g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Player entered %s as password", client->buffer->str); + if (g_strcmp0(crypt(client->buffer->str, client->player->cpassword), client->player->cpassword) == 0) + return TRUE; + return FALSE; }