Change Connect method
This commit is contained in:
parent
d26ed426cf
commit
ada3f4bafd
@ -50,9 +50,11 @@ namespace NeonTea.Quakeball.TeaNet.Peers {
|
||||
MessageListener.Message($"Started listening to {endpoint}");
|
||||
}
|
||||
|
||||
public void Connect(string address, int port, byte protocolIdent) {
|
||||
IPEndPoint listenEndpoint = (IPEndPoint)UdpClient.Client.LocalEndPoint;
|
||||
StartListen(listenEndpoint);
|
||||
public void Connect(string address, int port, byte protocolIdent, bool startListening = true) {
|
||||
if (startListening) {
|
||||
IPEndPoint listenEndpoint = (IPEndPoint)UdpClient.Client.LocalEndPoint;
|
||||
StartListen(listenEndpoint);
|
||||
}
|
||||
IPEndPoint endpoint = new IPEndPoint(FindAddress(address), port);
|
||||
ConnectionManager.StartConnection(endpoint, protocolIdent);
|
||||
MessageListener.Message($"Connecting to {endpoint}");
|
||||
|
Loading…
Reference in New Issue
Block a user