Inactive [MECH/FUN/WEB] MusicService - Internet music on your land! [1.2.5-R1.0]

Discussion in 'Inactive/Unsupported Plugins' started by palisade, Mar 21, 2012.

  1. Offline


    Code released on github, I've added the link to the plugin information.
  2. Offline


  3. Offline


    Make a Tutorial please! :rolleyes:
  4. Offline


    hey man, amazing plugin but can u make a video tutorial?? it's hard for beginners to understand all.
  5. Offline


    No problem! :)

    daredevilk is making one, he says it is uploading to Youtube right now and he'll give me the URL tomorrow to put on our plugin page.

    UPDATE: I'm still waiting for daredevilk's video, he said he could get it to me tomorrow. However, I went ahead and made a video on how to set up xampp on windows to get the plugin working correctly. I've added it to the project page. I hope this helps someone out there. :D
  6. Offline


    A lot of people have been struggling with getting the plugin to work. You'll be glad to know that I have plans to help alleviate some of the bottlenecks causing this pain.

    In an upcoming version (not necessarily the next version but I'll try) I am considering making two large leaps in the plugin:

    1) A built-in worry-free webserver... server admin would just set the port they want in the config.yml and would store his or her www documents in the plugin/MusicService/www path. This would eliminate the requirement of installing large hard to configure web server software. Though, I would always leave the feature for hosting in apache or another webserver's wwwRoot in the plugin optionally for those admins who would want to use a professional webserver, i.e. they have a lot of users. I jotted a simple web server up in Java already, I've yet to integrate it with the plugin. The reason this might not make it into our next version is that I'm going to have to secure the code, because anytime you allow the file system to be accessed via the internet you're potentially opening a critical security hole.

    2) The ability to search's website for a station and add it from within minecraft without having to visit their website. You would be able to type /searchshoutcast techno, for example and it could give you a list of station names like (i made up these names): "[0] reedo's techno stream [1] oreally? techno stream [2] funkychicken's techno stream" etc, and then you could perform a /pickmusic 1, to choose the oreally station for your land. I'm working on this right now as we speak, so far I can search their site for .pls files which I intend to parse for the IP : PORT needed to play the stream. If I get it working before we make the next release I'm strongly considering including this feature because it would reduce a lot of the headache involved in finding and adding streams to your land.

    I think those two features combined would make using the plugin extremely comfortable.

    Here's my progress so far... I'm able to get the names of the streams, this was a search for "grunge":

    [0] (#1 - 3/5) Radio HH Grunge
    [1] (#1 - 41/3200) Big R Radio - Post Grunge Rock
    [2] (#1 - 0/10) PUNK Morgantown WV (HD) - College Grunge Punk Emo Alternative
    [3] (#1 - 0/20) PUNK Morgantown WV - College Grunge Punk Emo Alternative
    [4] (#1 - 3/10) Loudcaster: D-Rock Radio
    [5] (#1 - 0/10) Loudcaster: D-Rock Radio

    I placed the [#] at the front, so this ties into my idea of having a /pickmusic # command.

    And, I've also just now tested a pickmusic method, here's the result when I chose # 2:

    Setting music stream [2]:

    Now it's just a matter of moving this code into the MusicService plugin itself and we're ready to go with feature 2.

    UPDATE 2:

    It works!!!!!!! :D


    First I typed:
    /findmusic grunge

    That list of songs printed and then I typed:

    /pickmusic 3

    And, the music switched! Yay! This is going to be so much easier for everyone, myself included!

    This feature, along with WorldGuard, will be available in the next release of my plugin. :)
  7. Offline


    Will the next version work with regios?
    I really hope it does!
  8. Offline


    WorldGuard regions? Yes, that's the plan. The next version has this support in it and I've verified it works with WorldGuard 5.3 on my server. So, as soon as I can get some of these other features completed we'll make another release. In addition, my code honors the WorldGuard priority system, so you'll be able to have overlapping WorldGuard regions that have different priorities, and it will affect which music plays.

    Factions, if installed alongside WorldGuard will take precedence over the WorldGuard region it overlaps as well. This way if someone establishes a small faction inside of a larger region their music will play instead of the region's music station. Walking outside of the faction would then start the WorldGuard region's music. The same will be true when we finally get Towny support in, in a much later release in the future.

    Also, I have some good news on the built-in web server front. I've integrated my code for this into the plugin and I've tested that I can serve up basic pages to any web browser. However, I'm only supporting the HEAD and GET parts of the protocol at the moment, and not POST. Next I need to add POST support, which is required to perform some AJAX operations, which I was using to serve up the music content.

    Once I have that in, I'm going to do a few passes over the code looking for places that need to be secured. Already, I'm handling making the data being passed in safe by escaping it. And, I am also preventing those connecting from attempting to access directories outside of the target www root path provided by the server administrator.

    If all goes well, the next version will be significantly easier to use.

    My apologies, I assumed that regios was a typo for the word regions, and assumed you were asking about WorldGuard region support.

    I just google'd for regios and realized it is a bukkit plugin very similar to WorldGuard. I can't say I've looked into this yet, as I didn't know it existed.

    I will take a look at it, but it most likely won't be in the next version of this plugin. Already, I've probably made too many changes as it is. :-D


    I poured over his website, forum and bukkitdev page and even though he states it is GPL'd he doesn't seem to provide the code anywhere. Also, he doesn't provide an API listing. Though, he has a brief example of how to register for events.

    Until I actually try to use his code directly from within mine, I'm not going to be sure what variables are available from his event parameters for example. Nor will I know exactly what the events are doing.

    For example, he has an event for entering, exiting, creating, deleting, restoring, loading, etc. I'm wondering if he calls enter and exit after a create or destroy if you're inside of the region at the time it happened. If he doesn't, then I'll need to handle the creating and delete events. Also, I might have to handle the load event, because you may be standing inside of a region when it gets loaded if he isn't calling the enter event at that point. Last but not least, he has /regios commands for expanding and shrinking your regions, and my best guess is that I also have to handle his onRegionCommand event and handle anytime someone invokes one of the dozens of expand and shrink variations he supports, and check if you're still inside the region or have appeared in it. Unless, of course, again, he were to always call the enter and exit events in these cases.

    Really I have more questions than answers here. I'm at work at the moment so I'd have to look into it more when I get home.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 24, 2016
  9. Offline


    I've followed everything to video, and I've come across a question and a issue.
    For the question, for the config.yml I decided to put the refreshUrl as my ip, now do I set it as my external (That other people use to connect) or the IP the server runs on?

    As for my issue, when I do the http://localhost/music/'Username' I get an access denied. I'm assuming this is connected to the edit with the httpd.conf where you put in the additional allow. Thing is I did this.

    httpd.conf (open)

    # This is the main Apache HTTP server configuration file. It contains the
    # configuration directives that give the server its instructions.
    # See <URL:> for detailed information.
    # In particular, see
    # <URL:>
    # for a discussion of each configuration directive.
    # Do NOT simply read the instructions in here without understanding
    # what they do. They're here only as hints or reminders. If you are unsure
    # consult the online docs. You have been warned.
    # Configuration and logfile names: If the filenames you specify for many
    # of the server's control files begin with "/" (or "drive:/" for Win32), the
    # server will use that explicit path. If the filenames do *not* begin
    # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
    # with ServerRoot set to "/Users/Owner/AppData/Roaming/xampp/apache" will be interpreted by the
    # server as "/Users/Owner/AppData/Roaming/xampp/apache/logs/foo.log".
    # NOTE: Where filenames are specified, you must use forward slashes
    # instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
    # If a drive letter is omitted, the drive on which httpd.exe is located
    # will be used by default. It is recommended that you always supply
    # an explicit drive letter in absolute paths to avoid confusion.

    # ServerRoot: The top of the directory tree under which the server's
    # configuration, error, and log files are kept.
    # Do not add a slash at the end of the directory path. If you point
    # ServerRoot at a non-local disk, be sure to point the LockFile directive
    # at a local disk. If you wish to share the same ServerRoot for multiple
    # httpd daemons, you will need to change at least LockFile and PidFile.
    ServerRoot "/Users/Owner/AppData/Roaming/xampp/apache"

    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the <VirtualHost>
    # directive.
    # Change this to Listen on specific IP addresses as shown below to
    # prevent Apache from glomming onto all bound IP addresses.
    #Listen [::]:80
    Listen 80

    # Dynamic Shared Object (DSO) Support
    # To be able to use the functionality of a module which was built as a DSO you
    # have to place corresponding `LoadModule' lines at this location so the
    # directives contained in it are actually available _before_ they are used.
    # Statically compiled modules (those listed by `httpd -l') do not need
    # to be loaded here.
    # Example:
    # LoadModule foo_module modules/
    LoadModule actions_module modules/
    LoadModule alias_module modules/
    LoadModule asis_module modules/
    LoadModule auth_basic_module modules/
    LoadModule auth_digest_module modules/
    #LoadModule authn_alias_module modules/
    #LoadModule authn_anon_module modules/
    #LoadModule authn_dbd_module modules/
    #LoadModule authn_dbm_module modules/
    LoadModule authn_default_module modules/
    LoadModule authn_file_module modules/
    #LoadModule authnz_ldap_module modules/
    #LoadModule authz_dbm_module modules/
    LoadModule authz_default_module modules/
    LoadModule authz_groupfile_module modules/
    LoadModule authz_host_module modules/
    #LoadModule authz_owner_module modules/
    LoadModule authz_user_module modules/
    LoadModule autoindex_module modules/
    #LoadModule bucketeer_module modules/
    #LoadModule cache_module modules/
    #LoadModule case_filter_module modules/
    #LoadModule case_filter_in_module modules/
    #LoadModule cern_meta_module modules/
    LoadModule cgi_module modules/
    #LoadModule charset_lite_module modules/
    #LoadModule dav_module modules/
    #LoadModule dav_fs_module modules/
    LoadModule dav_lock_module modules/
    #LoadModule dbd_module modules/
    #LoadModule deflate_module modules/
    LoadModule dir_module modules/
    #LoadModule disk_cache_module modules/
    #LoadModule dumpio_module modules/
    #LoadModule echo_module modules/
    LoadModule env_module modules/
    #LoadModule example_module modules/
    #LoadModule expires_module modules/
    #LoadModule ext_filter_module modules/
    #LoadModule file_cache_module modules/
    #LoadModule filter_module modules/
    LoadModule headers_module modules/
    #LoadModule ident_module modules/
    #LoadModule imagemap_module modules/
    LoadModule include_module modules/
    LoadModule info_module modules/
    LoadModule isapi_module modules/
    #LoadModule ldap_module modules/
    #LoadModule logio_module modules/
    LoadModule log_config_module modules/
    #LoadModule log_forensic_module modules/
    #LoadModule mem_cache_module modules/
    LoadModule mime_module modules/
    #LoadModule mime_magic_module modules/
    LoadModule negotiation_module modules/
    LoadModule proxy_module modules/
    LoadModule proxy_ajp_module modules/
    #LoadModule proxy_balancer_module modules/
    #LoadModule proxy_connect_module modules/
    #LoadModule proxy_ftp_module modules/
    #LoadModule proxy_http_module modules/
    LoadModule rewrite_module modules/
    LoadModule setenvif_module modules/
    #LoadModule speling_module modules/
    LoadModule ssl_module modules/
    LoadModule status_module modules/
    #LoadModule substitute_module modules/
    #LoadModule unique_id_module modules/
    #LoadModule userdir_module modules/
    #LoadModule usertrack_module modules/
    #LoadModule version_module modules/
    #LoadModule vhost_alias_module modules/

    <IfModule !mpm_netware_module>
    <IfModule !mpm_winnt_module>
    # If you wish httpd to run as a different user or group, you must run
    # httpd as root initially and it will switch.
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # It is usually good practice to create a dedicated user and group for
    # running httpd, as with most system services.
    User daemon
    Group daemon


    # 'Main' server configuration
    # The directives in this section set up the values used by the 'main'
    # server, which responds to any requests that aren't handled by a
    # <VirtualHost> definition. These values also provide defaults for
    # any <VirtualHost> containers you may define later in the file.
    # All of these directives may appear inside <VirtualHost> containers,
    # in which case these default settings will be overridden for the
    # virtual host being defined.

    # ServerAdmin: Your address, where problems with the server should be
    # e-mailed. This address appears on some server-generated pages, such
    # as error documents. e.g. [email protected]
    ServerAdmin postmaster@localhost

    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    # If your host doesn't have a registered DNS name, enter its IP address here.
    ServerName localhost:80

    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    DocumentRoot "/Users/Owner/AppData/Roaming/xampp/htdocs"

    # Each directory to which Apache has access can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories).
    # First, we configure the "default" to be a very restrictive set of
    # features.
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    allow from all

    # Note that from this point forward you must specifically allow
    # particular features to be enabled - so if something's not working as
    # you might expect, make sure that you have specifically enabled it
    # below.

    # This should be changed to whatever you set DocumentRoot to.
    <Directory "C:/Users/Owner/AppData/Roaming/Users/Owner/AppData/Roaming/xampp/htdocs">
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    # The Options directive is both complicated and important. Please see
    # for more information.
    Options Indexes FollowSymLinks Includes ExecCGI

    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    AllowOverride All

    # Controls who can get stuff from this server.
    Order allow,deny
    Allow from all


    <Directory "C:/Users/Owner/AppData/Roaming/Users/Owner/AppData/Roaming/xampp/htdocs/music">
    Order Allow,Deny
    Allow from All

    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    <IfModule dir_module>
    DirectoryIndex index.php index.cgi index.asp index.shtml index.html index.htm \
    default.php default.cgi default.asp default.shtml default.html default.htm \
    home.php home.cgi home.asp home.shtml home.html home.htm

    # The following lines prevent .htaccess and .htpasswd files from being
    # viewed by Web clients.
    <FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All

    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # container, error messages relating to that virtual host will be
    # logged here. If you *do* define an error logfile for a <VirtualHost>
    # container, that host's errors will be logged there and not here.
    ErrorLog "logs/error.log"

    #ScriptLog "logs/cgi.log"

    # LogLevel: Control the number of messages logged to the error_log.
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    <IfModule log_config_module>
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
    # You need to enable mod_logio.c to use %I and %O
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here. Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    #CustomLog "logs/access.log" common

    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    CustomLog "logs/access.log" combined

    <IfModule alias_module>
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server's namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://localhost/bar

    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL. You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.

    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client. The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    ScriptAlias /cgi-bin/ "/Users/Owner/AppData/Roaming/xampp/cgi-bin/"


    <IfModule cgid_module>
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    #Scriptsock "logs/cgi.sock"

    # "/Users/Owner/AppData/Roaming/xampp/cgi-bin" should be changed to whatever your ScriptAliased
    # CGI directory exists, if you have that configured.
    <Directory "/Users/Owner/AppData/Roaming/xampp/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all

    # DefaultType: the default MIME type the server will use for a document
    # if it cannot otherwise determine one, such as from filename extensions.
    # If your server contains mostly text or HTML documents, "text/plain" is
    # a good value. If most of your content is binary, such as applications
    # or images, you may want to use "application/octet-stream" instead to
    # keep browsers from trying to display binary files as though they are
    # text.
    DefaultType text/plain

    <IfModule mime_module>
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    TypesConfig "conf/mime.types"

    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #AddType application/x-gzip .tgz
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    AddHandler cgi-script .cgi .pl .asp

    # For type maps (negotiated resources):
    #AddHandler type-map var

    # Filters allow you to process content before it is sent to the client.
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml

    <IfModule mime_magic_module>
    # The mod_mime_magic module allows the server to use various hints from the
    # contents of the file itself to determine its type. The MIMEMagicFile
    # directive tells the module where the hint definitions are located.
    MIMEMagicFile "conf/magic"

    # Customizable error responses come in three flavors:
    # 1) plain text 2) local redirects 3) external redirects
    # Some examples:
    #ErrorDocument 500 "The server made a boo boo."
    #ErrorDocument 404 /missing.html
    #ErrorDocument 404 "/cgi-bin/"
    #ErrorDocument 402 http://localhost/subscription_info.html

    # EnableMMAP and EnableSendfile: On systems that support it,
    # memory-mapping or the sendfile syscall is used to deliver
    # files. This usually improves server performance, but must
    # be turned off when serving from networked-mounted
    # filesystems or if support for these functions is otherwise
    # broken on your system.
    #EnableMMAP off
    #EnableSendfile off

    # Supplemental configuration
    # The configuration files in the conf/extra/ directory can be
    # included to add extra features or to modify the default configuration of
    # the server, or you may simply copy their contents here and change as
    # necessary.

    # XAMPP specific settings
    Include "conf/extra/httpd-xampp.conf"

    # Perl settings
    Include "conf/extra/httpd-perl.conf"

    # Server-pool management (MPM specific)
    Include "conf/extra/httpd-mpm.conf"

    # Multi-language error messages
    Include "conf/extra/httpd-multilang-errordoc.conf"

    # Fancy directory listings
    Include "conf/extra/httpd-autoindex.conf"

    # Language settings
    Include "conf/extra/httpd-languages.conf"

    # User home directories
    Include "conf/extra/httpd-userdir.conf"

    # Real-time info on requests and configuration
    Include "conf/extra/httpd-info.conf"

    # Virtual hosts
    Include "conf/extra/httpd-vhosts.conf"

    # Distributed authoring and versioning (WebDAV)
    # Attention! WEB_DAV is a security risk without a new userspecific configuration for a secure authentifcation
    # Include "conf/extra/httpd-dav.conf"

    # Implements a proxy/gateway for Apache.
    Include "conf/extra/httpd-proxy.conf"

    # Various default settings
    Include "conf/extra/httpd-default.conf"

    # Secure (SSL/TLS) connections
    Include "conf/extra/httpd-ssl.conf"
    # Note: The following must must be present to support
    # starting without SSL on platforms with no /dev/random equivalent
    # but a statically compiled-in mod_ssl.
    <IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    SSLSessionCache "shmcb:logs/ssl.scache(512000)"
    SSLSessionCacheTimeout 300

    # AJP13 Proxy
    <IfModule mod_proxy.c>
    <IfModule mod_proxy_ajp.c>
    Include "conf/extra/httpd-ajp.conf"

  10. Offline


    1. Your refreshUrl should be either: http://external_ip_here/
    Or, it should be: http://external_domain_here.tld/

    And, if you're using a port other than 80, say... 8888, then you would do:

    2. Regarding the issue you encountered... The path you provided in the Directory setting in httpd.conf looks odd. Are you sure this is where your %appdata% is?

    It looks like you repeated Users/Owner/AppData/Roaming/ twice. Also, is Owner your computer username, or did you just put that there to censor it for this forum post?

    Also, if you recall in the video I suddenly realized that I needed to use https://. If you're running your own Linux apache server and you're not using https, then you don't have to worry about this. But, xampp on windows defaults to https. In the video I discovered this near the end. Keep in mind that was my first time attempting it on Windows.
  11. Offline


    Wow, I can't believe I missed such a simple thing. After fixing it I can now type in http://localhost/music/Dabiri.html and it plays music of the station that I choose through following your steps.

    It is indeed where %appdata% sends me, if I type it in run or just in the browser it goes to C:\Users\Owner\AppData\Roaming. Owner is the owner/admin of the computer.

    Alright so I built my tower , hit it with the stick and it alerted me how tall the tower is. I put in the IP through /setmusic, I'm guessing it it right because I am hearing the music through the localhost. I don't hear it through minecraft though (Music and Sound is up), might just be another stupid mistake of mine lol.

    Show Spoiler
    wwwRoot: C:\Users\Owner\AppData\Roaming\xampp\htdocs
  12. Offline


    Correct, you won't hear it inside Minecraft, I can't do that unless I modify the client and server via something like Spout. And, there are already plugins that play music through the actual game client via Spout. What differentiates my plugin from those other plugins is that mine doesn't require any modification on the client side in order to begin hearing the music. All they need is a web browser, and everyone has one of those. And, this also means that if Spout falls behind bukkit releases, your server is instead relying on something that will keep working regardless.

    This is the reason that setting up the server has been more difficult. I put the onus on the server admins to set things up instead of putting it on the players themselves. So, yes, it's hard to set up but only for one person, the server admin.

    There is even one plugin that contacts a program a guy made that you run in the background on your computer to do something similar to what I'm doing. But, something like Flash and a web browser is more portable and your players don't have to install or maintain anything new on their side.

    In fact I recommend you turn down Minecraft's music under Options so it doesn't play over the music playing in your web browser.

    I just discovered some things I forgot to mention in the youtube video.

    Turning Off SSL In XAMPP:
    You can turn off SSL if it's giving you a hard time, you do this by doing the following... Comment out this line by placing a # in front of it in xampp/conf/httpd.conf:
    #Include "conf/extra/httpd-ssl.conf"

    Do Not Use Localhost In Your Configuration:
    Do not use localhost in your config.yml because then external users won't be able to connect to you. Use your domain, whether registered or merely a free dns. If you already did this and there are user.html files in your music directory, then you need to delete them because the plugin has already placed localhost that you asked it to inside the files as the refresh url. For it to take the new setting you add to config.yml you need to delete these files, but make sure you don't delete the music.html template file. Also, be aware the username.html doesn't get created until the player joins.

    If You Choose To Leave SSL On:
    Use instead of just http as your refreshUrl. It defaults to https and won't serve up non-https pages unless you turn that off as explained above.

    SSL Certificates:
    Also, if you don't get a valid SSL certificate to put into your web server, some web browsers will not let their users connect to you; e.g. Comodo Dragon. Because they verify it wasn't issued by a legit certificate authority.

    Residential Blocking Of The HTTP Port:
    And, keep in mind residential ISPs, e.g. comcast, block port 80, if you're wondering why users can't connect to you remotely.

    NOTE: XAMPP will block remote access to Index.html and settings pages in xampp. However, if you follow the video and place an extra Directory statement in the httpd.conf for your music directory you can allow everything inside to be accessed remotely.

    Also, make sure your ad or flashblocker isn't blocking the content.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 24, 2016
  13. Offline


    Regios source:

    Let me know if you need anything from me.
  14. Offline



    I glanced over the code it looks like when you create or load a region you only send a region restore event. But, there is no event raised to indicate whether they have entered or left the newly created/loaded region until the player moves around. Also, load shared region doesn't raise any event at all? At any rate, I'm guessing this means I'll have to check if the player is now in the new region and update the music when the create/load/destroy events are raised.

    Also, I notice in the MutableModifications the expand methods don't raise any events so there's no way for me to know when this is happened. So, as I suspected I'll have to handle each of the expand commands in the event handler for onRegionCommand, because the player could suddenly appear inside a region as it expands over them. And, actually, this one is a disaster, because then I can only update the person who invoked the command. Unless of course, I grab the list of all players logged in and loop through that list and force them all to update their station anytime the expand commands are called by anyone.

    I'll have to wait until I get home from work to play with it a little.

    Thanks for the github link, though.
  15. Offline


    lol I guess I shouldn't dump the code and run away without an explaination.

    From what you are describing you are talking about RBF_Load and RBF_Load_Share which only deal with backups and blueprints. RBF_Load only uses the RegionRestoreEvent because that's what it does, it restores a pre-existing region from a backup but doesn't actually create or load any regions, and RBF_Load_Share doesn't raise and event because it doesn't deal with regions at all, it only pastes the blocks contained in the blueprint (similar to Worldguard's schematics)

    The RegionCreateEvent and RegionLoadEvents are called from the Region class.

    I can add a custom event for modification if that would help you out.
  16. Offline


    Yes, events would help. Is it possible for you to generate the RegionEnterEvent and RegionExitEvent events for players who happen to be inside or outside the area after it expanded, shrank, was created or loaded? The idea here being that on your side you already have a map of the players and which regions they know exist in, that you're keeping track of.

    And, if we're improving it further, bukkit has an event like the following but for moving, and it's pretty handy... It'd be really nice if all I had to do on my end is implement a new event named RegionChangedEvent. On your side if the player leaves region A and enters region B, RegionChangedEvent would have getPlayer(), getFrom() which is A, and getTo() which is B. If the player instead leaves region A and ends up in wilderness where there is no region, then the getFrom() is A and the getTo() returns null. If it's null then I'd know there is no region there. That'd be slick.

    UPDATE 1: WorldGuard just gives me the ability to ask it for a ProtectedRegion at a specific location or for a specific player. Which probably doesn't perform as well as your event-based system, because then I have to loop through the applicable overlapping regions for a player's particular location and figure out which region is priority. Assuming you keep these in a priority sorted structure of some sort you could provide that kind of information faster via an event.

    UPDATE 2: Okay, having said all of that I realized there's a problem with using your plugin via events. I have to register for events from bukkit for when a player moves or portals somewhere. Then I have a set of nested conditions that check for 1) factions, 2) worldguard regions, 3) wilderness. And, in the future, Towny, Residence, etc.

    However, what is going to happen is that the bukkit move or portal event is going to come in just as your event that indicates the player entered a regios region. Now, granted the user probably won't be running both worldguard and regios at the same time, but towny or factions? It's likely. The problem we're faced with here is that the music will suddenly change twice almost simultaneously, which will seem like a hiccup to the user. It also means I lose the ability to decide if I want the faction land to override the regios region. Instead, it's luck of the draw, whenever the events decide to flow in. Right now I have faction land override the worldguard region, so that users who build a faction inside a region (e.g. they have build rights there) can have their own music instead of the region's.

    I propose instead, as the final solution, just exposing a method similar to Worldguard's getApplicableRegions in their region manager. Though, they require a Location for theirs, it'd be nice if you had an overload for both Location and Player. Also, if you happen to allow overlaps (I didn't see anything like this in your code tho), a getPriority() method on the region. If we do something like this, I can just re-use the methods I've written for worldguard already.

    So, just ignore the rest of my requests at the top of this comment regarding events unless you feel like providing that for other users of the API. I still think they're good ideas, they just won't help me after this realization.

    BTW everyone, I'm sorry for all the technical talk! I'm sort of a stupid to keep posting this garbage in here. :p

    From now on I'll take this stuff to private messages.

    Oh, btw guys, I have a really great non-techie announcement.

    The next version will include a fully functioning built-in webserver. No more worrying about how to set up a webserver! Hip hip hooray. :-P

    And, we're also going to have the findmusic and pickmusic commands I mentioned earlier.

    And, WorldGuard support.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 24, 2016
  17. Offline


    Have you seen the Custom Music Plugin by WegFetz?
    Its somewhat like this but also lets you load your own music up.
    Anyways, would you add that feature as well?

    The plugin I mentioned works but seems to be super glitchy.
  18. Offline


    Both of those plugins require spout or a custom client mod. Part of what makes this plugin special is that it runs completely server side and run shoutcast streams. So if you host a shoutcast server you can upload your own.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 24, 2016
  19. Offline


  20. Offline


    I have just added Towny and Regios support, they need more testing but expect them in the next version of the plugin along with WorldGuard support, a built-in webserver, and the findmusic and pickmusic commands added in. The next few days will mostly involved cleaning up bugs.

    Also, just added iZone support.
  21. Offline


    OMG!!! I want this plugin for my server soooo bad... But I use Towny. I can't wait for it to be compatible.
  22. Offline


  23. Offline


    Can you make it to work with WorldGuard instead of Factions?
  24. Offline


    Hi, I would like to ask some things, Im kind of not sure about some stuff:

    I have a bukkit server with its files on my documents, is this ok?

    I have my jimdo website, do i need a website or anything?

    Can I use this on the bukkit server on my comp (im really lost...)

    -do i need extra suff (except for plugins)
    -like Seperate comp server website (my own paid)

  25. Offline


    WorldGuard support will be available in the next version, I've already got that working. I really want to get a builtin easy to use webserver working for the next version as well which is why it's taking so long to do another release. With it builtin people will be able to set up my plugin much easier. I've got the code for this written and it works, but I encountered a serious problem that I'm trying to iron out before release.

    Yes, My Documents on Vista and Win7 is a safe area to place files, as is %appdata%. Anywhere else on the hard drive could require you to allow administrative privileges each time you run an exe. If you're on XP, it doesn't matter where you put it, though.

    I glanced at Jimdo's website, and I hadn't known about them before. However, it doesn't look like they allow you to control what the webserver does, they only seem to allow you to use cookie cutter generated websites. Therefore, the quick and dirty answer is no. My plugin requires to be running on the same machine as the webserver is and needs to have access to the path where the webserver stores html files so it can place html files I generate on the fly per player into a subdirectory called music in the root webserver document folder.

    You could use the same Windows machine your bukkit server is using, however you need to install a webserver with the current version of my plugin in order to host up html files to players who connect. Server versions of Windows, which are expensive, have Microsoft's IIS webserver installed. However, if you don't have that, there is a free version of Apache webserver available for the Windows platform. I mention this in the Youtube video tutorial I posted at the top of the plugin description page, and show how to set it up for my plugin.

    I know this is a lot of work, which is why I'm working towards having a default built-in webserver in my plugin that requires very little configuration for the next version release of my plugin. My goal with that will be to store the web files inside the bukkit/plugins/MusicService/www directory by default. And, you would only need to configure the website domain and port in the config.yml file then. It will be a lot easier than it is now.

    To reiterate, though, that feature is not ready yet. So, for now you have to have your own webserver for hosting the html files. Sorry. :(

    I'm working on it, though! :)
  26. Offline


    Thanks for the reply, will see to those stuff!
  27. Offline


    Thanks for the reply!
    Another thing, are you going to make something like Dynmap?
    Like ipadress:someport in browser to listen to the music? It would be awesome!
  28. Offline


    Yes, that's why you need the webserver right now. Players connect to ipaddress:someport/music/TheirName.html with their web browser to hear music at the moment. But, it only works if you have a webserver.

    And, I plan on building the webserver into the plugin next version so you won't need to have your own webserver. So, yes, just like dynmap.
  29. Offline


  30. Offline


    New version 1.4.4 released. This one adds worldguard region support, towny support, regios support, izone support and the /findmusic and /pickmusic commands. Also, now we have a built-in webserver that uses memory instead of the file system so you don't have to manage a webserver or any extra files.

    I've updated the instructions on the plugin page.

    I believe bukkit still has to approve my jar upload, so if you don't see it in the downloads that's why.

Share This Page