/* File.c ** The socket's core of this code has been made by wildthang ** . You can modify it but not distribute it ** modified. This file is part of MudBot and is (C) 1997 by Drow ** All rights reserved. */ #include #include #include #include "config.h" #include "vars.h" /* #ifndef _TIME_T #define _TIME_T typedef int time_t; #endif */ FILE *FP; int user_count = 0; int prot_count = 0; static int logstatus = 1; char users[100][30][50] ={ "" }; char protect[50][3][30]={ "" }; FILE *logfp; int logstats=0; chk_msgs(sck) int sck; { int i; char temp[255]; FILE *fp; if(token[4]==NULL || token[5]==NULL) { sprintf(buf,"NOTICE %s :Syntax: !readmsg \n",token[0]); writeln(sck,buf); return 0; } for(i=0;i \n",token[0]); writeln(sck,buf); return 0; } for(i=0;i !unvalidate before leaving IRC.\n",token[0],users[i][0]); writeln(sck,buf); fpa=fopen("stats.file","a"); fputs("A\n",fpa); if(fpa!=NULL) fclose(fpa); strcpy(users[i][4],"1"); strcpy(temp,users[i][2]); strcat(temp,".notes"); if((fpa=fopen(temp,"r"))!=NULL) { if(fgets(temp,255,fpa)!=NULL) { if(cas_cmp(temp,"")) { sprintf(buf,"NOTICE %s :You have new messages.. use !readmsg to see them..\n",token[0]); writeln(sck,buf); } } } if(fpa!=NULL) fclose(fpa); fp=fopen("seen.file","a"); fputs(users[i][2],fp); fputs(" ",fp); fputs(ctime(<),fp); fputs("\n",fp); if(fp!=NULL) fclose(fp); } } #ifdef REPORTS if(z==0) { sprintf(buf,"PRIVMSG %s :Failed AUTH attempt by %s\n",REPORTS,token[0]); writeln(sck,buf); } #endif } do_up(sck) int sck; { FILE *fp; int i,j; char templ[512]=""; if(token[4] == NULL) return 0; if(token[5] == NULL) return 0; fp = fopen(LOCALFILE,"r"); sprintf(buf,"NOTICE %s :Looking for access...\n",token[0]); writeln(sck,buf); for(i=0;i