diff --git a/botthread.c b/botthread.c index f896ed0..e781c91 100644 --- a/botthread.c +++ b/botthread.c @@ -316,14 +316,17 @@ sprintf(output,"MSG:TUveD:%s:Playing %s (%d:%.2d)",channel,tmpChan->videoChanTitle,min,sec); tuveSendAllInChan(channel,0x0,output); +/* if (tmpChan->count != -1) { - tmpChan->nextUser = tmpChan->nextUser->next; + if (tmpChan->nextUser != 0x0) + tmpChan->nextUser = tmpChan->nextUser->next; if (tmpChan->nextUser == 0x0) tmpChan->nextUser = tmpChan->users; } +*/ - tmpChan->count = 0x0; + tmpChan->count = MAX_COUNT; return(0x0); } // tuveBotSetSong() @@ -355,6 +358,9 @@ /* Reset Chan Counter */ tmpChans->count = 0x0; + if (tmpChans->nextUser == 0x0) + goto getRandom; + tmpChans->nextUser = tmpChans->nextUser->next; /* Make sure we didn't go beyond the list */ diff --git a/socket.c b/socket.c index 045dd93..fdbcc7e 100644 --- a/socket.c +++ b/socket.c @@ -293,7 +293,6 @@ for (tmpConnection = connections;tmpConnection != 0x0;tmpConnection = tmpConnection->next) { if (FD_ISSET(tmpConnection->fd,readset) != 0x0) { - writeLog(2,"FD_ISSET\n"); if (tmpConnection->fd == listenerFD) { sGetConnection(); writeLog(2,"Listen Socket Was Ready?\n"); diff --git a/tuve.c b/tuve.c index 0fc15e7..388d593 100644 --- a/tuve.c +++ b/tuve.c @@ -14,15 +14,14 @@ int tuveGetData(myConnections_t *userConnection) { - writeLog(2,"Getting Data\n"); memset(&userConnection->data,0x0,1024); userConnection->recLen = sReadSocket(userConnection->fd,&userConnection->data,1024); - if (userConnection->recLen == 0x0) + if (userConnection->recLen <= 0) return(-1); + writeLog(2,"Getting Data\n"); userConnection->userInfo.pong = time(NULL); // Reset the pong time of the socket - tuveProcessData(userConnection); return(0x0); @@ -233,7 +232,7 @@ sprintf(output,"NICK:%s:%s",userConnection->userInfo.username,data); sSendData(userConnection,output); tuveSendAllInUsersChans(userConnection,output); - sprintf(output,"MSG:TUveD:STATUS:%s is now know as %s\n",userConnection->userInfo.username,data); + sprintf(output,"MSG:TUveD:STATUS:%s is now know as %s",userConnection->userInfo.username,data); tuveSendAllInUsersChans(userConnection,output); sprintf(userConnection->userInfo.username,data); }