-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSetUpServer.txt
78 lines (45 loc) · 4.48 KB
/
SetUpServer.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
How to set up the server side of jukeboxclient...
First of all, you obviously need a php enabled web server to host the files ;)
This guide assumes you are familiar with editing php files and making files publicly available on your server.
The server folder in the download contains a jukeboxserver.php.example file and and mp3 folder to hold the albums.
The jukeboxserver.php.example file in the download should be renamed to jukeboxserver.php and edited to set up any users who are authorised to run the script.
If there was no authorisation then the script could be copied and used by many users, resulting in heavy bandwidth usage on your server.
Authorisation uses two keys, THIS_USERS_SERVERKEY_UUID and THIS_USERS_OWNER_UUID which are checked when the script contacts the server.
THIS_USERS_SERVERKEY_UUID is a unique key that you assign to the user you give your script to.
It can be any unique string you choose, but I prefer to generate a UUID for each user (there are many websites that can do this for you, I usually use http://www.famkruithof.net/uuid/uuidgen)
This string will be embedded in a Notecard you create and give to the user along with the script (more about that later).
THIS_USERS_SERVERKEY_UUID alone will not stop the user copying the script and giving it (along with the Notecard) to other users so we also check THIS_USERS_OWNER_UUID
This is the In-World UUID of the user authorised to use the script and is part of the headers sent to the server by the In-World platform (e.g. Opensim)
The format for each user is:
//User Name
$users[n] = array('serverkey' => 'THIS_USERS_SERVERKEY_UUID' , 'ownerkey' => THIS_USERS_OWNER_UUID');
The first line is a comment for your info only, you will probably want to put the user's In-World name avatar name in here but you can use anything you want
$users[n] - as we are setting up an array, your first user will be $users[0], 2nd $users[1] etc
THIS_USERS_SERVERKEY_UUID and THIS_USERS_OWNER_UUID should be replaced as explained above.
This example shows what this section of the jukeboxserver.php file might look like using real values:
//Set up some valid keys
//Fannybaws Tunwarm
$users[0] = array('serverkey' => 'f6923fc3-1907-4d67-81e0-545cfe690249' , 'ownerkey' => '1fe7be3a-38d7-480d-b436-3b2131bc9299');
//Kappa FaeBrillyunt
$users[1] = array('serverkey' => '50137076-7802-40a0-bc9c-c37a0c3f2b36' , 'ownerkey' => 'efde9f29-e2cf-4953-85aa-db9a9fc3b567');
//Fannybaws FaeBrillyunt
$users[2] = array('serverkey' => '6a5ec4d1-94df-43bb-8527-048715b6bf59' , 'ownerkey' => '19079452-7bf8-43dc-82b1-b60179463415');
**********
The mp3 folder, as the name suggests, should contain all the albums you want the users to be able to stream ;)
We have included an example folder called 'FreeStuff' that contains tracks that (to the best of our knowledge, and we have checked!) are in the public domain and free to copy.
Each album's folder name will be used as a button text In-World, so you should limit it to 9 characters
The individual mp3 file names can be anything you want - within reason, keep them simple as some characters might cause problems when trying to display In-World.
Each folder also needs a 'list.txt' file that contains a playlist for the album - it is up to you to create that file!
jukeboxserver.php will parse this file and add the contents to a list that is sent to the script that runs In-World
Have a look at the example in list.txt the FreeStuff folder...
!01 Chumbawamba - Voices Thats All.mp3, 3, 30,
!02 Kokomo Arnold - Sissy Man Blues.mp3, 0, 46,
!03 Ma Rainey - Booze and Blues.mp3, 3, 18,
!04 Mississippi John Hurt - Nobodys Dirty Business.mp3, 2, 54,
!05 Tom Tom Club - Genius of Love.mp3, 7, 15
Each line starts with ! (this is needed for technical reasons to allow parsing the list In-World
This is immediately followed by:
MP3 FILE NAME (comma) TRACK LENGTH MINUTES (comma) TRACK LENGTH SECONDS (comma unless this is the last track)
Looking at the first line of our example above, jukeboxserver.php will load "01 Chumbawamba - Voices Thats All.mp3 into the list and set the playing time to 3:30 (3 minutes, 30 seconds - the length of the track, this time allows the In-World script to know when to jump to the next track)
As we have a comma at the end of that line, jukeboxserver.php knows that there are more tracks to be added to the list so will continue with the next line.
The final line (!05 Tom Tom Club - Genius of Love.mp3, 7, 15) does not have a comma at the end jukeboxserver.php knows it has reached the end of tracks to add to the list.