Page 1 of 1

CreateRoomRequest Silently Fails

Posted: 29 May 2023, 08:20
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));
}

Re: CreateRoomRequest Silently Fails

Posted: 29 May 2023, 08:49
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.

Re: CreateRoomRequest Silently Fails

Posted: 29 May 2023, 08:54
by Lapo
Hi,
is this reproducible in the Editor or only in the build?
Are you working with standard sockets or Websocket/WebGL?


Thanks

Re: CreateRoomRequest Silently Fails

Posted: 29 May 2023, 09:29
by Sbn
I’m able to reproduce in the editor. This is a standard socket windows target.

Re: CreateRoomRequest Silently Fails

Posted: 29 May 2023, 12:44
by Lapo
ok, thanks we'll test it locally and see if we can reproduce the same issue.

Cheers

Re: CreateRoomRequest Silently Fails

Posted: 29 May 2023, 14:00
by Sbn
Ty. The strings in the string array are just uuids. The auto join flag is true in this scenario.

Re: CreateRoomRequest Silently Fails

Posted: 29 May 2023, 14:54
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

Re: CreateRoomRequest Silently Fails

Posted: 29 May 2023, 17:07
by Sbn
Awesome news Ty. Is that in the client or server side that you can increase?

Re: CreateRoomRequest Silently Fails

Posted: 29 May 2023, 17:13
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

Re: CreateRoomRequest Silently Fails

Posted: 29 May 2023, 17:21
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.

Re: CreateRoomRequest Silently Fails

Posted: 30 May 2023, 06:25
by Lapo
Did the change of the max packet size help?

Re: CreateRoomRequest Silently Fails

Posted: 30 May 2023, 16:01
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!