Chat test

This commit is contained in:
Garry Newman 2019-05-01 16:34:46 +01:00
parent fbad8b8d6e
commit 362ba26729

View File

@ -67,6 +67,39 @@ public async Task CreateLobby()
lobby.SendChatString( "Hello I Love Lobbies" );
}
[TestMethod]
public async Task LobbyChat()
{
SteamMatchmaking.OnChatMessage += ( lbby, member, message ) =>
{
Console.WriteLine( $"[{lbby}] {member}: {message}" );
};
var lobbyr = await SteamMatchmaking.CreateLobbyAsync( 10 );
if ( !lobbyr.HasValue )
Assert.Fail();
var lobby = lobbyr.Value;
lobby.SetPublic();
lobby.SetData( "name", "Dave's Chat Room" );
Console.WriteLine( $"lobby: {lobby.Id}" );
lobby.SendChatString( "Hello Friends, It's me - your big fat daddy" );
await Task.Delay( 50 );
lobby.SendChatString( "What? No love for daddy?" );
await Task.Delay( 500 );
lobby.SendChatString( "Okay I will LEAVE" );
lobby.SendChatString( "BYE FOREVER" );
await Task.Delay( 1000 );
lobby.Leave();
}
}
}