OpenLoad - The first open-source sv_loadingurl framework!
112 replies, posted
[QUOTE=Looter;44807432]You should switch from Mysqli to PDO.[/QUOTE]
What for? The only reason would be because PDO supports PostgreSQL and a few others, while the SQL modules for Garry's Mod only supports MySQL as far as I'm aware.
Please append your statement with some information why you would like to see that instead.
After setting up my new webspace, I finally got this thing to work. [B]And its pretty amazing![/B]
[URL="http://openload.conradowatz.de/index.php?template=tttv2"]Here you can see it[/URL]
Down below I wrote some things I experienced trying out OpenLoad.
[U]Bug[/U]
I do like the look of the standart template, but I made some changes, so it fits better to my server.
After saving it in a new folder under templates and mapping it in template.list.php, i changed the ?template=*** in sv_loadingurl to my new template. Now here's where the curious starts: When I joined the server there seemed to be a 50/50 chance that either my template or the standart "strapquery" template loaded.
I fixed that bug by allocating the strapquery template to my new one in the template.list.php config, so it looks like this:
[IMG]http://openload.conradowatz.de/bug.png[/IMG]
[U]I need your help![/U]
There are some features that I would like to implement in my loading screen.
The first one is realy simple, but I just don't know how to do it:
[IMG]http://openload.conradowatz.de/loadingscreen.png[/IMG]
I want that it says "Points" after the amount of pointshop points, so that players know these are their points.
How can I change my template or the src files to display that?
For my second question you need to know that I made screenshots of all my maps on the server, because the ones on gametracker have a very low resolution. I put them in a folder called "maps" and changed the openload.class.php so that it would load the image files from there (with the full web-path to my webspace).
[IMG]http://openload.conradowatz.de/mapssettings.png[/IMG]
Because the files are located on the same webspace as the loading screen, it would improve the loading time of the image if it would path to these automatically, instead of making an external connection to the same server to pull the image.
How can I change it, so the image will be loaded from my webspace directly? I tryed "../../maps/$this->mapname.png" but it didn't work.
My third question is: Can I make it, so that the background of the loading screen changes either random or per map (make the map screenshot as background)? I know the background is set in the template.css file and you can't use php commands there. So maybe I can somehow set the background in the index.html file? Again I don't have any clue how to do that :).
[B]I thank everyone who wants to help me and of course Svenskunganka for his great work![/B]
[QUOTE=Conradowatz_;44807497]...[/QUOTE]
For the issue with the 50/50 chance of getting the real template and the Pointshop issue, I will push a patch in a moment! I'll PM you when that's done with the commit so you can see what changes I've made.
As for the background images, you can use jQuery to fade between different background images.
[editline]14th May 2014[/editline]
Seems like you've disabled Private Messaging in your settings. Anyway, here's the commit changes: [url]https://github.com/Svenskunganka/OpenLoad/commit/98633de1de1201a0f8e564059a4b8c853733f75d[/url]
Preview: [url]http://svenskunganka.com/demo/openload/index.php?template=strapquery[/url]
[editline]14th May 2014[/editline]
Here's how you'd want to change background depending on what map:
1. Add this snippet to line 17 in [B]src/js/openload.js[/B]:
[code]
if(typeof change_bg == 'function') { change_bg(mapname); }
[/code]
2. In templates/strapquery/js/strapquery.js add this function somewhere:
[CODE]
function change_bg(mapname) {
var maplist = {};
/*
Usage:
maplist['map_name'] = "path/to/image";
Add more array values.
*/
maplist['ttt_rooftops_a2'] = "templates/strapquery/img/ttt_rooftops_a2.jpg";
if(mapname in maplist) {
$('body').css('background-image','url('+maplist[mapname]+')');
}
}
[/CODE]
(Not tested, but should work)
[QUOTE=Svenskunganka;44807667]
Here's how you'd want to change background depending on what map:
1. Add this snippet to line 17 in [B]src/js/openload.js[/B]:
[code]
if(typeof change_bg == 'function') { change_bg(mapname); }
[/code]
2. In templates/strapquery/js/strapquery.js add this function somewhere:
[CODE]
function change_bg(mapname) {
var maplist = {};
/*
Usage:
maplist['map_name'] = "path/to/image";
Add more array values.
*/
maplist['ttt_rooftops_a2'] = "templates/strapquery/img/ttt_rooftops_a2.jpg";
if(mapname in maplist) {
$('body').css('background-image','url('+maplist[mapname]+')');
}
}
[/CODE]
(Not tested, but should work)[/QUOTE]
Hm... Making a maplist for every map seems to complicated ;)
I tried this:
[CODE]function change_bg(mapname) {
var pathtoimage = "maps/";
pathtoimage += mapname;
pathtoimage += ".png";
if(mapname in maplist) {
$('body').css('background-image','url('+pathtoimage+')');
}
}[/CODE]
but it didn't worked.
[U]One last thing[/U]
What about something like this:
if gamemode = "terrortown" then display "Trouble in Terrorist Town" etc.
I don't know how exactly you would code it.
Anyway, thank you for your quick reply.
[code]
function change_bg(mapname) {
var pathtoimage = "maps/"+mapname+".png";
$('body').css('background-image',"url('"+pathtoimage+"')");
}
[/code]
[editline]14th May 2014[/editline]
[QUOTE=Conradowatz_;44808454]
[U]One last thing[/U]
What about something like this:
if gamemode = "terrortown" then display "Trouble in Terrorist Town" etc.
I don't know how exactly you would code it.[/QUOTE]
Add this to src/js/openload.js on line 16 [U]before[/U] [B]$('#gamemode').html(gamemode);[/B]
[code]
if(gamemode == "terrortown") {
gamemode = "Trouble in Terrorist Town";
}
[/code]
Working on a new template!
Here's some eye candy for you! (Press [i]Enter[/i] to pause music, it's on 30% volume tho.)
[url]http://svenskunganka.com/demo/openload/index.php?template=soil[/url]
[QUOTE=Svenskunganka;44811920]Working on a new template!
Here's some eye candy for you! (Press [i]Enter[/i] to pause music, it's on 30% volume tho.)
[url]http://svenskunganka.com/demo/openload/index.php?template=soil[/url][/QUOTE]
I thought you couldnt interact with the loading screen
[QUOTE=Aj;44812527]I thought you couldnt interact with the loading screen[/QUOTE]
I'm fully aware of that, added the functionality temporarily in case someone wants to view the source so they don't [b]have[/b] to listen to the music.
People will go off adding music to their loading screens either way, so atleast they have to start off with some calm, nice music!
[QUOTE=Svenskunganka;44807465]What for? The only reason would be because PDO supports PostgreSQL and a few others, while the SQL modules for Garry's Mod only supports MySQL as far as I'm aware.
Please append your statement with some information why you would like to see that instead.[/QUOTE]
It automatically sanitizes database input, and has lots of nice driver options and run-time attribute options, one in particular I think would be useful for this project is PDO::ATTR_PERSISTENT, which maintains a persistent connection to the MySQL database to avoid the overhead of establishing a connection for every page request - would be handy for a loading screen. There's probably more I'm missing.
Looking very good sir, will be looking into using this soon. My coming project will need it...
Started designing a shizton of template ideas in paint, until I took the original template in-game...
Only parts of the loading screen actually work.
[IMG]http://i60.tinypic.com/11c8vns.png[/IMG]
Should I continue brainstorming ideas or should I stop here?
[QUOTE=.:ATomIC:.;44828872]Started designing a shizton of template ideas in paint, until I took the original template in-game...
Only parts of the loading screen actually work.
[IMG]http://i60.tinypic.com/11c8vns.png[/IMG]
Should I continue brainstorming ideas or should I stop here?[/QUOTE]
The template works perfectly fine for both me and others. You probably forgot to edit the configuration.
New template added:
[B]Soil[/B]
[video=youtube;hfxl11_4Tms]http://www.youtube.com/watch?v=hfxl11_4Tms[/video]
(I'm happy with it)
[QUOTE=Svenskunganka;44864512]New template added:
[B]Soil[/B]
[video=youtube;hfxl11_4Tms]http://www.youtube.com/watch?v=hfxl11_4Tms[/video]
(I'm happy with it)[/QUOTE]
Looks great, will have to be the default laoding screen for my project.
[QUOTE=MadkillerMax;44864885]Looks great, will have to be the default laoding screen for my project.[/QUOTE]
Glad you enjoy!
Btw, the music used in the loading screen is composed by [URL="https://www.youtube.com/user/Vindsvept"]Vindsvept[/URL]. He composes great music, show some love!
How can I enable it to work with the databases? I added it into the config, but dosn't seem to show on loading screen.
Thanks
[QUOTE=kpjVideo;44880384]How can I enable it to work with the databases? I added it into the config, but dosn't seem to show on loading screen.
Thanks[/QUOTE]
What type? DarkRP and/or pointshop? Make sure it has a MySQL database and if the database is hosted on another machine than the webserver, the MySQL instance needs to allow remote connections.
So right now i got this running [url]http://worldofvagax.com/gmod/index.php?template=soil[/url]
But i want to change the background to something more fitting, do you by any chance have any extra background videos laying around? Or perhaps you know a easy way to make a slideshow of pictures as background.
[QUOTE=darth-veger;44885107]So right now i got this running [url]http://worldofvagax.com/gmod/index.php?template=soil[/url]
But i want to change the background to something more fitting, do you by any chance have any extra background videos laying around? Or perhaps you know a easy way to make a slideshow of pictures as background.[/QUOTE]
Sorry, I don't. You can make a slide with jury.
Hmm so I have a server running with DarkRP and Pointshop. And it doesn't show the money or points. DarkRP is MySQL enabled and openload is MySQL enabled. Do they all have to be using the same databases or something?
[QUOTE=ProGamerzFTW;44887203]Hmm so I have a server running with DarkRP and Pointshop. And it doesn't show the money or points. DarkRP is MySQL enabled and openload is MySQL enabled. Do they all have to be using the same databases or something?[/QUOTE]
They both requires to be in the same database. I'll look into this when I get back home (Sunday) and see if there's an issue somewhere in the class.
[QUOTE=Svenskunganka;44887452]They both requires to be in the same database. I'll look into this when I get back home (Sunday) and see if there's an issue somewhere in the class.[/QUOTE]
Yeah I merged the two databases and its working fine now.
Right now I feel like this project is officially out of beta.
I wonder if there's anything else you'd want me to add to it except more templates? MySQL support for other kind of services? Improvements?
[QUOTE=Svenskunganka;44908733]Right now I feel like this project is officially out of beta.
I wonder if there's anything else you'd want me to add to it except more templates? MySQL support for other kind of services? Improvements?[/QUOTE]
Maybe MySQL support for having pointshop and darkrp in different databases?
I think OpenLoad is pretty finished. I didn't experienced any bugs in the last weeks.
You could maybe add UTime support.
Edit: I tried UTimeMOO on my server and it didn't worked, so i guess i don't need it :)
[B]Latest patch:[/B]
- Info that is fetched through Steam API (player name and avatar) is now cached. Since Steam API is really slow, this had an impact on how fast the loading screen loaded in. Concurrent players now loads the loading screen really fast compared to before.
- Added some minor error checking when fetching map image from GameTracker.
[URL="https://github.com/Svenskunganka/OpenLoad/commit/24e79aabf93a413a416291187602c9be22edbb69"]Latest commit on GitHub[/URL].
this it very nicely made pleaseing to the eye
Thanks for this, so powerful, and so easy to build a template :P
[url]http://i.imgur.com/GOGxr1X.png[/url]
Based loosely on the Strapquery template, and uses some code directly from it, so won't release publicly
[QUOTE=Domos;44987439]Thanks for this, so powerful, and so easy to build a template :P
[url]http://i.imgur.com/GOGxr1X.png[/url]
Based loosely on the Strapquery template, and uses some code directly from it, so won't release publicly[/QUOTE]
Glad to be of service! I like the simplicity you've decided to go for with the template!
For those of you who use the StrapQuery template, a bug has been spotted when fetching the current map image from GameTracker that now has been resolved. Get the latest update from [URL="https://github.com/Svenskunganka/OpenLoad"]GitHub[/URL].
[URL="https://github.com/Svenskunganka/OpenLoad/commit/0a49b9c7810c24ba651287af929e885ffee67134"]Commit changes[/URL]
Sorry, you need to Log In to post a reply to this thread.