Forum Mobile problem with joining room on iPad

Anything specifically relating to droid or iOS development with Unity can go here.

problem with joining room on iPad

Postby raj72616a » December 23rd, 2013, 8:28 am

i'm using Unity iOS 4.3.2
player.io 2.3.6

PlayerIOClient.PlayerIO.Connect works fine to connect to server,
but when i use CreateJoinRoom in the callback:

client.Multiplayer.CreateJoinRoom(
"lobby",
"lobby",
true,
null,
null,
joinedLobby,
failJoinRoom
);

it works in Unity Editor but not in iPad
no error was thrown from the codes, and neither the success callback or the error callback was called.

what could i be doing wrong?
raj72616a
 
Posts: 1
Joined: December 11th, 2013, 3:30 am

Re: problem with joining room on iPad

Postby Ging » December 25th, 2013, 8:20 pm

Encountered with the same problem. If anyone has a solution please tell me
---
With 3.0.1 problem is still there
Unity 4.3.4
player.io 3.0.1
Ging
 
Posts: 7
Joined: December 12th, 2013, 9:54 pm

Re: problem with joining room on iPad

Postby impersogame » April 4th, 2014, 6:41 pm

Still the same problem with player.io 3.0.2.

This prevents us from upgrading Unity to 4.3.x - we're working with old (but not so good) 4.2.2.

Will player.io support Unity 4.3.x ever?
impersogame
Paid Member
 
Posts: 33
Joined: May 17th, 2013, 4:36 pm

Re: problem with joining room on iPad

Postby Guillaume » April 5th, 2014, 11:02 am

Are you on .NET 2.0 or .NET 2.0 Subset mode in your player settings ?
I don't know if this change something...just trying to helping.
Guillaume
 
Posts: 277
Joined: March 28th, 2014, 1:59 am
Location: France

Re: problem with joining room on iPad

Postby impersogame » April 5th, 2014, 12:30 pm

.NET 2.0 Subset mode

Will try .NET 2.0 as last resort.
impersogame
Paid Member
 
Posts: 33
Joined: May 17th, 2013, 4:36 pm

Re: problem with joining room on iPad

Postby impersogame » April 5th, 2014, 1:23 pm

No difference. Still no join callback.
Looks like, they changed some critical things in Unity 4.3.x. For instance, changed method signature is more than enough to be the cause.
impersogame
Paid Member
 
Posts: 33
Joined: May 17th, 2013, 4:36 pm

Re: problem with joining room on iPad

Postby Guillaume » April 5th, 2014, 1:42 pm

Does it do the same thing if you call CreateJoinRoom from outside the callback, maybe using a boolean as a flag ?
Of course working or not working it's not a clean solution...But if it can help you to use or debug this, it's not the worst.

What is strange is that you would have an MissingMethod Exception if it was the case ?
I've got a similar issue for WinRT but with an other third party librarie.

Have you tried to clean your iOS output folder ?
Guillaume
 
Posts: 277
Joined: March 28th, 2014, 1:59 am
Location: France

Re: problem with joining room on iPad

Postby impersogame » April 5th, 2014, 4:01 pm

Guillaume ZAHRA wrote:Does it do the same thing if you call CreateJoinRoom from outside the callback, maybe using a boolean as a flag ?
Of course working or not working it's not a clean solution...But if it can help you to use or debug this, it's not the worst.

