diff --git a/channel.c b/channel.c index 0e5f90a..d4df2f7 100644 --- a/channel.c +++ b/channel.c @@ -53,6 +53,14 @@ return(0x1); } /* End tuveChanPart(); */ + +int tuveChanResume(const char *channel) { + char output[256]; + tuveChanList_t *tmpChan = 0x0; + tmpChan = findChan(channel); + sprintf(output,"CURPOS:%i:%s:%s:%i:%i\n",tmpChan->songTime - (tmpChan->videoEnd - (time(NULL) + VIDE_PAD_TIME)),tmpChan->videoFile,tmpChan->videoTitle,tmpChan->songTime,tmpChan->vid); + tuveSendAllInChan(channel,0x0,output); + } /* * Joins A User To A Channel diff --git a/tuve.c b/tuve.c index 25e2b4f..92a5001 100644 --- a/tuve.c +++ b/tuve.c @@ -289,6 +289,19 @@ userConnection->userInfo.queue = 0; } } + else if (strcasecmp(cmd,"LIVE") == 0x0) { + if (data != 0x0) { + tok_last = 0x0; + chan = strtok_r(data,":",&tok_last); + msg = strtok_r(NULL,"\n",&tok_last); + if (msg[0] == '0') + tuveChanResume(chan); + else { + sprintf(output,"CURPOS:-1:%s:Live Stream:600:0\n",msg); + tuveSendAllInChan(chan,0x0,output); + } + } + } else { sSendData(userConnection,"invalid command\n"); writeLog(1,"Invalid CMD: [%s]\n",cmd);