-
Notifications
You must be signed in to change notification settings - Fork 464
Closed
Labels
priority:lowThis issue has low priority and will take some time to be resolvedThis issue has low priority and will take some time to be resolvedstat:importedStatus - Issue is tracked internally at UnityStatus - Issue is tracked internally at Unitytype:bugBug ReportBug Report
Description
Description
This bug is about Custom Messages.
When trying to send a byte[] Using SendNamedMessage you get a "Write past end of buffer error"
Reproduce Steps
- Write a script that sends a simple byte[] to a client.
- The FastBufferArray will write perfectly fine, but The SendNamedMessage will get an "Write past end of buffer error";
Actual Outcome
SendNamedMessage with a byte[] will give an error
Expected Outcome
The written FastBufferArray will be send without issue
My code:
public void SendChunkMessage(byte[] messageContent, ulong clientID)
{
int writeSize = FastBufferWriter.GetWriteSize(messageContent);
FastBufferWriter writer = new FastBufferWriter(writeSize, Allocator.Temp);
CustomMessagingManager customMessagingManager = NetworkManager.CustomMessagingManager;
using (writer)
{
writer.TryBeginWrite(writeSize);
writer.WriteBytes(messageContent, writeSize, 0);
Debug.Log("Written to FastBufferWriter");
if (IsServer)
{
customMessagingManager.SendNamedMessage("Chunk", clientID, writer);
}
}
Debug.Log("Send to client");
}
Environment
- OS: Windows 10 pro
- Unity Version: 2022.2.0b16
- Netcode Version: 1.1.0
Metadata
Metadata
Assignees
Labels
priority:lowThis issue has low priority and will take some time to be resolvedThis issue has low priority and will take some time to be resolvedstat:importedStatus - Issue is tracked internally at UnityStatus - Issue is tracked internally at Unitytype:bugBug ReportBug Report
