Created wmud_player_auth()
This commit is contained in:
parent
82199f0737
commit
f92c9f5ade
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user