You've already forked lidgren-network-gen3
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:
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user