You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-06 02:11:06 +09:00
Added bool ReadMessage(out NetIncomingMessage message)
Added `bool ReadMessage(out NetIncomingMessage message)` for simplifying cases like this:
NetIncomingMessage msg;
while ((msg = NetClient.ReadMessage()) != null) { }
**into this**:
NetIncomingMessage msg;
while (NetClient.ReadMessage(out msg)) { }
This commit is contained in:
@@ -215,6 +215,17 @@ namespace Lidgren.Network
|
|||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reads a pending message from any connection, if any.
|
||||||
|
/// Returns true if message was read, otherwise false.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>True, if message was read.</returns>
|
||||||
|
public bool ReadMessage(out NetIncomingMessage message)
|
||||||
|
{
|
||||||
|
message = ReadMessage();
|
||||||
|
return message != null;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Read a pending message from any connection, if any
|
/// Read a pending message from any connection, if any
|
||||||
|
|||||||
Reference in New Issue
Block a user