Parcel Music Changer - adrianomesl/script_shack_support GitHub Wiki
Parcel Music Changer is a system that allows a parcel owner to let anyone set their parcel's music stream in a secure and controlled way.
The system is composed of two parts: a server which is under the parcel owner's exclusive control and one or more tuners. The tuners are objects that allow users to select a stream station from a list of authorized stations that the parcel owner configured in the server.
Set up
The system requires a rezzed server (the box) and at least one rezzed tuner (the button) to work. Once you have the minimum components rezzed, activate the server first. Once the light turns blue, proceed to activate the tuner button. Following this order of events will guarantee the smoothest experience.
Configuration
Both components require configuration. The server is where the bulk of it is necessary. The tuner only needs to know the channel to use to communicate with the server.
[General]
Channel integer - Default: 1010 MUST CHANGE!
The server and all the tuners need to use the same channel number for the communication to occur. This is the only setting that is also required in the tuner's configuration file.
FallbackStreamIndex integer - Default: 1
This setting is the index of the stream that should be used as fallback. The value 1 refers to the first entry under the section [MusicStreams] (see below).
If FallbackStreamIndex is set to zero, then no fallback occurs; hence whatever station is playing will remain.
ResetParcelMusicURLTimeout integer - Default: 360
When a user other than the parcel owner changes the station a timer is set to the value of this setting. Once elapsed the parcel music stream is set back to whatever FallbackStreamIndex is pointing.
If this is set to zero, then the parcel stream does not automatically reset. Also note that regardless of the value of this setting; if FallbackStreamIndex is set to 0 then nothing will happen because there's not fallback station.
GrantMode Enum(owner, group, list, public) - Default: public
This setting gives the parcel owner full control over who can change the music.
- owner. Only the owner can set the music.
- group. Only the owner and users who are in the same group as the server.
- list. Only the owner and users listed under
[GrantList]. - public. Anyone who interacts with a tuner.
[GrantList]
This is where we can specify a list of users to whom we want to allow to change the parcel music.
Only avatar UUIDs are recognized here and we must add one per line.
[MusicStreams]
A list of authorized music streams having the following form:
Nice name = URL
The nice name is what shows up in the tuner menu. The following Second Life Wiki page has a list of streams we can use:
https://wiki.secondlife.com/wiki/Music_streams
The sever is shipped with the following list in the configuration file:
Tropicalisima = http://23.237.150.178:8026/
Smooth Jazz = https://smoothjazz.cdnstream1.com/2585_128.mp3
Ohana Rock Club = http://ohana.digistream.info:10288/
808 Live Reggaecast = http://808.rastamusic.com/rastamusic.mp3
WHAT? Island = http://whatisland.macchiatomedia.org:8118/
Slow Radio = http://stream1.slowradio.com/
FM Country = http://sc3c-sjc.1.fm:7806/
All Ottos Baroque = https://cms.stream.publicradio.org/cms.mp3
1.FM - Always Christmas = http://sc-christmas.1.fm:8650/
About permissions
In the configuration section we learned that we have four grant modes available: owner, group, list and public. One thing that's important to keep in mind is that permissions are checked in the server alone. This means that the button always will respond and show the menu. When a specific request reaches the server, if the user operating the tuner is allowed the request will be fulfilled. If access is denied for the user the request fails silently; Meaning: the station doesn't change.
Custom look
The package includes the UV layouts for the box and the tuner button plus all the textures used in the included objects. All these textures are shipped full perms so you can use them as reference to create your own.
Custom objects
You can also create your own objects and drop the scripts and the configuration files in them but there's a caveat concerning the server:
The server script will assume that face 0 is a light. If you make a custom mesh you have to make sure that the material face that will end up being face 0 is designed to function as a light.