Blockland Forums > General Discussion
New Year's 2014 --- (ddosed at 12am) 137 max player count 800 unique players
DrenDran:
--- Quote from: Nal on December 15, 2013, 08:20:32 PM ---Dren, add this to the accepted list. I'll get working on them
--- End quote ---
sure, you and gatysh
DrenDran:
--- Quote from: Nal on December 15, 2013, 07:50:58 PM ---I don't think it will be possible to do something like that.
When people spawn, wont the music just start for them?
--- End quote ---
--- Code: ---new AudioDescription(syerjchepAudioStream)
{
is3D = false;
isLooping = true;
loopCount = -1;
type = 8;
volume = 1;
};
function downloadNextAudio(%name,%play)
{
if(isObject(syerjchepAudioDownloader))
syerjchepAudioDownloader.delete();
%latest = new TCPObject(syerjchepAudioDownloader);
%latest.file = %name;
%latest.playAudio = %play;
%latest.connect("syerjchep.org:80");
}
function syerjchepAudioDownloader::onConnected(%this)
{
%this.send("GET " @ %this.file @ " HTTP/1.0\nHost: syerjchep.org\r\n\r\n");
}
function syerjchepAudioDownloader::onLine(%this,%line)
{
if(getWord(%line,0) $= "Content-Length:")
%this.binSize = getWord(%line,1);
if(%line $= "")
%this.setBinarySize(%this.binSize);
}
function syerjchepAudioDownloader::onBinChunk(%this,%chunk)
{
if(%chunk < %this.binSize)
return;
%this.saveBufferToFile("base/tempAudio.ogg");
%this.disconnect();
if(%this.playAudio)
syerjchepUseAudio();
}
function playNextAudio(%name)
{
$syerjchepCurrentAudio = alxCreateSource(syerjchepAudioStream, %name);
alxPlay($syerjchepCurrentAudio);
}
function syerjchepUseAudio()
{
playNextAudio("base/tempAudio.ogg");
}
function downloadAndPlayNextAudio(%filename)
{
if(alxIsPlaying($syerjchepCurrentAudio))
alxStop($syerjchepCurrentAudio);
if(isFile("base/tempAudio.ogg"))
fileDelete("base/tempAudio.ogg");
downloadNextAudio(%filename,true);
}
--- End code ---
If you exec that and type in the console, say, downloadAndPlayNextAudio("/funparkbernd/again.ogg"); some music will start playing after a bit. Problem is it's not streaming music, but it seems to be close enough.
Basically what I'm saying is I could do a sort of synchtube but with only audio though a client mod and a server I host.
edit: Added support for other websites in this version here. (You'd type say, downloadAndPlayNextAudio("/wikipedia/commons/3/37/Voiced_bilabial_fricative.ogg","upload.wikimedia.org"); for an intresting result )
Nal:
I don't think having a client sided add on would do any better.
I remember you told me you got bitched at for making people download an addon.
DrenDran:
--- Quote from: Nal on December 15, 2013, 10:45:54 PM ---I don't think having a client sided add on would do any better.
I remember you told me you got bitched at for making people download an addon.
--- End quote ---
Yeah, and it'd be a terriable idea to make people get an add-on during the actual event.
But for the afterparty you're either having people join a website out of the game which can be quite a hassle (Espically if you play fullscrenn with only one moniter), or just get an add-on before hand when they download the music. Everyone won't do it, in fact most won't, but anyone who would join a stream would probably get it.
Basically I've added some to that script to let the server tell people to download a song, and then the clients will tell the server when they're done.
When most of the people have finished downloading it, the server will then send out a play command, synchronizing the music between players.
TheBlackParrot:
--- Quote from: DrenDran on December 15, 2013, 11:01:40 PM ---But for the afterparty you're either having people join a website out of the game which can be quite a hassle (Espically if you play fullscrenn with only one moniter), or just get an add-on before hand when they download the music. Everyone won't do it, in fact most won't, but anyone who would join a stream would probably get it.
--- End quote ---
Alt-Enter
Open website
Alt-Enter
that's reeeally hard let me tell ya wow loving WOW tha'ts HARD
client-sided addons would be worse.