Music from my dedicated server

Python 3 Server Controller for Trackmania and Shootmania for script-only modes.

Moderators: TheM, toffe, NADEO

GrandPa43
Posts: 9
Joined: 23 Apr 2013, 16:14

Music from my dedicated server

Post by GrandPa43 »

Hi,
My question is how to set a correct command in the base file to get music on my server?

# Songs is a list of URLs to .ogg files of songs to be played by the music server.
SONGS = {
'default': []
}


Please show me a correct example on this url and songs:
Http://My-music_server.com

song1.ogg
song2.ogg
song3.ogg
song4.ogg

Greetz,
GrandPa
User avatar
toffe
Posts: 782
Joined: 15 Jun 2013, 10:57
Location: The Netherlands
Contact:

Re: Music from my dedicated server

Post by toffe »

First of all, make sure you enabled the app in the apps.py like this (add the line to the list of apps):

Code: Select all

'pyplanet.apps.contrib.music_server',
For the full documentation on enabling apps, see: http://pypla.net/en/latest/intro/config ... -apps-apps

For your song configuration, you should just add the URL's to the list inside the default key, like this:

Code: Select all

  SONGS = {
    'default': [
      'http://My-music_server.com/song1.ogg',
      'http://My-music_server.com/song2.ogg',
      'http://My-music_server.com/song3.ogg',
      'http://My-music_server.com/song4.ogg',
    }
  }
(doc: http://pypla.net/en/latest/intro/config ... songs-base)

Restart PyPlanet and the songs will appear in the /songlist
Please let me know if this helped you getting the music to work on your server.
GrandPa43
Posts: 9
Joined: 23 Apr 2013, 16:14

Re: Music from my dedicated server

Post by GrandPa43 »

Thanks for quick answer, I possibly forget to inform that i run the server on version 0.6.3 I'm not sure that make any difference.

My second question is: some map authors have added music allready in theyr map, and i do not want to override this music, is there any "switch (true/false)" that control this?

Greetz
GrandPa
User avatar
toffe
Posts: 782
Joined: 15 Jun 2013, 10:57
Location: The Netherlands
Contact:

Re: Music from my dedicated server

Post by toffe »

When using the music app, the map authors music will be overwritten by the personal queued songs from the app.

Toffe
GrandPa43
Posts: 9
Joined: 23 Apr 2013, 16:14

Re: Music from my dedicated server

Post by GrandPa43 »

Hi, and a again thanks for quick answer. :clap:
I hope you will alter the music app to the possibility to not override authors music, to me is the app useless atm. I will not insult the author with overide his music ;)
Case is closed, thanks for enlighting my mind :thumbsup:

Greetz
GrandPa :pil
GrandPa43
Posts: 9
Joined: 23 Apr 2013, 16:14

Re: Music from my dedicated server

Post by GrandPa43 »

Hi Toffe, thanks for good guide on how to set songs in your music app. I have now done a successful tryout :) I downloaded in the server 7 different songs from a external server and all works smooth. Of coarse i hope for a possebility to not override the ingame music, so that must be my wish for the future.
Your Pyplanet controller is running stably and well 24/7, I very much appreciate your work, :clap:
Greetz,
GrandPa,
yaahooz
Posts: 6
Joined: 24 May 2020, 19:17

Re: Music from my dedicated server

Post by yaahooz »

HI everyone, hope you don't mind if I jump into the thread GrandPa43.

I got a problem with setting up music for the my server though, and I thought I'd ask you guys for help.

So I added the musicserver script to my apps.py
I then uploaded one song to the external server, created a public URL (not protected or anything)

I pasted it into my basy.py

The problem is this:

When I copy and paste this code:

SONGS = {
'default': [
'http://My-music_server.com/song1.ogg',
'http://My-music_server.com/song2.ogg',
'http://My-music_server.com/song3.ogg',
'http://My-music_server.com/song4.ogg',
}
}

I get a planet.py error when I start to run it (see the windows shell jpg, syntax error in line 100).

When i change } to ] (see attached jpg file) planet.py starts all right, server's running OK, however I can hear no music whatsoever, no game built-in music, no music I wanted to hear, nothing.

So, where is the problem, what am I doing wrong?
Attachments
invalid syntax error.jpg
invalid syntax error.jpg (105.98 KiB) Viewed 4518 times
base.py.jpg
base.py.jpg (16.4 KiB) Viewed 4518 times
User avatar
TMarc
Posts: 15441
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: Music from my dedicated server

Post by TMarc »

I guess the example is wrong with the closing brace.

Perhaps don't configure any song than the default, and add one song using the server interface, which should write the song list by itself in the format it needs.
TheBigMiike
Posts: 1257
Joined: 06 Mar 2013, 16:12
Location: Vendée | France
Contact:

Re: Music from my dedicated server

Post by TheBigMiike »

Changing the character } to ] was indeed a step in the right direction. Now the song is probably not played and downloaded by PyPlanet simply because the link is not correct. It should DIRECTLY point to the music resource and not to a webpage which is the case here when I type your url on my browser.

Put a link which directly downloads your music and it should solve the problem.
Image Image
User avatar
TMarc
Posts: 15441
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: Music from my dedicated server

Post by TMarc »

Those links above are obviously only placeholders, not real music pieces, you really tried them!? :roflol:
Post Reply

Return to “PyPlanet”

Who is online

Users browsing this forum: No registered users and 1 guest