1
0
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:
lidgren
2010-11-21 20:53:32 +00:00
parent 07695e0ba9
commit 3103892362
3 changed files with 17 additions and 4 deletions

View File

@@ -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")