GOod Evening, i want to simulate a kind of SC Server via mIRC. winamp is connection on the server and i can play the first song without errors. But if i want to play the second song, WinAMP means i have a buffering.
Heres the Code:
On *:SOCKLISTEN:sc: {
/sockaccept scs
}
On *:SOCKACCEPT:scs: {
}
On *:SOCKWRITE:scs: {
if ( %b == 1 ) {
inc %i 4096
bread %file %i 4096 &kot
if ( $calc($file( %file ).size - %i) > 4096 ) {
/sockwrite -b scs 4096 &kot
}
else {
/sockwrite -b scs $calc($file( %file ).size - %i) &kot
}
}
if ( %i > $file( %file ).size ) { set %b 0 }
}
On *:SOCKREAD:scs: {
sockread %temp
echo -a %temp
if ( GET isin %temp ) {
echo -a br
set %b 1
sockwrite -n scs ICY 200 OK
sockwrite -n scs icy-name:mIRC Streaming ( %file )
sockwrite -n scs icy-url:http://www.shoutcast.com
sockwrite -n scs icy-genre:MircScriptingLanguage
/set %i 0
/bread %file %i 4096 &kot
/sockwrite -b scs 4096 &kot
inc %i 4096
}
}
alias starts {
/set %i 0
/set %file $shortfn($1-)
/bread %file %i 4096 &kot
/sockwrite -b scs 4096 &kot
inc %i 4096
}
%file contains the $shortfn() path of the file
I want to start a new file by entering
/starts <filename>
Please help me