I developed a game, Alien Checkers, it works perfectly on Android and on the Web, but when I put it on an i-Pad, the multi-player part of the game does not work. I use a form and post information to some php code on a server. In iOS the post goes through but it does not seem to return the expected information. For example I posted my create new user code below. On the iPad I can create a new user, I know because I look at the data base and the new user is there, but you wouldn’t know from trying it on the iPad because this line of code:
Application.LoadLevel("onlinesetupmenu"); is never executed so the game just sits there appearing to do nothing. It is happens like this for my other WWW calls as well. If you want to try the game to see what I’m talking about you can play for free
alien checkers You see that if you create a new user you should be brought to another screen where you can challenge other players to games.
I know that was a lot so I’ll summarize with these bullets
On the iPad
- successfully post data to database
- do not get the expected returns, so in this case I am not brought to the new level / Screen
What am I doing wrong here? Once again this is my first try with iOS so I’m hoping it’s something simple.
Here is the full snippet
private IEnumerator CreateNewUserDB(string myUsername, string myPassword, string myEmail ,int myColor){
var form = new WWWForm();
form.AddField( "password", "******");
form.AddField( "username", myUsername);
form.AddField( "userpassword",myPassword);
form.AddField ("email",myEmail);
form.AddField ("color",myColor);
WWW download = new WWW( "http://www.aliencheckers.com/createnewuser.php",form);
yield return download;
if( download.error != null) {
print( "Error downloading: " + download.error );
} else {
PlayerPrefs.SetInt("LoggedIn",1);
PlayerPrefs.SetString ("loggedinplayer",myUsername);
PlayerPrefs.SetString("PlayerOne",myUsername);
PlayerPrefs.SetString("password",myPassword);
char[] delimiterChars = {':'};
string[] usertable = download.text.Split(delimiterChars);
print (usertable[0]);
if(usertable[0] == "successful login"){
if (rememberMe){
PlayerPrefs.SetInt("RememberUser",1);
PlayerPrefs.SetString("RememberUserName",myUsername);
PlayerPrefs.SetString("RememberPassword",myPassword);
}
else{
PlayerPrefs.SetInt("RememberUser",0);
PlayerPrefs.SetString("RememberPassword",myPassword);
}
Application.LoadLevel("onlinesetupmenu");
}
else{
nameErrorMsg = "this name is taken\n please choose another name";
}
}
}