(iOS SDK 4.0.5.0) Creating rooms with custom properties is broken

domp_
domp_
edited December 2015 in Native
I was trying to use custom room properties but no matter what I tried, it didn't work. I could successfully create a room with custom properties by calling -opCreateRoom::, but the custom properties never showed up when I retrieved the room info on other clients.

I then looked at the -opCreateRoom:: method inside EGLoadBalancingClient.mm class (line number 531) and found the mistake in this specific part:

        EGRoomOptions* opt;
	if(self.IsOnGameServer)
	{
		EGMutableRoomOptions* mutOpt = [[options mutableCopy] autorelease];
		mutOpt.CustomRoomProperties = nil;
		mutOpt.PropsListedInLobby = nil;
		opt = mutOpt;
	}
	else
		opt = options;
So, when creating a room the self.IsOnGameServer value is true, the options get copied and the custom room properties get removed, thus they never get sent to other clients. After I removed the 2 lines where the properties get set to nil, everything was working as it should.

I'm wondering why no one noticed this yet :neutral:

Comments

  • Kaiserludi
    Kaiserludi admin
    edited December 2015
    Hi @domp_.

    We did a major refactoring to opCreateRoom(), which introduced that bug, with 4.0.5.0 and that code did not get released until last Wednesday. It works fine with 4.0.4.1.
    So there have just been 3 and a half day for people to update to the latest SDK and run into this issue.
    That is probably why you are the first one to notice this issue.

    The two lines, where the properties get set to nil are actually correct.
    The bug is in line 532:
    if(self.IsOnGameServer)

    As a fix please change that line into
    if(!self.IsOnGameServer)
    (note the "!")

    Please also apply that fix to line 592.

    We will release that same fix with version 4.0.5.1 early next year.

    Thank you for reporting this bug.
  • Cheers, thanks for the fast response!