Created wmud_player_auth()

This commit is contained in:
Polonkai Gergely 2012-03-23 10:36:02 +00:00
parent 82199f0737
commit f92c9f5ade
2 changed files with 4 additions and 0 deletions

View File

@ -316,6 +316,7 @@ wmud_client_start_login(wmudClient *client)
else else
{ {
client->state = WMUD_CLIENT_STATE_PASSWAIT; 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); wmud_client_send(client, "Please provide us your password: %c%c%c", TELNET_IAC, TELNET_WONT, TELNET_ECHO);
} }
} }

View File

@ -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); 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; return FALSE;
} }