AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [ANY] SourceMod DJ (SMDJ) (https://forums.alliedmods.net/showthread.php?t=172258)

Dr. McKay 11-17-2011 23:55

[ANY] SourceMod DJ (SMDJ)
 
[ANY] SourceMod DJ

Plugin v2.6.1 - Web Interface v2.3.0

Description:
Allows users to type !music, !dj, or !jukebox to choose a song from a list of predefined songs in a regular panel menu. When a choice is made, the song's page from the web interface will be loaded in the MOTD browser, without the MOTD window being displayed. Includes a web interface to listen to songs, or a listing of songs available on the Web. The web interface takes no time to set up, and has support for four themes (default, TF2, Counter-Strike, and black) out of the box. Requires MySQL, and uses two tables. Does NOT require the game server to be able to access the database.

The web interface is themable! If you know what you're doing, you can create a .css file for a theme, and if it's good enough, I'll include it in the actual release!

Important! In order to hear the music in-game, users must have Adobe Flash Player for Other Browsers installed.

Updating:
When updating SMDJ, you need to update both the Web Interface and the plugin itself, if there is a newer version available for each. Otherwise, only update the component that is out-of-date. To update the plugin, simply drop smdj.smx into your plugins folder. Some updates might add new convars, and if this happens, back up the plugin.smdj.cfg file and delete it, so a new one can be generated. When updating the Web Interface, backup your config.php file, then upload all of the files and folders in the zip to the web server, overwriting all files. Then edit the new config.php and add back in your settings.

Commands:
sm_music - (!music in chat) pulls up the menu. Can be followed with a song title to directly play a song, case-insensitive (e.g. !music like a boss)
sm_dj - (!dj in chat) same as above
sm_jukebox - (!jukebox in chat) same as above
sm_musicinfo - (!musicinfo in chat) pulls up the MOTD window where you can view the title, pause, adjust volume, etc.
sm_randomsong - (!randomsong in chat) plays a random song
sm_songlist - (!songlist in chat)
sm_musicoff - (!musicoff in chat) turns the music off
sm_musichelp - (!musichelp in chat) displays help on installing Adobe Flash Player
sm_reloadsongs - reload the song list (by default requires ADMFLAG_RCON)

Cvars:
smdj_version - plugin version
smdj_advert - (default 1) sets whether a user's music choice will be broadcast to the server in chat
smdj_join_advert - (default 1) sets whether the user will be informed of the SMDJ commands upon connecting
smdj_url - the URL of your SMDJ web installation (i.e. "http://www.thehoodedalliance.com/smdj")
smdj_url_port - if your web installation is on a port other than 80, set it here
smdj_auth_token - prevents leechers. Get this from the admin panel of your web installation
smdj_help_advert - (default 1) sets whether a user is notified to type !musichelp if they can't hear the music
smdj_repeat_default - (default 1) sets the state of the repeat feature for new clients
smdj_shuffle_default - (default 0) sets the state of the shuffle feature for new clients
smdj_volume_default - (default 100) sets the default volume for new clients (10 - 200)
smdj_debug - (default 0) toggles debugging

Plugin creates and loads /cfg/sourcemod/plugin.smdj.cfg

Overrides:
SMDJPlayToOthers (default: ADMFLAG_SLAY) controls which admins can play music to others

Installation:
  1. Install the Socket extension if you don't have it already
  2. Put smdj.smx into /addons/sourcemod/plugins
  3. Extract the Web Interface zip and upload it to your server
  4. Find a MySQL database to use, and put its settings into config.php in the web interface
  5. Set a theme (if you want), and set an administration password (can be plaintext or MD5) in config.php
  6. Log into your web interface and note the values of smdj_url and smdj_auth_token
  7. Type "sm plugins load smdj" on your server command line
  8. Put the values given by your web interface into cfg/sourcemod/plugin.smdj.cfg
  9. Type "sm plugins reload smdj" on your server command line

Requirements:
Requires the Socket extension.

Developers:
This plugin provides a forward for when users start to listen to music. See the include file for documentation.

Demo:
You can see a functioning demo of the TF2 theme here: http://www.thehoodedalliance.com/smdj/

Credits:
Thanks to:
Planned:
  • On-site uploader Done!
  • Playlists Done!
  • Allow admins to play playlists to others
  • Editing playlists
  • Optional URL hiding

Changelog:
  • Plugin v2.6.0 + Web Interface 2.3.0 (7/1/13)
    • Added ability for admins to stop other players' music
    • Added default volume setting
    • Added ability to remove songs from new playlists as users create them
    • Fixed a couple bugs
  • Plugin v2.5.0 (1/1/13)
    • Added SMDJ_OnStartListen forward
  • Plugin v2.4.0 (10/7/12)
    • Added AreClientCookiesCached check when using !dj command (and aliases)
  • Plugin v2.3.0 + Web Interface v2.2.0 (6/18/12)
    • Added playlists
    • Added option for admins to play songs to others
  • Plugin v2.2.0 (4/27/12)
    • Fixed the problems with v2.1.0 (v2.1.0 didn't work at all)
    • Added smdj_repeat_default cvar
    • !dj now pulls up an options menu instead of going directly to the song list
      • Song List
      • Random Song
      • Music Info
      • Stop Music
      • Toggle repeat feature
    • Added !randomsong command
    • Removed repeat option from !settings menu
  • Plugin v2.1.0 (4/27/12)
    • Added smdj_url_port cvar, so you can run the web panel off of a non-standard port
    • Added notification if typing !dj and there are no songs
  • Web Interface v2.1.0 (4/26/12)
    • Added 'counter-strike' and 'black' themes
    • Added a button to nuke the database (delete all songs at once)
  • Plugin + Web Interface v2.0.0 (4/25/12)
    • Plugin no longer requires MySQL access, so it can be used on cheap web hosts
    • Now requires Sockets
    • Added ability to disable repeat from the !settings menu
    • Added !musicinfo command
    • Added !songlist command
    • Web Interface now displays a failure message when the wrong password is given
    • smdj_auth_token cvar added
    • smdj_debug cvar added
    • Added ability to play a song directly by its title (!dj song title)
    • The song list now reloads itself on mapchange
  • Web Interface v1.1.0 (1/1/12)
    • Now supports direct uploading of files, either locally or via FTP
    • Web Interface now checks for updates and notifies you if there is an update available from the Administration page
  • Plugin v1.1.0 (11/23/11)
    • Added a notice when users pick their first song to type !musichelp for help on installing Adobe Flash Player
    • Added a cvar to disable the above notice
  • Plugin + Web Interface v1.0.0 (11/17/11)
    • Initial Release

This plugin does not automatically update due to issues that could arise with the plugin being updated but not the web interface.

This plugin uses Colors, which is required if you want to compile locally.

Download Plugin (smdj.smx)
View Source (smdj.sp)
Download Include File (smdj.inc)

Download Web Interface


.

Drixevel 11-18-2011 05:18

Re: [ANY] SourceMod DJ (SMDJ)
 
You could try to do a version script for the site so in the administrator panel, it says update now and it downloads and installs your update. :3

Also, Great Idea, only problem is this.
http://forums.alliedmods.net/showthread.php?p=945519

Dr. McKay 11-18-2011 06:07

Re: [ANY] SourceMod DJ (SMDJ)
 
Quote:

Originally Posted by r3dw3r3w0lf (Post 1598453)
You could try to do a version script for the site so in the administrator panel, it says update now and it downloads and installs your update. :3

Also, Great Idea, only problem is this.
http://forums.alliedmods.net/showthread.php?p=945519

The web interface of that Jukebox plugin is broken, and I'm pretty sure it doesn't list the songs in a panel-style menu. I tried that one first. :)

Drixevel 11-18-2011 08:20

Re: [ANY] SourceMod DJ (SMDJ)
 
The web interface worked for me last time I used it. Sure, it does have 1 small error with a link but that's easily fixable but other than that, it worked entirely.

gameguysz 11-18-2011 14:52

Re: [ANY] SourceMod DJ (SMDJ)
 
I didn't like jukebox, half the time when i wanted to delete a song it wouldn't delete. So i had to do it manually and that was a pain since it moved and renamed the original file to somewhere else which involved me downloading and listening each song over and over again.. Ill definitely be giving this one a try.

poppin-fresh 11-20-2011 10:26

Re: [ANY] SourceMod DJ (SMDJ)
 
WebServer works fine. But server is crashig on plugin load. All the database info is correct.
Code:

L 11/21/2011 - 09:08:06: [SM] Native "SetFailState" reported: SourceMod DJ couldn't connect to the database: [2003]: Can't connect to MySQL server on 'immersion-networks.com' (10060)
L 11/21/2011 - 09:08:06: [SM] Displaying call stack trace for plugin "smdj.smx":
L 11/21/2011 - 09:08:06: [SM]  [0]  Line 39, D:\Libraries\Documents\Dropbox\SourceMod Plugins\smdj.sp::OnPluginStart()


Dr. McKay 11-20-2011 11:20

Re: [ANY] SourceMod DJ (SMDJ)
 
Quote:

Originally Posted by poppin-fresh (Post 1599706)
WebServer works fine. But server is crashig on plugin load. All the database info is correct.
Code:

L 11/21/2011 - 09:08:06: [SM] Native "SetFailState" reported: SourceMod DJ couldn't connect to the database: [2003]: Can't connect to MySQL server on 'immersion-networks.com' (10060)
L 11/21/2011 - 09:08:06: [SM] Displaying call stack trace for plugin "smdj.smx":
L 11/21/2011 - 09:08:06: [SM]  [0]  Line 39, D:\Libraries\Documents\Dropbox\SourceMod Plugins\smdj.sp::OnPluginStart()


The whole server is crashing? There's no reason that should happen.

Can I see your databases.cfg entry? Don't forget to remove your password.

poppin-fresh 11-20-2011 11:24

Re: [ANY] SourceMod DJ (SMDJ)
 
Quote:

"smdj"
{
"driver" "mysql"
"host" "immersion-networks.com"
"database" "prem1_smdj"
"user" "prem1_smdju"
"pass" "********"
//"timeout" "0"
//"port" "0"
}
Tried host with IP and http & www. infront aswell

Dr. McKay 11-20-2011 11:33

Re: [ANY] SourceMod DJ (SMDJ)
 
Is remote MySQL allowed on your webserver?

poppin-fresh 11-20-2011 12:09

Re: [ANY] SourceMod DJ (SMDJ)
 
Yes. we also use sourcebans & hlstats
edit: we just tried it on a different webserver and getting same error.


All times are GMT -4. The time now is 07:53.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.