You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-15 06:36:30 +09:00
DurableSample altered to use DiscoverKnownPeer
This commit is contained in:
@@ -24,6 +24,7 @@ namespace DurableServer
|
||||
NetPeerConfiguration config = new NetPeerConfiguration("durable");
|
||||
config.Port = 14242;
|
||||
config.EnableMessageType(NetIncomingMessageType.ConnectionApproval);
|
||||
config.EnableMessageType(NetIncomingMessageType.DiscoveryRequest);
|
||||
Server = new NetServer(config);
|
||||
Server.Start();
|
||||
|
||||
@@ -72,6 +73,10 @@ namespace DurableServer
|
||||
case NetIncomingMessageType.ErrorMessage:
|
||||
Display(msg.ReadString());
|
||||
break;
|
||||
case NetIncomingMessageType.DiscoveryRequest:
|
||||
// just send a no-info response
|
||||
Server.SendDiscoveryResponse(null, msg.SenderEndpoint);
|
||||
break;
|
||||
case NetIncomingMessageType.ConnectionApproval:
|
||||
string ok = msg.ReadString();
|
||||
if (ok == "durableschmurable")
|
||||
|
||||
Reference in New Issue
Block a user