X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fircd_client.c;h=77e1b6c5bfaae7efcab32220e7943bd481e769ce;hb=b708125495aacd544ee33d252368814acae5adb9;hp=9ef6451131669355d1da8a5eb943fb1df3c19870;hpb=d7385887d5b489a515a111235eae339a4284d81e;p=NextIRCd.git diff --git a/src/ircd_client.c b/src/ircd_client.c index 9ef6451..77e1b6c 100644 --- a/src/ircd_client.c +++ b/src/ircd_client.c @@ -18,16 +18,25 @@ #include "ircd_client.h" #include "ircd_sock.h" #include "struct_connection.h" +#include "struct_client.h" #include "struct_auth.h" -#include "config.h" -#include "version.h" +#include "ircd_config.h" #include #include #include #define CLIENT_MAXLEN 512 -static void client_printf(struct Connection *conn, const char *text, ...) { +struct Client *client_connected(struct Auth *auth) { + struct Client *client = calloc(1, sizeof(*client)); + client->conn = auth->conn; + + client_printf(client, "Hi"); + + return client; +} + +void client_printf(struct Client *client, const char *text, ...) { va_list arg_list; char sendBuf[CLIENT_MAXLEN]; int pos; @@ -38,23 +47,12 @@ static void client_printf(struct Connection *conn, const char *text, ...) { if (pos < 0 || pos > (CLIENT_MAXLEN - 2)) pos = CLIENT_MAXLEN - 2; sendBuf[pos] = '\n'; sendBuf[pos+1] = '\0'; - socket_send(conn, sendBuf, pos+1); -} - -void client_connected(struct Connection *conn) { - client_printf(conn, "NOTICE AUTH :*** NextIRCd v%d.%d (%s)", VERSION_NUMBER, patchlevel, revision); - - struct Auth *auth = calloc(1, sizeof(*auth)); - auth->conn = conn; - conn->data.auth = auth; - - /* maybe do some stuff here? */ -} - -void client_disconnected(struct Connection *conn) { - + socket_send(client->conn, sendBuf, pos+1); } -void client_recv(struct Connection *conn, char *line) { - +void client_exit(struct Client *client, char *reason) { + if(client->conn) { + + } + }