From 9cdab465f1917a2e3fd83f90fc96a7e37471a4e9 Mon Sep 17 00:00:00 2001 From: Polonkai Gergely Date: Fri, 23 Mar 2012 10:05:51 +0000 Subject: [PATCH] Added password requesting --- src/networking.c | 5 +++++ src/networking.h | 5 +++++ src/players.c | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/src/networking.c b/src/networking.c index c8700f2..5f5c7b1 100644 --- a/src/networking.c +++ b/src/networking.c @@ -313,6 +313,11 @@ wmud_client_start_login(wmudClient *client) wmud_client_send(client, "Your registration is not finished yet.\r\n"); wmud_client_close(client, TRUE); } + else + { + client->state = WMUD_CLIENT_STATE_PASSWAIT; + wmud_client_send(client, "Please provide us your password: %c%c%c", TELNET_IAC, TELNET_WONT, TELNET_ECHO); + } } else { diff --git a/src/networking.h b/src/networking.h index a5e9db3..f7d6d2b 100644 --- a/src/networking.h +++ b/src/networking.h @@ -5,6 +5,11 @@ #include "wmud_types.h" +#define TELNET_IAC '\xff' +#define TELNET_WONT '\xfc' +#define TELNET_WILL '\xfb' +#define TELNET_ECHO '\x01' + extern GSList *clients; gboolean wmud_networking_init(guint port_number, GError **err); diff --git a/src/players.c b/src/players.c index b585c43..67f6d0b 100644 --- a/src/players.c +++ b/src/players.c @@ -16,7 +16,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include +#ifdef HAVE_CRYPT_H +#include +#endif #include "networking.h" #include "players.h" @@ -26,6 +33,8 @@ GSList *players = NULL; gboolean wmud_player_auth(wmudClient *client) { + g_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Player entered %s as password", client->buffer->str); + return FALSE; }