Thanks, but nothing so far (
Too bad that topicstarter is missing. Maybe the solution is known long ago.

Guillaume ZAHRA wrote:What is strange is that you would have an MissingMethod Exception if it was the case ?

I agree.

Guillaume ZAHRA wrote:Have you tried to clean your iOS output folder ?

Yes, I clean it regularly.
impersogame
Paid Member
 
Posts: 33
Joined: May 17th, 2013, 4:36 pm

Re: problem with joining room on iPad

Postby Guillaume » April 5th, 2014, 4:19 pm

Not a solution but you may try to compare/analyse your request with a software like Wireshark. However, it's less simple to do that from iPhone/iPad. They are some possibilites listed here : http://corecocoa.wordpress.com/2011/11/ ... he-iphone/

If you are able to do that, then you may try to see :

- Is the request sent on the network ?
- Have you received the response ?
- Can you analyse some "packet" difference ?

However, that does not mean that it would help you to fix the problem, i think Player.IO / Yahoo Games Network team must do some action, and at least if they are some solution to redundant problems, doing a FAQ for it.

Do you have tried to test on an iPhone instead of iPad ?
Do you have tried different "Target iOS Version" options for your iOS builds in your player settings ? I can't test at the moment my builds on iOS, but i'm on 5.1 Target version, stripping level on Disabled.
Finally, are you on Unity Free or Unity Pro ?

Maybe you are having problems because of your Unity Licence if it rely on sockets...Someone is having the same problem on Android, see here : https://playerio.com/forum/viewtopic.php?f=41&t=35055

However, maybe it's something totally different. A Yahoo Games Network / Player.IO clear response would be nice.
Guillaume
 
Posts: 277
Joined: March 28th, 2014, 1:59 am
Location: France

Re: problem with joining room on iPad

Postby impersogame » April 5th, 2014, 4:35 pm

Do you have tried to test on an iPhone instead of iPad ?

Yes.

Do you have tried different "Target iOS Version" options for your iOS builds in your player settings ?

Yes.

Finally, are you on Unity Free or Unity Pro ?

Pro.

As for network sniffling, well, It's a long way solution. I'll see if I even have time to do it.
Of course, some response from Yahoo Games Network would be really appreciated.
impersogame
Paid Member
 
Posts: 33
Joined: May 17th, 2013, 4:36 pm

Re: problem with joining room on iPad

Postby Guillaume » April 5th, 2014, 5:52 pm

Damn, i'm out of idea !

Have you tried the other available methods ? Does it doesn't work either ?
Guillaume
 
Posts: 277
Joined: March 28th, 2014, 1:59 am
Location: France

Re: problem with joining room on iPad

Postby impersogame » April 5th, 2014, 6:20 pm

The only thing which works - rollback to Unity 4.2.2.
I'm out of other ideas either.

Now it's not a big deal for yahoo gamesnet team to be easy on support as the service became free for anyone except commercial games.
But Unity 4.3 came out at November, 12, so nothing was done for almost 5 months while we were still charged with payment.
impersogame
Paid Member
 
Posts: 33
Joined: May 17th, 2013, 4:36 pm

Re: problem with joining room on iPad

Postby Guillaume » April 5th, 2014, 7:37 pm

I think you can try to mail them.

Also, what you can try, and with a little chance :

1. Go to C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\iphoneplayer , from your 4.2.2 installation
2. Save the whole folder.
3. Install Unity 4.3.4
4. Save the same whole folder from your 4.3.4 installation.
5. Try to replace the iPhone-Trampoline folder from 4.3.4 to the one of your 4.2.2 installation.

It may fail miserably. I'm just trying to find a workaround for you. I don't have any sample to test either.
Guillaume
 
Posts: 277
Joined: March 28th, 2014, 1:59 am
Location: France

Re: problem with joining room on iPad

Postby paala2 » May 14th, 2014, 10:19 am

So,
After more than 6 months from the date when unity 4.3 was released YGN didn't update the SDK to work with it?

So YGN is dead?
paala2
 
Posts: 36
Joined: November 4th, 2012, 10:13 am

Re: problem with joining room on iPad

Postby impersogame » June 13th, 2014, 6:43 am

Guillaume ZAHRA wrote:I think you can try to mail them.

Also, what you can try, and with a little chance :

1. Go to C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\iphoneplayer , from your 4.2.2 installation
2. Save the whole folder.
3. Install Unity 4.3.4
4. Save the same whole folder from your 4.3.4 installation.
5. Try to replace the iPhone-Trampoline folder from 4.3.4 to the one of your 4.2.2 installation.

It may fail miserably. I'm just trying to find a workaround for you. I don't have any sample to test either.


It won't work. Unity 4.3.4 won't complete iOS build with 4.2.2. libraries with an 'extensions not loaded for iOs' error.
impersogame
Paid Member
 
Posts: 33
Joined: May 17th, 2013, 4:36 pm

Re: problem with joining room on iPad

Postby david.a.diaz@gmail.com » September 30th, 2015, 2:29 pm

Hi all,

I'm experiencing this problem as well with the latest SDK (currently 3.2.409) and Unity 4.6.8p2. The CreateJoinRoom method doesn't call the success or error callbacks, it just fails to respond. I left it 5+ minutes with no answer.

Guillaume suggested a workaround: Reattempt the connection after a timeout; this worked and I'm now able to connect but I'm concerned because I noticed the following:

Without the dev server (connecting to player io main cluster) the room is created in the server, I can see it in the Multiplayer section of the dashboard, the client never responds though. This can create trouble if there's a hanging connection in the room.

* Has anyone found a solution to the IOS hanging problem?

* Does anybody know if the server calls the UserJoined method in the server code even if the client fails to respond?
david.a.diaz@gmail.com
 
Posts: 24
Joined: January 7th, 2013, 11:50 am

Re: problem with joining room on iPad

Postby Guillaume » September 30th, 2015, 4:05 pm

I don't have the answer, however, you may try to use the ErrorLog API of PlayerIO in the UserJoined Method ?
This way, you will see from your dashboard if the method fired from the Multiplayer code or not.

And at the moment, i don't have any feedback if everything work better on iOS if using "Good Ol'Socket" Asset Plugin.

Ultimately, if you are very concerned about the "Hanging" connection, i don't know what is your context, but a workaround solution would be to use a "Flag" value to validate your client connection.

Then, in your workflow, you would add a Timer, on UserJoined or GameStarted, depeding if you use the service for a realtime multiplayer game or for a service room.

Then check when the timer fire if the player connection contain the "Flag" value. If not, the server can then drop the Hanged connection.

You may see here: https://gamesnet.yahoo.net/documentatio ... serverside
And ScheduleCallback: https://gamesnet.yahoo.net/documentatio ... leCallback
And AddTimer: https://gamesnet.yahoo.net/documentatio ... e#AddTimer

So you would do something like this for a Service Room (Not tested, just a concept):


Server Side:

Code: Select all
public override void UserJoined(Player player) {
     ScheduleCallback(delegate()
    {
      //First checking that the player object has not been freed from the memory before the callback call.
      if (player != null &&
         player.JoinData.ContainsKey("validConnection") == false)
      {
         //Player does not have the validConnection flag !!
         //Droppping this client connection from the server...
         player.Disconnect();
      }
   
    }, 10000); //Current user object will be dropped if it doesn't have the connection Flag set after the connection...
}

public override void GotMessage(Player player, Message message)
{
  switch (message.Type)
  {
   case "ConnectionValidation":
    if (player.JoinData.ContainsKey("validConnection") == false)
      player.JoinData.Add("validConnection", "true");
  }
}


Client Side:

Code: Select all
client.Multiplayer.CreateJoinRoom(
            "$service-room$",               //Room id. If set to null a random roomid is used
            roomName,                  //The room type started on the server
            false,                        //Should the room be visible in the lobby?
            null,
            null,
            delegate(Connection connection)
            {
            //W00t! Connection event fired ! Just sending the Client validation Flag to the server...
            connection.Send("ConnectionValidation", new object[] { 0 } ); //Sending a dummy parameters, we don't care...
         },
         delegate(PlayerIOError error)
         {
            //Total Failure ! Do whatever you want !
         });


Tell me if it works !
Guillaume
 
Posts: 277
Joined: March 28th, 2014, 1:59 am
Location: France

Re: problem with joining room on iPad

Postby impersogame » October 19th, 2015, 8:41 am

I can confirm that this approach works in my case. It helped us to fix the long connection delay issue on 64-bit iOS builds. Thank you, Guillaume.
impersogame
Paid Member
 
Posts: 33
Joined: May 17th, 2013, 4:36 pm

Re: problem with joining room on iPad

Postby Guillaume » October 19th, 2015, 12:30 pm

You are welcome :) !
I think we can't blame PlayerIO for this problem, as this error doesn't exist on Mono backend versions of Unity with the PlayerIO API.

In fact, i would have submit a "bug" ticket to Unity team, as it seem its only related to IL2CPP/Unity originally. But in the past, i don't have noticed the "bug" when Unity Team was able to make IL2CPP working, as i have myself opened ticket to make Unity PlayerIO compatible, because of my Retry behavior in my own code, i was thinking: Everything work great everytime.

But its not too late to send a Bug report to Unity with a repro project! I don't have done this myself because i'm actually working on Unity 4.x and it will not be updated after December 2015. However, feel free to report this behavior on your Unity 5.x project.

EDIT: Seem that this problem was already here in 2014 as i read in the top of that thread. So just ignore what i said :p . I don't know wich end is problematic (PlayerIO ? Unity ?)
Guillaume
 
Posts: 277
Joined: March 28th, 2014, 1:59 am
Location: France


Return to Mobile



cron