mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
syntax
This commit is contained in:
parent
651020852b
commit
8338d02301
@ -370,9 +370,11 @@ public void Send_ClientToServerMessage_MaxMessageSize()
|
||||
NetworkServer.Listen(1);
|
||||
ConnectClientBlocking(out _);
|
||||
|
||||
// send message & process
|
||||
// calculate max := transport.max - message header
|
||||
int transportMax = transport.GetMaxPacketSize(Channels.Reliable);
|
||||
int messageMax = transportMax - MessagePacking.HeaderSize;
|
||||
|
||||
// send message & process
|
||||
NetworkClient.Send(new VariableSizedMessage(messageMax));
|
||||
ProcessMessages();
|
||||
|
||||
@ -392,9 +394,11 @@ public void Send_ServerToClientMessage_MaxMessageSize()
|
||||
NetworkServer.Listen(1);
|
||||
ConnectClientBlocking(out NetworkConnectionToClient connectionToClient);
|
||||
|
||||
// send message & process
|
||||
// calculate max := transport.max - message header
|
||||
int transportMax = transport.GetMaxPacketSize(Channels.Reliable);
|
||||
int messageMax = transportMax - MessagePacking.HeaderSize;
|
||||
|
||||
// send message & process
|
||||
connectionToClient.Send(new VariableSizedMessage(messageMax));
|
||||
ProcessMessages();
|
||||
|
||||
@ -414,9 +418,11 @@ public void Send_ClientToServerMessage_LargerThanMaxMessageSize()
|
||||
NetworkServer.Listen(1);
|
||||
ConnectClientBlocking(out _);
|
||||
|
||||
// send message & process
|
||||
// calculate max := transport.max - message header
|
||||
int transportMax = transport.GetMaxPacketSize(Channels.Reliable);
|
||||
int messageMax = transportMax - MessagePacking.HeaderSize;
|
||||
|
||||
// send message & process
|
||||
LogAssert.Expect(LogType.Error, $"NetworkConnection.ValidatePacketSize: cannot send packet larger than {transportMax} bytes, was {transportMax + 1} bytes");
|
||||
NetworkClient.Send(new VariableSizedMessage(messageMax + 1));
|
||||
ProcessMessages();
|
||||
@ -437,9 +443,11 @@ public void Send_ServerToClientMessage_LargerThanMaxMessageSize()
|
||||
NetworkServer.Listen(1);
|
||||
ConnectClientBlocking(out NetworkConnectionToClient connectionToClient);
|
||||
|
||||
// send message & process
|
||||
// calculate max := transport.max - message header
|
||||
int transportMax = transport.GetMaxPacketSize(Channels.Reliable);
|
||||
int messageMax = transportMax - MessagePacking.HeaderSize;
|
||||
|
||||
// send message & process
|
||||
LogAssert.Expect(LogType.Error, $"NetworkConnection.ValidatePacketSize: cannot send packet larger than {transportMax} bytes, was {transportMax + 1} bytes");
|
||||
connectionToClient.Send(new VariableSizedMessage(messageMax + 1));
|
||||
ProcessMessages();
|
||||
|
Loading…
Reference in New Issue
Block a user