KalebDark / lidgren-network-gen3

Automatically exported from code.google.com/p/lidgren-network-gen3
0 stars 0 forks source link

NetConnection.SendConnectReponse and m_remoteUniqueIdentifier #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Is there any reason why NetConnection.SendConnectReponse doesn't use 
m_remoteUniqueIdentifier in the response for a better handshake check ?

internal void SendConnectResponse()
{
  ...
  reply.Write(m_remoteUniqueIdentifier);
  ..
}

And then check in the NetPeer.Internal when ConnectResponse comes not only for 
sender but with the uniqueId too.

Also NetConnection.m_remoteUniqueIdentifier is initialized only in server side 
when NetMessageLibraryType.Connect message is received but not for client side 
in Connect method.

NetPeer.Connect method can initialize NetConnection:
public virtual NetConnection Connect(...)
{
 ...
 conn.m_remoteUniqueIdentifier = m_uniqueIdentifier;
 m_connections.Add(conn);
 ...
}

Otherwise I don't see the need of unique identifier in the connection.

Original issue reported on code.google.com by NN1436401@gmail.com on 17 Aug 2010 at 1:42

GoogleCodeExporter commented 9 years ago
i would recommend the sendmessage method should takes the 
RemoteUniqueIdentifier as a parameter instead of netpeerconnection

Original comment by kam8691@gmail.com on 8 Jan 2012 at 8:01