private void UDPMessageReceived(object sender, UDPNetworking.MessageRecievedEventArgs e) { if (e.message == "connectionrequest") { uDPNetworking.UDPSend(e.ipAddress, 14999, "connectionaccepted" + "_" + NetworkUtil.GetMachineName()); } }
private void UDPMessageReceived(object sender, UDPNetworking.MessageRecievedEventArgs e) { if (e.message.Contains("connectionaccepted")) { string[] messages = e.message.Split('_'); servername = messages[1]; serverip = e.ipAddress; Console.Out.WriteLine("[Client] ServerFound!"); Console.Out.WriteLine("[Client] Setting IPAddress: " + e.ipAddress + " as Server Address"); Console.Out.WriteLine("[Client] Name of the server is: " + servername); ServerFound(this, new EventArgs()); } }