FOnlineSessionNull FindSession MAX_PACKET_SIZE = 512

I’m using the FOnlineSessionNull to find sessions.

The problem is that I’m warned about LAN broadcast packet overflow, cannot broadcast on LAN
which is due to Packet.HasOverflow()

In

void FOnlineSessionNull::OnValidQueryPacketReceived(uint8* PacketData, int32 PacketLength, uint64 ClientNonce)
{

you have a check for packet overflow

				// Broadcast this response so the client can see us
				if (!Packet.HasOverflow())
				{
					LANSessionManager.BroadcastPacket(Packet, Packet.GetByteCount());
				}
				else
				{
					UE_LOG_ONLINE(Warning, TEXT("LAN broadcast packet overflow, cannot broadcast on LAN"));
				}

The packet size is initialized in

uint32 FOnlineSessionNull::FindLANSession()
{
FNboSerializeToBufferNull Packet(LAN_BEACON_MAX_PACKET_SIZE);
LANSessionManager.CreateClientQueryPacket(Packet, LANSessionManager.LanNonce);

Questions :

  • Why the packet is limited to 512 ?
  • Where can I change the size of the buffer for packet ?
  • The log message does not correspond to the error kind. “Packet overflow” will be more adequate.

D.

The only way I found was to change code source and change the LAN_BEACON_MAX_PACKET_SIZE to 1024.
I would like to avoid changing the ue4 code source.

Forget the last comment about the message log. It is correct in fact.

D.

Packet size is probably limited to stop any fragmentation when passing through (older) routers (almost guaranteed atomic send once).

512 is ‘a lot’. Have you considered reducing the size of variable names in the packet? Generally should be able to get away with distinct 2 or 3 letter prefixes for variable in the packet aliased back to full name in code (define or const)…

Yes I’ve tried. I remove all prefixes but it represents more. I’ve changed the enum to fill my needs. For curiosity, I’ve checked the code of Unreal Tournament and they set the packet size to 1024.

In 4.11 the size has been set to 1024.
Txs.