/*************************************************************************** aurora.c - The main code that holds aurora together ------------------- begin : Wed Feb 26 2003 copyright : (C) 2003 by Mat Harris email : mat.harris@genestate.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* Load up all the necessary system libraries */ #include #include #include #include #include #include #include #include #include #include /* Load all my libraries and headers for this project */ #include "conf.h" #include "socket" int main() { int fdnet, count; char readbuf[1024], wbuf[1024], scratch[1024]; if ((fdnet = start_socket(PORT)) < 0) { perror("Socket Error"); exit(1); } else { printf ("Socket connected\n"); strcpy(wbuf, "USER "); strcat(wbuf, BOTNICK); strcat(wbuf, " "); strcat(wbuf, BOTNICK); strcat(wbuf, " "); strcat(wbuf, BOTNICK); strcat(wbuf, " "); strcat(wbuf, BOTNICK); strcat(wbuf, " "); strcat(wbuf, BOTNICK); strcat(wbuf, "\n"); write(fdnet, wbuf, sizeof(wbuf)); printf("Sent: %s\n", wbuf); strcpy(wbuf, "NICK "); strcat(wbuf, BOTNICK); strcat(wbuf, "\n"); write(fdnet, wbuf, sizeof(wbuf)); printf("Sent: %s", wbuf); read(fdnet, readbuf, sizeof(readbuf)); printf("%s", readbuf); /* strcpy(scratch, readbuf[0]); strcat(scratch, readbuf[1]); strcat(scratch, readbuf[2]); strcat(scratch, readbuf[3]); pingreply(readbuf); strcpy(wbuf, "JOIN "); strcat(wbuf, CHANNEL); strcat(wbuf, "\n\r"); write(fdnet, wbuf, sizeof(wbuf));*/ } return 1; }