1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-17 15:46:33 +09:00

Sequence numbers now stored in dictionary per connection to enable sending the same message reliable ordered message to several connections

This commit is contained in:
lidgren
2010-05-20 18:36:19 +00:00
parent 00edeaabf4
commit 046ca06ec6
11 changed files with 84 additions and 79 deletions

View File

@@ -27,7 +27,8 @@ namespace ChatClient
Application.SetCompatibleTextRenderingDefault(false);
MainForm = new Form1();
Client = new NetClient(new NetPeerConfiguration("Chat"));
NetPeerConfiguration config = new NetPeerConfiguration("Chat");
Client = new NetClient(config);
Client.Start();
Display("Type 'connect <host>' to connect to a server");

View File

@@ -80,7 +80,7 @@ namespace ChatServer
om.WriteAllProperties(cm, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
Display("Forwarding text from " + cm.Sender + " to all clients: " + cm.Text);
Server.SendMessage(om, Server.Connections, NetDeliveryMethod.ReliableUnordered, 0);
Server.SendMessage(om, Server.Connections, NetDeliveryMethod.ReliableOrdered, 0);
break;
}

View File

@@ -118,7 +118,7 @@ namespace ImageServer
// send entire as a large message that will be automatically fragmented by the library
om.Write(ImageData);
Server.SendMessage(om, inc.SenderConnection, NetDeliveryMethod.ReliableUnordered, 0);
Server.SendMessage(om, inc.SenderConnection, NetDeliveryMethod.ReliableOrdered, 0);
// all messages will be sent before disconnect so we can call it here
// inc.SenderConnection.Disconnect("Bye bye now");