diff --git a/botthread.c b/botthread.c index b400ae1..d3b48dc 100644 --- a/botthread.c +++ b/botthread.c @@ -54,6 +54,7 @@ tuveSendAllInUsersChans(userConnection,output); userConnection->userInfo.modes[USER_OVERLORD] = 1; } + userConnection->userInfo.ident = 2; } else { sSendData(userConnection,"MSG:TUveD:%s:You have failed login.",chan); @@ -187,6 +188,13 @@ sprintf(output,"MODE:%s:Q:%i",tmpChan->channel,dM); tuveSendAllInChan(chan,0x0,output); break; + case 'X': + tmpChan->modes[CHAN_NOADS] = dM; + sprintf(output,"MSG:TUveD:%s:%s Sets Mode %cNo Advertisements",chan,userConnection->userInfo.username,dMS[dM]); + tuveSendAllInChan(chan,0x0,output); + sprintf(output,"MODE:%s:Q:%i",tmpChan->channel,dM); + tuveSendAllInChan(chan,0x0,output); + break; case 't': case 'T': if (dM == 1) { @@ -411,7 +419,7 @@ if (tmpChans->modes[CHAN_SCHEDULED] == 0x1) goto gotUser; - if (tmpChans->comDelay <= 0) + if ((tmpChans->modes[CHAN_NOADS] == 0) && (tmpChans->comDelay <= 0)) goto getCommercial; diff --git a/socket.c b/socket.c index fdbcc7e..f15ecfc 100644 --- a/socket.c +++ b/socket.c @@ -246,7 +246,7 @@ if (tmpConnection->userInfo.pong < ping) { tmpConnection->userInfo.pfailed++; tmpConnection->userInfo.pong = ping; - if (tmpConnection->userInfo.ident == 0x1) { + if (tmpConnection->userInfo.ident >= 0x1) { sprintf(sPing,"PING %i\r\n", time(NULL)); send(tmpConnection->fd,sPing,strlen(sPing),MSG_NOSIGNAL); } diff --git a/tuved.h b/tuved.h index ab6e723..eb0bd74 100644 --- a/tuved.h +++ b/tuved.h @@ -45,7 +45,7 @@ #define USER_AWAY 1 // User Is Away /* Cannel Modes */ -#define CHAN_MODES 8 // Count Of Channel Modes +#define CHAN_MODES 9 // Count Of Channel Modes #define CHAN_RANDOM 0 // Random Videos #define CHAN_QUEUE 1 // Users Queues #define CHAN_TIME 2 // Video Time Limit @@ -54,6 +54,7 @@ #define CHAN_LIVE 5 // Channel Is In Live Stream Mode #define CHAN_EXCLUSIVE 6 // Channel Is In Exclusive Mode #define CHAN_SCHEDULED 7 // Channel Is In Scheduled Mode +#define CHAN_NOADS 8 // Channel Will Not Play Advertisements typedef struct tuveUserList { struct tuveUserList *prev;