Update SteamNetworkingTest.cs

This commit is contained in:
Garry Newman 2020-02-25 12:33:16 +00:00
parent f191ee5e42
commit b45ac59a21

View File

@ -17,18 +17,14 @@ public class SteamNetworkingTest
public async Task SendP2PPacket() public async Task SendP2PPacket()
{ {
var sent = SteamNetworking.SendP2PPacket( SteamClient.SteamId, new byte[] { 1, 2, 3 } ); var sent = SteamNetworking.SendP2PPacket( SteamClient.SteamId, new byte[] { 1, 2, 3 } );
Assert.IsTrue( sent ); Assert.IsTrue( sent );
while ( SteamNetworking.IsP2PPacketAvailable() ) while ( !SteamNetworking.IsP2PPacketAvailable() )
{ {
var packet = SteamNetworking.ReadP2PPacket(); await Task.Delay( 10 );
if ( packet.HasValue )
{
HandleMessageFrom( packet.Value.SteamId, packet.Value.Data );
}
} }
var packet = SteamNetworking.ReadP2PPacket();
Assert.IsTrue( packet.HasValue ); Assert.IsTrue( packet.HasValue );