Skip to content

Commit

Permalink
fix spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
RevenantX committed Aug 2, 2024
1 parent 76f91b5 commit 9e36a8e
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions LiteNetLib/NetManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -708,27 +708,27 @@ internal NetPeer OnConnectionSolved(ConnectionRequest request, byte[] rejectData
_requestsDict.Remove(request.RemoteEndPoint);
}
else lock (_requestsDict)
{
if (TryGetPeer(request.RemoteEndPoint, out netPeer))
{
if (TryGetPeer(request.RemoteEndPoint, out netPeer))
{
//already have peer
}
else if (request.Result == ConnectionRequestResult.Reject)
{
netPeer = new NetPeer(this, request.RemoteEndPoint, GetNextPeerId());
netPeer.Reject(request.InternalPacket, rejectData, start, length);
AddPeer(netPeer);
NetDebug.Write(NetLogLevel.Trace, "[NM] Peer connect reject.");
}
else //Accept
{
netPeer = new NetPeer(this, request, GetNextPeerId());
AddPeer(netPeer);
CreateEvent(NetEvent.EType.Connect, netPeer);
NetDebug.Write(NetLogLevel.Trace, $"[NM] Received peer connection Id: {netPeer.ConnectTime}, EP: {netPeer}");
}
_requestsDict.Remove(request.RemoteEndPoint);
//already have peer
}
else if (request.Result == ConnectionRequestResult.Reject)
{
netPeer = new NetPeer(this, request.RemoteEndPoint, GetNextPeerId());
netPeer.Reject(request.InternalPacket, rejectData, start, length);
AddPeer(netPeer);
NetDebug.Write(NetLogLevel.Trace, "[NM] Peer connect reject.");
}
else //Accept
{
netPeer = new NetPeer(this, request, GetNextPeerId());
AddPeer(netPeer);
CreateEvent(NetEvent.EType.Connect, netPeer);
NetDebug.Write(NetLogLevel.Trace, $"[NM] Received peer connection Id: {netPeer.ConnectTime}, EP: {netPeer}");
}
_requestsDict.Remove(request.RemoteEndPoint);
}

return netPeer;
}
Expand Down

0 comments on commit 9e36a8e

Please sign in to comment.