- Home /
Xampp, internet time, php hosting [Help Needed Urgent Please]
Hi im creating a simple unity game. I'm implementing Internet time to stop players from cheating. SO far i have installed Xampp and started hosting a php file locally. works excellent on unity editor on pc but when i install apk on mobile, nothing happens.
What am i doing wron? please someone put me in the right direction.
So problem is that when you run the game in your mobile device it cannot connect to the server running in your local pc?
Yes mate. Exactly. What am i doing wrong? I know i am giving the wrong url to the script. What should i do?
I might actually end up using playfab's server to access Internet Time Using Server.GetTime function.
OBVIOUSLY, If you have a local server, and if you haven't set it up so that it can be accessed from the web, your mobile phone can't access it....
Unless you plan to keep your personal computer on 24h/24, you will have to rent a server.
If you really want to use your Xampp as a server, you will have to ask this on the appropriate forum. Unity Answers is not meant to explain you how to set up any other software.
Answer by MusicBoxx · Mar 04, 2019 at 11:29 AM
I have a feeling that if you want to use the "apk" file, you should use Unity 5 Remote
because if it's an APK file on your Android phone then obviously your phone can't find the server from your computer. You could also check out Free SQL Database in order to test your game on an Android device.
But what happens when the game goes live? SO far,
1) installed Xampp software. 2) turned apache and the second option to start. 3) saved Time code in a php file at c:xampp/tcf_seomthing_folder/NewFolder/Php_file 4) went to chrome typed localhost/NewFolder/Php_file
output was phpfile code output (Current Time)
then i copied that (4) address i.e "localhost/NewFolder/Php_file"
and put that in my Time$$anonymous$$anager Script in unity. Obvs its not going to work on mobile . as the url is wrong.
Where do i go from here??
You need to upload it to a real web server. I think every developer, beginner or advanced should have his own website for portfolio. It's very useful when you will apply for jobs and it's better than just to throw GitHub links. You could rent / buy a domain with $$anonymous$$ySql server, without Xampp.
Your answer
Follow this Question
Related Questions
`Recv failure: Connection was reset` In editor? (platform set to Android NOT WebPlayer) 0 Answers
What kind of hosting is required to host a MMO server? 1 Answer
UNet - When the host is ended all clients are kicked to lobby scene, how do I stop this? 1 Answer
Stop host without kick clients 1 Answer
How do I format a string into days:minutes:hours:seconds? 6 Answers