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}");
|
MessageListener.Message($"Started listening to {endpoint}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Connect(string address, int port, byte protocolIdent) {
|
public void Connect(string address, int port, byte protocolIdent, bool startListening = true) {
|
||||||
|
if (startListening) {
|
||||||
IPEndPoint listenEndpoint = (IPEndPoint)UdpClient.Client.LocalEndPoint;
|
IPEndPoint listenEndpoint = (IPEndPoint)UdpClient.Client.LocalEndPoint;
|
||||||
StartListen(listenEndpoint);
|
StartListen(listenEndpoint);
|
||||||
|
}
|
||||||
IPEndPoint endpoint = new IPEndPoint(FindAddress(address), port);
|
IPEndPoint endpoint = new IPEndPoint(FindAddress(address), port);
|
||||||
ConnectionManager.StartConnection(endpoint, protocolIdent);
|
ConnectionManager.StartConnection(endpoint, protocolIdent);
|
||||||
MessageListener.Message($"Connecting to {endpoint}");
|
MessageListener.Message($"Connecting to {endpoint}");
|
||||||
|
Loading…
Reference in New Issue
Block a user