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); } }
private void HandleNodeAccepted(object sender, NetNodeEventArgs e) { nodes.Add(e.Node); e.Node.PacketReceived += HandleJoinPacket; }
private void HandleNodeAccepted(object sender,NetNodeEventArgs e) { nodes.Add(e.Node); e.Node.PacketReceived += HandleJoinPacket; }
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); } }