mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-26 06:35:49 +03:00
Update SteamNetworkingTest.cs
This commit is contained in:
parent
f191ee5e42
commit
b45ac59a21
@ -17,18 +17,14 @@ public class SteamNetworkingTest
|
||||
public async Task SendP2PPacket()
|
||||
{
|
||||
var sent = SteamNetworking.SendP2PPacket( SteamClient.SteamId, new byte[] { 1, 2, 3 } );
|
||||
|
||||
Assert.IsTrue( sent );
|
||||
|
||||
while ( SteamNetworking.IsP2PPacketAvailable() )
|
||||
while ( !SteamNetworking.IsP2PPacketAvailable() )
|
||||
{
|
||||
var packet = SteamNetworking.ReadP2PPacket();
|
||||
if ( packet.HasValue )
|
||||
{
|
||||
HandleMessageFrom( packet.Value.SteamId, packet.Value.Data );
|
||||
}
|
||||
await Task.Delay( 10 );
|
||||
}
|
||||
|
||||
var packet = SteamNetworking.ReadP2PPacket();
|
||||
|
||||
Assert.IsTrue( packet.HasValue );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user