CreateRoomRequest Silently Fails

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Post Reply
Sbn
Posts: 26
Joined: 25 Nov 2014, 20:37

CreateRoomRequest Silently Fails

Post by Sbn »

The code below seems to work fine whenever our bulk data is a reasonable size; however, when the BULK_DATA contains a lot of data the Request seems to silently fail. The server logs don't write out any errors. The client side SFSEvent.ROOM_CREATION_ERROR event doesn't trigger nor the SFSEvent.ROOM_ADD event.

The test model that I'm using adds about 25000 strings(within the UTFStringArray limits according to documents). I've tried splitting the the string array into smaller packages of 1000 and it still silently fails.

Any Ideas?

Code: Select all

public override void CreateRoom(SessionData sessionData, List<RoomVariable> roomVariables = null, bool autoJoin = true)
{
    RoomSettings settings = new Sfs2X.Requests.RoomSettings(sessionData.name);
    settings.Password = sessionData.password;
    settings.MaxUsers = 100;
    settings.MaxSpectators = 0;
    settings.IsGame = true;
    settings.MaxVariables = short.MaxValue;
    settings.GroupId = "reviews";

    if(roomVariables != null)
    {
        settings.Variables = roomVariables;
    }
    else
    { 
		ISFSObject modelSFSObject = new SFSObject();
		modelSFSObject.PutInt(SFSVariableTypes.OBJECT_TYPE, (int)NetworkObjectID.MODEL);
		modelSFSObject.PutUtfString(SFSVariableTypes.ID, sessionData.model);
		modelSFSObject.PutUtfString(SFSVariableTypes.DATA, sessionData.modelUUID);
		modelSFSObject.PutUtfStringArray(SFSVariableTypes.BULK_DATA, sessionData.modelParts.ToArray());
    
		ISFSObject environmentSFSObject = new SFSObject();
		environmentSFSObject.PutInt(SFSVariableTypes.OBJECT_TYPE, (int)NetworkObjectID.ENVIRONMENT);
		environmentSFSObject.PutUtfString(SFSVariableTypes.ID, sessionData.environment);
		environmentSFSObject.PutUtfString(SFSVariableTypes.DATA, sessionData.environmentUUID);
        
		settings.Variables = new List<RoomVariable>()
        {
            new SFSRoomVariable(SFSVariableTypes.LOADED_MODEL_ID, modelSFSObject),
            new SFSRoomVariable(SFSVariableTypes.LOADED_ENVIRONMENT_ID, environmentSFSObject)
        };
    }
       
    SFSNetworkManager.SmartFoxServer.Send(new CreateRoomRequest(settings, autoJoin));
}
Sbn
Posts: 26
Joined: 25 Nov 2014, 20:37

Re: CreateRoomRequest Silently Fails

Post by Sbn »

I updated the server to 2.19.1 and the client api to the latest 1.8.1 to ensure it wasn’t an out of date issue.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: CreateRoomRequest Silently Fails

Post by Lapo »

Hi,
is this reproducible in the Editor or only in the build?
Are you working with standard sockets or Websocket/WebGL?


Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Sbn
Posts: 26
Joined: 25 Nov 2014, 20:37

Re: CreateRoomRequest Silently Fails

Post by Sbn »

I’m able to reproduce in the editor. This is a standard socket windows target.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: CreateRoomRequest Silently Fails

Post by Lapo »

ok, thanks we'll test it locally and see if we can reproduce the same issue.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Sbn
Posts: 26
Joined: 25 Nov 2014, 20:37

Re: CreateRoomRequest Silently Fails

Post by Sbn »

Ty. The strings in the string array are just uuids. The auto join flag is true in this scenario.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: CreateRoomRequest Silently Fails

Post by Lapo »

Thanks.
I've tested a similar scenario, with thousands of strings with len=36 which should be the size of an UUID.
No problems with 500 or 1000 strings but I got a client error at 5K saying:

Code: Select all

[SFS - WARN] Message size is too big: 190182, the server limit is: 150000
Which is expected as the server has a configured max size for incoming requests (Default is 500K), so I raised the 150K limit to 150MB and tested with 25K strings. No problems as well, although the client is a bit laggy in processing and serializing the request.

It doesn't seem an issue with the string array, from what I can see.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Sbn
Posts: 26
Joined: 25 Nov 2014, 20:37

Re: CreateRoomRequest Silently Fails

Post by Sbn »

Awesome news Ty. Is that in the client or server side that you can increase?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: CreateRoomRequest Silently Fails

Post by Lapo »

It's on the server side. Under config/core.xml
This must be edited manually and requires a restart. The param is called maxIncomingRequestSize
Lapo
--
gotoAndPlay()
...addicted to flash games
Sbn
Posts: 26
Joined: 25 Nov 2014, 20:37

Re: CreateRoomRequest Silently Fails

Post by Sbn »

Thanks.

A temporary solution while i change how users join. Ill have to split these messages up and either block the users from joining or just do a custom server side room creation call that waits for multiple packages before the room is fully created.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: CreateRoomRequest Silently Fails

Post by Lapo »

Did the change of the max packet size help?
Lapo
--
gotoAndPlay()
...addicted to flash games
Sbn
Posts: 26
Joined: 25 Nov 2014, 20:37

Re: CreateRoomRequest Silently Fails

Post by Sbn »

yea, that worked.

I'm not sure why I wasn't getting that error in the editor. I have it set to debug, but yea I must have a setting wrong. Ill have to look into that.


Thanks, again!
Post Reply