Beispiel #1
0
 private void ReceivePacket(EndPoint endpoint, PacketType type, byte[] data)
 {
     if (nodes.ContainsKey(endpoint))
     {
         nodes[endpoint].ReceivePacket(type, data);
     }
     else if (acceptnewnodes)
     {
         Node node = new Node(this, endpoint);
         nodes.Add(endpoint, node);
         if (NodeAccepted != null)
         {
             NetNodeEventArgs e = new NetNodeEventArgs();
             e.Node = node;
             NodeAccepted(this, e);
         }
         node.ReceivePacket(type, data);
     }
 }
Beispiel #2
0
 private void HandleNodeAccepted(object sender, NetNodeEventArgs e)
 {
     nodes.Add(e.Node);
     e.Node.PacketReceived += HandleJoinPacket;
 }
Beispiel #3
0
 private void HandleNodeAccepted(object sender,NetNodeEventArgs e)
 {
     nodes.Add(e.Node);
     e.Node.PacketReceived += HandleJoinPacket;
 }
Beispiel #4
0
 private void ReceivePacket(EndPoint endpoint,PacketType type,byte[] data)
 {
     if (nodes.ContainsKey(endpoint))
     {
         nodes[endpoint].ReceivePacket(type,data);
     }
     else if (acceptnewnodes)
     {
         Node node = new Node(this,endpoint);
         nodes.Add(endpoint,node);
         if (NodeAccepted != null)
         {
             NetNodeEventArgs e = new NetNodeEventArgs();
             e.Node = node;
             NodeAccepted(this,e);
         }
         node.ReceivePacket(type,data);
     }
 }