1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 23:26:32 +09:00

Changed all Endpoint to EndPoint for consistency

This commit is contained in:
lidgren
2012-07-06 21:28:13 +00:00
parent b49392182b
commit 1ecf9fd8b8
19 changed files with 101 additions and 102 deletions

View File

@@ -48,8 +48,8 @@ namespace Lidgren.Network
NetIncomingMessage tmp = SetupReadHelperMessage(ptr, 1000); // never mind length
byte hostByte = tmp.ReadByte();
IPEndPoint remoteInternal = tmp.ReadIPEndpoint();
IPEndPoint remoteExternal = tmp.ReadIPEndpoint();
IPEndPoint remoteInternal = tmp.ReadIPEndPoint();
IPEndPoint remoteExternal = tmp.ReadIPEndPoint();
string token = tmp.ReadString();
bool isHost = (hostByte != 0);
@@ -78,7 +78,7 @@ namespace Lidgren.Network
/// <summary>
/// Called when receiving a NatPunchMessage from a remote endpoint
/// </summary>
private void HandleNatPunch(int ptr, IPEndPoint senderEndpoint)
private void HandleNatPunch(int ptr, IPEndPoint senderEndPoint)
{
NetIncomingMessage tmp = SetupReadHelperMessage(ptr, 1000); // never mind length
@@ -86,18 +86,18 @@ namespace Lidgren.Network
if (fromHostByte == 0)
{
// it's from client
LogDebug("NAT punch received from " + senderEndpoint + " we're host, so we ignore this");
LogDebug("NAT punch received from " + senderEndPoint + " we're host, so we ignore this");
return; // don't alert hosts about nat punch successes; only clients
}
string token = tmp.ReadString();
LogDebug("NAT punch received from " + senderEndpoint + " we're client, so we've succeeded - token is " + token);
LogDebug("NAT punch received from " + senderEndPoint + " we're client, so we've succeeded - token is " + token);
//
// Release punch success to client; enabling him to Connect() to msg.SenderIPEndPoint if token is ok
//
NetIncomingMessage punchSuccess = CreateIncomingMessage(NetIncomingMessageType.NatIntroductionSuccess, 10);
punchSuccess.m_senderEndpoint = senderEndpoint;
punchSuccess.m_senderEndPoint = senderEndPoint;
punchSuccess.Write(token);
ReleaseMessage(punchSuccess);
}