Add Err to PeerMessageListener

This commit is contained in:
Sofia 2020-08-05 22:54:53 +03:00
parent 6bbd3bb121
commit 71fadf9fd4
3 changed files with 8 additions and 5 deletions

View File

@ -54,6 +54,9 @@ namespace NeonTea.Quakeball.Net {
Debug.Log(text);
}
public void Err(string text) {
Debug.Log(text);
}
}
}

View File

@ -53,10 +53,10 @@ namespace NeonTea.Quakeball.TeaNet.Peers {
if (Array.Exists(CONN_LOST_CODES, x => x == e.ErrorCode)) {
if (LastSentConnection != null) {
LastSentConnection.Status = ConnectionStatus.Lost;
Peer.MessageListener.Message($"Connection lost to {LastSentConnection.Endpoint}: {e.ToString()}");
Peer.MessageListener.Err($"Connection lost to {LastSentConnection.Endpoint}: {e.ToString()}");
}
} else {
Peer.MessageListener.Message($"Listener error: {e.ToString()}");
Peer.MessageListener.Err($"Listener error: {e.ToString()}");
}
}
if (Buffer.ReadFingerprint(Peer.Fingerprint)) {

View File

@ -94,9 +94,8 @@ namespace NeonTea.Quakeball.TeaNet.Peers {
return null;
}
public void Message(string msg) {
}
public void Message(string msg) { }
public void Err(string msg) { }
public IPAddress FindAddress(string host) {
IPAddress addr;
@ -111,5 +110,6 @@ namespace NeonTea.Quakeball.TeaNet.Peers {
public interface PeerMessageListener {
void Message(string msg);
void Err(string msg);
}
}