|
Post by grimbarian on May 22, 2015 7:58:30 GMT
Ok, I've decided that instead of a 2 player mode in the SuperSprint clone type game I'm popping together, it'll be a bit nicer and add longevity if the player time for each track is submitted to an online scoreboard on a website i'll be setting up. But I'm gonna need some help to set this up as I know literally nothing about php (which I presume I'll be using). I've read this example which I presume will help - linky - but if I'm honest I don't really understand it. I think I need it dumbing down a bit or making more relevant to me. Most likely for the times I will be using psikoT's good old race timer from here. I understand that at the end of the race I will need to get the time (easy done), save it as a file - including which track it was (not too sure here - presuming via the iFile functions), then I'm a bit lost in sending it to the website and the code to read and sort the scores. Sure it's going to be a php database or something - but I really am confused at this point. Is there anyone here that can provide a sample or step by step through this for me please?
|
|
|
Post by Power Supersport on May 22, 2015 11:19:24 GMT
Wow! I didn't even know that 3D Rad can submit to net... I only knew that it can download files, but not to submit... Ok, just downloaded and tried... You must have a host, where to upload the tow files (the text and the PHP)... Open the Php FROM the host and get it's link... Go to rad, find in the script: serverstring = " radserver.net76.net/code/radhighscore1.php?name="+username+"&score="+IN_22; And paste ON the underlined text shown here... That's it! I tried it and it worked...
|
|
|
Post by grimbarian on May 22, 2015 11:24:34 GMT
Erm, glad this works, but I think I'm going to have to ask for it a little more "step by step" if that's ok. Like I'm a complete novice and idiot...
|
|
|
Post by Power Supersport on May 22, 2015 11:38:52 GMT
Nope, you are not... Detailed help: - Go to 000webhost.com - Order a free hosting service... - Fill the empty fields with what you want... this is for creating site host... - After registrarion, close the site... - Open the 000webhost.com again... - Go to "Members area" on the right side of the site... - Type in your e-mail and password... - Then, you should see your created sites... - Go to "CPanel" of your site... - Find "File Manager" and click it... - You may need to retype password... - An error page may arrive, but just go back, reload the page and confirm the message that will appear... - Now, when you are into the file manager, go to "public_html" folder... - Upload the .php and the text file there... - When done, click on the "Open" when you highlight the php... - A new webpage should arrive... Should display "Error#1 - score or username error.." - Copy the link and place it into 3D Rad's script where I previously said... - Test!
|
|
|
Post by grimbarian on May 22, 2015 11:48:32 GMT
Thanks PS - I'll go through it tonight and post how I get on.
|
|
|
Post by n_iron on May 23, 2015 23:56:03 GMT
Hi Grim This line 'URL' is the location of the score text file on the server. This line is in the 3drad game script. (serverstring = "http://radserver.net76.net/code/radhighscore1.php?name="+username+"&score="+IN_22;) These lines of php code is what retrieves data from the URL // get score $score = intval($_GET['score']); // intval() — Get the integer value of a variable // get username $name = urlencode($_GET['name']); // urlencode() — URL-encodes string Look at the 3drad page where this post was found you will see an example of how to use $_GET "http://www.3drad.com/forum/index.php?topic=4448.0" The '?' after '.php' tells instructs php to get the following data from the URL 'topic=4448.0' 'topic' is the unique identifier 4448.0 is the data that in this case tells php which page to display. I have not tried any of this but it look interesting. I didn't think this was possible as it can open a can of worms but if the modifications are contained to just the text file on the server it might just work. It may also depend on the file permissions and or the host. ?? n_iron
|
|
|
Post by grimbarian on May 24, 2015 7:10:15 GMT
Thanks very much for the explanations n_iron - really appreciate it.
Been too busy to look at this properly yet - but will certainly keep this thread updated with my progress when I get the time to have a go.
|
|
|
Post by TinSoldier on Jan 10, 2016 1:48:45 GMT
I remember this from the forum but now that 3rad.com closed...
Is there a link or source for the original "http://www.3drad.com/forum/index.php?topic=4448.0" files ?
I would like to play around with it..
PS i created a 000webhost page only to find out, you have to use them or they deactivate or delete your pages.. it's all part of the NAG process hoping to get you to upgrade to a paid hosting option.
Skype does a similar thing, i have credit with skype so i don't see advertising in my skype windows until recently.
Advertising now shows in my skype windows because it's been 3 months since i used or bought new skype credit.. so microsoft "deactivates" your credit which cause's advertising to be turned on till you visit skype.com and reactivate your skype credit..
It's all a NAG process to get you to use your skype credit... fu***** MS .. apparently just giving them money that they have in the bank making them some fraction of interest isn't good enough .. you have to use more..as if billy isn't rich enough...
|
|
|
Post by TinSoldier on Jan 30, 2016 6:16:57 GMT
I thought about this too and came up with another solution that avoids PHP.
First method - Get a drop box account and leave it running on your windows machine as long as you run the 3drads program as a server. In your server scripting you update scores as needed then save the score file to your local dropbox folder. Dropbox will see the new file as updated or new, and sync it with your online storage at dropbox.
Now anyone or any program can direct download the score file from your dropbox account only needing the download link ( dropbox becomes your server location providing 24/7 access to what ever files you want to share, you just need to update / store the files locally to your dropbox folder ).
Method #2 - Run one small server project on your system solely as a score or file updating process, basically make a small 3drad project that acts as a file server to update scores etc. Also keep a file updated between all clients that holds a server list, the server list is an IP & port list for anyone who wants to run your project as a server and wants to advertise their server to anybody running that 3drad project. After enough people run the project as server or client, the server list begins to grow, combine this with the dropbox process above if preferred, and you have an up to date server list any client or server can access 24/7 ALL FOR FREE and no PHP required.
As the server list grows and gets shared and synced between clients and other servers, you can turn off your original server and let other servers & client machines keep the files updated between themselves.
The only process i haven't thought about is if you turn off your development server after some time, how would the dropbox list of servers be updated if you don't do it locally as the dropbox owner.
This may be possible because dropbox does support collaborative file sharing and updating using a password process to read and write files... a 3drad project mite be able to access and update the files directly without using the small syncing server mentioned in method #2.. Needs testing / investigation.
Al things considered, maybe a PHP process mite be just as easy if you can find a free PHP hosting plan with no bandwidth restrictions.
|
|