lnobad / lidgren-network-gen3

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

Approve messages not received properly #66

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.  Connect to a peer with ConnectionApproval message enabled, with 
netClient.Connect("127.0.0.1", 14242);
2.  Have the peer approve the connection, and send a message too, with 
connection.Approve(outgoingMessage);
3.  Wait for the client to recieve the message.

What is the expected output? What do you see instead?

The message is never received.

What version of the product are you using? On what operating system?

lidgren-network-gen3-2011-03-12

Please provide any additional information below.

Looking at the code it turns out the message is sent, but it is discarded by 
the receiving peer.

The offending code is in NetConnection.ReceivedHandshake, in the 
ConnectResponse branch, the message is received and stored in 
m_remoteHailMessage, but nothing is done with it. I fixed it for my case with 
m_peer.ReleaseMessage(m_remoteHailMessage); after line 319. Not totally sure if 
I'm doing something wrong as I've only just picked up lidgren, but it's 
certainly not obvious.

Original issue reported on code.google.com by appleche...@gmail.com on 4 Apr 2011 at 6:03

GoogleCodeExporter commented 9 years ago
The problem is one of documentation. Your hail message is available in 
NetConnection.RemoteHailMessage right after you receive your status change.
I'm not really happy with this construct since, as you say, it's not really 
intuitive. However, it'll have to do for now.

Original comment by lidg...@gmail.com on 4 Apr 2011 at 6:10

GoogleCodeExporter commented 9 years ago
Ahhhh, I got it now. Thanks for the quick follow up!

Original comment by appleche...@gmail.com on 4 Apr 2011 at 7:59