• WolfDJ 3.0 - Stream music to players. Includes web-code
    236 replies, posted
  • Avatar of mr.wolf
  • [release] [b]Features[/b] * Players can choose from a list of songs to stream while playing on the server. * Administrators can stream a song to all players * Players may choose to ignore server-wide songs * Volume control for songs playing * Server-side song queue is preserved through map changes * Nomination system to allow non-admins to vote on songs to stream to all players. (optional) * Easy to use web interface allows server owners to add and delete songs. Changes take effect immediately. * Installs in just a few minutes * Password protected web-interface * [b][i]New:[/i][/b] Players playing songs locally can enable Radio Mode to play a new song after the current song finishes * [b][i]New:[/i][/b] Quicksearch allows players to easily find a song they want to play * [b][i]New:[/i][/b] Easy to customize options including keybinds, sources, nomination limits, and more [b]Requirements[/b] * Web readable directory on a webserver * PHP5 with sqlite [b]Installation Tutorial Video[/b] One of the drawbacks of previous versions of WolfDJ was the installation of the web-side code. Here's a simple video showing how easy version 3.0 is to install. [media]http://www.youtube.com/watch?v=Yf6_tW45L_E[/media] [b]Screenshots[/b] [url]http://release.wolfcode.net/projects/wolfdj/1.png[/url] [url]http://release.wolfcode.net/projects/wolfdj/2.png[/url] [url]http://release.wolfcode.net/projects/wolfdj/3.png[/url] [url]http://release.wolfcode.net/projects/wolfdj/4.png[/url] [url]http://release.wolfcode.net/projects/wolfdj/5.png[/url] [url]http://release.wolfcode.net/projects/wolfdj/6.png[/url] [url]http://release.wolfcode.net/projects/wolfdj/7.png[/url] [url]http://release.wolfcode.net/projects/wolfdj/8.png[/url] [b]Download[/b] [url]http://release.wolfcode.net/wolfdj[/url] [/release] I've had enough requests to put it back up recently that I decided to go ahead and release the current version of WolfDJ that I've been using on my own servers for a while. It boasts a few new features, and I've also completely redone the web-side code to be easier to install and manage. Let me know if there are any bugs that need fixing or feature you'd like added. Props to Skapocalypse for his original gStream which both inspired me to get this started, and served as the basis for version 1. Also thanks to the developers of WordPress Audio Player for the flash that drives the player. [url]http://wpaudioplayer.com/[/url] JumpLoader is used for the file uploads. [url]http://jumploader.com/[/url] [b]Note:[/b] If you are encountering errors, be sure that you are using the latest revision [b]Revision 15[/b] [b]Common Issues[/b] [i]Internal Server Error[/i] You messed up the htaccess file. The most common problem is an invalid path to the htpasswd file. It must be an absolute path from the root. Jailed users may have trouble with this, but it is usually /home/your-username/path/to/wolfdj/admin/.htpasswd [i]Something about can't find sqlite blah blah blah[/i] You don't have sqlite installed. You should fix that or it won't work. [i]None of my files will upload![/i] You haven't set the permissions for the limbo and music folders. Make sure your webserver has permissions to write to it. I think I did forget to mention that in the video. My apologies. Setting them to chmod 775 is usually fine. [b]magic_quotes messes up a lot of stuff[/b] There is a php setting called magic_quotes that messes up quite a lot of functions. It autoescapes all form data. The result is that strings get double escaped when inserted into the DB, since I am also manually escaping them. Therefore, if you get errors about "couldn't unlink file asdf''''''''''''.mp3", you have magic_quotes enabled, and you should disable it. If you can't disable it for whatever reason, then try deleting all of the escaping I am doing in the code instead. [b]Having trouble with a Windows webserver and sqlite? Try the following: (Thanks ColdFusion)[/b] [quote] 1. Enable sqllite by uncommenting extension=php_pdo.dll extension=php_sqlite.dll in php.ini 2. Download the windows support files for getID3 else it will silently fail [url]http://sourceforge.net/projects/geti...ows%20Support/[/url] 3. Copy the files in the zip to random folder 4. Specifie the folder location in wolfdj\admin\lib\getid3.php by addeding this line to the top of the file define('GETID3_HELPERAPPSDIR', 'C:/Your/Folder/'); //(No spaces end path with a / ) [/quote]
  • Avatar of mr.wolf
  • [QUOTE=Buggzie;28889879]Do you need a mirror, space and bandwidth? I can supply if you wish.[/QUOTE] Not really, the SVN is small and takes up very little space. I've only uploaded 4 songs to my sample site, and don't plan on uploading more. This is designed for people to set up their own servers and manage their own song lists. If you use mine, you'll only ever have the 4 songs. If other people need a mirror, I'm sure they'll be grateful though =)
  • Avatar of GuyRun01
  • [QUOTE=mr.wolf;28889922]Not really, the SVN is small and takes up very little space. I've only uploaded 4 songs to my sample site, and don't plan on uploading more. This is designed for people to set up their own servers and manage their own song lists. If you use mine, you'll only ever have the 4 songs. If other people need a mirror, I'm sure they'll be grateful though =)[/QUOTE] The uploader. Does it have MIME protection? I could theoretically upload a shell and hax ur site if it doesn't.
  • Avatar of mr.wolf
  • [QUOTE=GuyRun01;28890483]The uploader. Does it have MIME protection? I could theoretically upload a shell and hax ur site if it doesn't.[/QUOTE] The java applet won't accept non-mp3 extensions. You could rename the extension, but then it gets kicked out when it doesn't have valid id3 data. If you can find a way to give an exe id3 data, then have at it. Also, the upload forms are password protected, so normal users can't upload files anyway. Only the site owner can unless they remove the password, in which case they are opening themselves up for attack. [editline]30th March 2011[/editline] Also, just as an added security measure, I added additional htaccess files to deny access to the tmp and limbo directories, where the files wait before they are verified and copied into the music directory.
  • Avatar of GuyRun01
  • Hmm... [code] [@LuaCmd:1] Tried to use invalid object (type Panel) (Object was NULL or not of the right type) [/code] [b][u]SEEMS[/u][/b] to appear once the HUD dissapears. (The Player hud, not the F7 menu.) Aesthetically, theres double spacing before the song name, [MogzDJ] (MG) Melon Wizard - LIFEGOESON wants to play Magic Kinda makes it look sloppy, I've fixed it in my edited version, you might want to too. Menu-wise, i see NO issues at all, works perfectly except for when you only press "Add to Queue" on its own. You'll get THIS error: [code] [@wolfdj\client\cl_menu.lua:212] bad argument #1 to 'gsub' (string expected, got nil) [/code] Might want to fix that + Might want to add the support of Double Click being 'Add to Queue' too, so peeps don't have to waste extra time. Also done in my edited version ;P "You'll need to install flash for Chrome or Firefox for it to work in-game" For one, chrome COMES with flash, and two, i think Steam uses its own rendering now, WebKit, you can always install it by using "Flash for Other Browsers" on the site, but I seriously think that it uses its own now, correct me if i'm wrong. Made myself a Web-Play app myself, lol. My own streamer etc, found at my site; [url]http://mogzgaming.co.uk/misc.php?page=jukebox[/url] Looks shabby, but does the job. Good piece of kit. +1 Internetz.
  • Avatar of mr.wolf
  • Yeah, not sure about the LuaCmd error. I've noticed it popping up recently. It seems to happen when the song changes while the menu is minimized. I'll see if I can track it down. I think the forums ate your spaces. The extra spaces are before the song name you say? Mind pasting your double-click code? It would save me some time. The flash thing is just from experience. Although it does use it's own webkit-based rendering engine, it seems as though installing flash for either firefox or chrome fixes any issues. Again, this is just from limited experiments and what has proven to fix people's problems. Nice web app. I made one myself: [url]http://terminalshell.com/dj[/url] I need to modify the interface to use jumploader, since I wrote the fancy easy-to-use version after I made my get-it-done-quick version for my personal use =P
  • Avatar of GuyRun01
  • [QUOTE=mr.wolf;28893082]Yeah, not sure about the LuaCmd error. I've noticed it popping up recently. It seems to happen when the song changes while the menu is minimized. I'll see if I can track it down. I think the forums ate your spaces. The extra spaces are before the song name you say? Mind pasting your double-click code? It would save me some time. The flash thing is just from experience. Although it does use it's own webkit-based rendering engine, it seems as though installing flash for either firefox or chrome fixes any issues. Again, this is just from limited experiments and what has proven to fix people's problems. Nice web app. I made one myself: [url]http://terminalshell.com/dj[/url] I need to modify the interface to use jumploader, since I wrote the fancy easy-to-use version after I made my get-it-done-quick version for my personal use =P[/QUOTE] [code] Stream.MusicWindow.DoDoubleClick = Stream.QueueButton.DoClick [/code] cl_menu.lua (line 215 - after my edits, just after Stream.QueueButton.DoClick's function() ) [code] Stream.QueueWindow.DoDoubleClick = Stream.RemoveButton.DoClick [/code] cl_menu.lua (line 237 - after my edits, just after Stream.RemoveButton.DoClick's function() ) Edit: Just noticed, i ONLY have ONE song on that list, yet its returning TWO in the title: [img]http://mogzgaming.co.uk/dl/twosong.PNG[/img] Any ideas why It could do that? It's not my site coding, v2 worked fine with it. (Yeah, your OLD one, the one with the site that allowed anything to be uploaded :P and was only in black and white, the one that used wolfdj.sqlite. I converted it to mysql. lol) Edit: I'll add another song. See if it DOES still do it, or if its to do with only one song being on. If it hops to 3, i know somethings up.
  • Avatar of ColdFusion
  • all songs seem to do this I just checked and all files seem to arrive properly to the server. [img]http://cold.netburst.co.uk/file/SS-2011-03-30_19.00.35.png[/img]
  • Avatar of mr.wolf
  • [QUOTE=ColdFusion;28893851]all songs seem to do this[/QUOTE] Where are you getting your mp3's from? They need to be valid mp3's with metadata. If you REALLY want to bypass this, I just added an optional constant to limbo.php in /admin/. Set REQUIRE_METADATA to false, and it will only check the playtime_string metadata. If it is a valid mp3 file, it really needs to have playtime_string. Pull the latest revision if you want to play with the REQUIRE_METADATA option, but my advice would be to make sure you are using genuine mp3's, and not some shitty youtube rip or something. (No offense)
  • Avatar of ColdFusion
  • [QUOTE=mr.wolf;28894054]Where are you getting your mp3's from? They need to be valid mp3's with metadata. If you REALLY want to bypass this, I just added an optional constant to limbo.php in /admin/. Set REQUIRE_METADATA to false, and it will only check the playtime_string metadata. If it is a valid mp3 file, it really needs to have playtime_string. Pull the latest revision if you want to play with the REQUIRE_METADATA option, but my advice would be to make sure you are using genuine mp3's, and not some shitty youtube rip or something. (No offense)[/QUOTE] I tried like 10 of them and 0 worked, all comming from different albums and sources.
  • Avatar of mr.wolf
  • [QUOTE=ColdFusion;28894142]I tried like 10 of them and 0 worked, all comming from different albums and sources.[/QUOTE] See if the REQUIRE_METADATA works. Also, can you link me one of those mp3's? It's possible they are using a different id3 version. I'd like to check them out. [quote]Any ideas why It could do that? It's not my site coding, v2 worked fine with it. (Yeah, your OLD one, the one with the site that allowed anything to be uploaded :P and was only in black and white, the one that used wolfdj.sqlite. I converted it to mysql. lol) Edit: I'll add another song. See if it DOES still do it, or if its to do with only one song being on. If it hops to 3, i know somethings up.[/quote] If I had to guess, I'd say that the song list is returning an extra \n. Can I have the link to you song list please?
  • Avatar of ColdFusion
  • [img]http://cold.netburst.co.uk/file/SS-2011-03-30_19.31.12.png[/img] Disabling the metadata check doesn't seem to help. Note: It might be IIS
  • Avatar of GuyRun01
  • [QUOTE=mr.wolf;28894183]See if the REQUIRE_METADATA works. Also, can you link me one of those mp3's? It's possible they are using a different id3 version. I'd like to check them out. If I had to guess, I'd say that the song list is returning an extra \n. Can I have the link to you song list please?[/QUOTE] [url]http://jukebox.mogzgaming.co.uk/gmod/songlist.php[/url] If ya perhance DO find out that it's to blame, I wouldn't have the foggiest how to fix it.
  • Avatar of mr.wolf
  • Coldfusion, can you link me to one of those MP3's so I can take a look? GuyRun01, it was a trimming issue with songlist.php. Latest revision fixes it.
  • Avatar of GuyRun01
  • [QUOTE=mr.wolf;28894488]Coldfusion, can you link me to one of those MP3's so I can take a look? GuyRun01, it was a trimming issue with songlist.php. Latest revision fixes it.[/QUOTE] Can't ya post meh the code, my versions a leetle edited. xD
  • Avatar of ColdFusion
  • Its probably an error on my side. But here have this funky song anyway [url]http://cold.netburst.co.uk/file/Aloe%20Blacc%20-%20I%20Need%20A%20Dollar.mp3[/url]
  • Avatar of mr.wolf
  • [QUOTE=GuyRun01;28894562]Can't ya post meh the code, my versions a leetle edited. xD[/QUOTE] [code]<?php # WolfDJ 3.0 # Display the list of available songs require_once 'admin/lib/DB.php'; $filter = (isset($_GET['filter'])) ? trim($_GET['filter']) : ''; $songs = GetSongs( $filter ); $output = array(); foreach($songs as $row) { $artist = str_replace('-','_',$row['Artist']); $title = str_replace('-','_',$row['Title']); $playtime = $row['Length']; $file = md5($row['ID']); $output[] = "$artist-$title-$playtime-$file"; } echo implode("\n",$output); ?> [/code] [editline]30th March 2011[/editline] [QUOTE=ColdFusion;28894571]Its probably an error on my side. But here have this funky song anyway [url]http://cold.netburst.co.uk/file/Aloe%20Blacc%20-%20I%20Need%20A%20Dollar.mp3[/url][/QUOTE] I downloaded and uploaded the mp3, and it worked fine for me. My guess would be that IIS is doing something funky, which is odd, since the id3 libs should work regardless of the web-server.... [b]Edit[/b] Did a little research. IIS does screw with the ID3 tag access.... Searching for a workaround I might just make a fully manual form sometime soon. Slammed with work at the moment.
  • Avatar of GuyRun01
  • The player doesn't seem to be playing songs with spaces in them. Any idea why? :L
  • Avatar of mr.wolf
  • [QUOTE=GuyRun01;28895246]The player doesn't seem to be playing songs with spaces in them. Any idea why?[/QUOTE] Are you modifying my script? The output can't contain dashes (-) except to delimit fields. The format should be Artist-Title-Min-Sec-Hash. Your songlist.php is all screwed up.... [editline]30th March 2011[/editline] Still no hashes. You should have an md5 hash of the ID as the last item on the line
  • Avatar of GuyRun01
  • [QUOTE=mr.wolf;28895323]Are you modifying my script? The output can't contain dashes (-) except to delimit fields. The format should be Artist-Title-Min-Sec-Hash. Your songlist.php is all screwed up.... [editline]30th March 2011[/editline] Still no hashes. You should have an md5 hash of the ID as the last item on the line[/QUOTE] Yeah, my system is MySQL based, so totally different, i REALLY need some help converting my songlist.php geh. PHP is not my favourite/best language unfortunately.
  • Avatar of mr.wolf
  • I shouldn't be helping you debug your own code when you branch away from mine, but I'm feeling nice. In admin/lib/DB.php [code] function getSongs( $filter=null ) { $output = array(); if (empty($filter)) { $sql = "SELECT * FROM `songs` ORDER BY `Artist` ASC, `Title` ASC"; $r = mysql_query($sql); while($row = mysql_fetch_assoc($r)) $output[] = $row; } else { $filter = mysql_real_escape_string($filter); $sql = "SELECT * FROM `songs` WHERE `Title` LIKE '%$filter%' OR `Artist` LIKE '%$filter%' ORDER BY `Artist` ASC, `Title` ASC"; $r = mysql_query($sql); while($row = mysql_fetch_assoc($r)) $output[] = $row; } return $output; } [/code] Leave the songlist.php file as it is defined in revision 8
  • Avatar of GuyRun01
  • [QUOTE=mr.wolf;28895984]I shouldn't be helping you debug your own code when you branch away from mine, but I'm feeling nice. In admin/lib/DB.php [code] function getSongs( $filter=null ) { $output = array(); if (empty($filter)) { $sql = "SELECT * FROM `songs` ORDER BY `Artist` ASC, `Title` ASC"; $r = mysql_query($sql); while($row = mysql_fetch_assoc($r)) $output[] = $row; } else { $filter = mysql_real_escape_string($filter); $sql = "SELECT * FROM `songs` WHERE `Title` LIKE '%$filter%' OR `Artist` LIKE '%$filter%' ORDER BY `Artist` ASC, `Title` ASC"; $r = mysql_query($sql); while($row = mysql_fetch_assoc($r)) $output[] = $row; } return $output; } [/code] Leave the songlist.php file as it is defined in revision 8[/QUOTE] Are you online in Steam? Would like to talk.
  • Avatar of botuts
  • I get an error on every wolfdj page. "Notice: Use of undefined constant DB_PATH - assumed 'DB_PATH' in C:\xampp\htdocs\wolfdj\admin\lib\DB.php on line 6" How can i fix this?
  • Avatar of mr.wolf
  • [QUOTE=botuts;28919668]I get an error on every wolfdj page. "Notice: Use of undefined constant DB_PATH - assumed 'DB_PATH' in C:\xampp\htdocs\wolfdj\admin\lib\DB.php on line 6" How can i fix this?[/QUOTE] Forgot a quote around the define argument. Fixed now as of r9.