15.06.2012, 03:30
Well i have been making my own radio/random stream system for a wile now where players can suggest streams and then admins add the streams if it is apporpriate and such (have all that working well) but i have been having a hard time loading the streams from a file. It loads the songs correctly but it adds a new line to the stream name parameter.
Here is my print i did to the server log...
As you can see its making a line after the name wich is bad for the rest of my system. Here is my loading function
Here is a video of the dialog issue too(used xfire video cause screen shots wont take screens of dialogs)
Video
The Stream name and added by line should all be on the same line but this problem caused that to happen.
Any one know what would cause this to make a new line?
Here is the file it loads from..
Now i did have it loading perfect by having the song name first then i had to add _ in place of spaces make it one string or sscanf would just load the first word as the name then the second word as the url, it worked fine for single named streams then i switched to this and everything works great but it makes a new line out of no where.
I know the strings are a bit high but i want to get this working first lol
Anyone have a idea on why this is happening or does anyone know a way to load with sscanf or just load without sscanf? Need anymore info let me know.
Here is my print i did to the server log...
Код:
[21:40:05] Country [21:40:05] Sky. FM [21:40:05] Big_R_Radio [21:40:05] Slow Music [21:40:05] Aaron FM (Rock) [21:40:05] Techno [21:40:05] Dance Floor Rmx [21:40:05] Get Low [21:40:05] Comedy [21:40:05] .977 The Hits Channel [21:40:05] 181.FM The Buzz [21:40:05] Beatles Radio [21:40:05] 181.FM Rock [21:40:05] Rocky FM [21:40:05] Sky.FM Country [21:40:05] ChroniX GRIT Radio [21:40:05] Spellbound Harbor Radio [21:40:05] Mond-Radio [21:40:05] One-Eleven Radio [21:40:05] Flight Level Radio [21:40:05] Lite Favorites [21:40:05] 420 FM [21:40:05] Malabloos Blues [21:40:05] Talk Radio [21:40:08] NStreamer created 3354 objects [21:40:08] Loaded 24 music streams
pawn Код:
forward LoadMusic();
public LoadMusic()
{
new path[64], line[128];
format(path, sizeof(path), "/AdminFolder/musiclist.txt");
if(!fexist(path))
{
print("Counld not locate song file");
}
else
{
new name[128], url[400],pname[24],File:song = fopen(path, io_read);
while(fread(song, line))
{
if (!sscanf(line, "s[400]s[24]s[128]",url, pname, name))
{
randomMusic[MusicCount][Url] = url;
randomMusic[MusicCount][pAdded] = pname;
randomMusic[MusicCount][MusicName] = name;
printf("%s",randomMusic[MusicCount][MusicName]);
MusicCount++;
}
else
{
printf("cound not load line %i",1+MusicCount);
}
}
}
}
Video
The Stream name and added by line should all be on the same line but this problem caused that to happen.
Any one know what would cause this to make a new line?
Here is the file it loads from..
Код:
http://yp.shoutcast.com/sbin/tunein-stat...id=1283687 Admin Country http://yp.shoutcast.com/sbin/tunein-station.pls?id=728272 Admin Sky. FM http://74.86.186.35:8018/listen.pls Admin Big_R_Radio http://yp.shoutcast.com/sbin/tunein-station.pls?id=1658657 Admin Slow Music http://yp.shoutcast.com/sbin/tunein-station.pls?id=204262 Admin Aaron FM (Rock) http://yp.shoutcast.com/sbin/tunein-station.pls?id=1377200 Admin Techno http://k003.kiwi6.com/hotlink/47pfej18n4/dance_floor_rmx.mp3 Admin Dance Floor Rmx http://k005.kiwi6.com/hotlink/7xy395s711/lil_jon_the_eastside_boyz_get_low.mp3 Admin Get Low http://yp.shoutcast.com/sbin/tunein-station.pls?id=52807 Admin Comedy http://yp.shoutcast.com/sbin/tunein-station.pls?id=1280356 Admin .977 The Hits Channel http://yp.shoutcast.com/sbin/tunein-station.pls?id=37586 Admin 181.FM The Buzz http://yp.shoutcast.com/sbin/tunein-station.pls?id=1273220 Admin Beatles Radio http://yp.shoutcast.com/sbin/tunein-station.pls?id=302754 Admin 181.FM Rock http://yp.shoutcast.com/sbin/tunein-station.pls?id=684390 Admin Rocky FM http://yp.shoutcast.com/sbin/tunein-station.pls?id=780577 Admin Sky.FM Country http://yp.shoutcast.com/sbin/tunein-station.pls?id=2187022 Admin ChroniX GRIT Radio http://yp.shoutcast.com/sbin/tunein-station.pls?id=8850 Admin Spellbound Harbor Radio http://yp.shoutcast.com/sbin/tunein-station.pls?id=161583 Admin Mond-Radio http://yp.shoutcast.com/sbin/tunein-station.pls?id=2052 Admin One-Eleven Radio http://yp.shoutcast.com/sbin/tunein-station.pls?id=105926 Admin Flight Level Radio http://yp.shoutcast.com/sbin/tunein-station.pls?id=2100794 Admin Lite Favorites http://yp.shoutcast.com/sbin/tunein-station.pls?id=33610 Admin 420 FM http://yp.shoutcast.com/sbin/tunein-station.pls?id=222696 Admin Malabloos Blues http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951 [T1S]nickdodd25 Talk Radio
I know the strings are a bit high but i want to get this working first lol
Anyone have a idea on why this is happening or does anyone know a way to load with sscanf or just load without sscanf? Need anymore info let me know.