Skip to content

Commit

Permalink
fix: Fixed example project
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoTenPvP committed Feb 14, 2020
1 parent 157bdc6 commit 5c288d0
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Ruffles.Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,24 @@ public static void Main(string[] args)

if (serverEvent.Type != NetworkEventType.Nothing)
{
if (serverEvent.Type != NetworkEventType.Data)
{
Console.WriteLine("ServerEvent: " + serverEvent.Type);
}
Console.WriteLine("ServerEvent: " + serverEvent.Type);

if (serverEvent.Type == NetworkEventType.Connect)
{
clientConnection = serverEvent.Connection;
}

if (serverEvent.Type == NetworkEventType.AckNotification)
{
Console.WriteLine("The remote acked message id: " + serverEvent.NotificationKey);
}
}

serverEvent.Recycle();

if (clientEvent.Type != NetworkEventType.Nothing)
{
if (clientEvent.Type != NetworkEventType.Data)
{
Console.WriteLine("ClientEvent: " + clientEvent.Type);
}
Console.WriteLine("ClientEvent: " + clientEvent.Type);

if (clientEvent.Type == NetworkEventType.Connect)
{
Expand All @@ -133,7 +132,7 @@ public static void Main(string[] args)
if (serverConnection != null && clientConnection != null && serverConnection.State == ConnectionState.Connected && clientConnection.State == ConnectionState.Connected && (DateTime.Now - lastSent).TotalSeconds >= (1f / 1))
{
byte[] helloReliable = Encoding.ASCII.GetBytes("This message was sent over a reliable channel" + messageCounter);
clientConnection.Send(new ArraySegment<byte>(helloReliable, 0, helloReliable.Length), 1, false);
clientConnection.Send(new ArraySegment<byte>(helloReliable, 0, helloReliable.Length), 1, false, (ulong)messageCounter);
Console.WriteLine("Sending packet: " + messageCounter);

messageCounter++;
Expand Down

0 comments on commit 5c288d0

Please sign in to comment.