Lidgren Library "Deny" connection message



  • Does anyone here have experience with the Lidgren UDP library for .NET? There's a way for the server to deny a new connection and include a status message, in my case I'm trying to use "Invalid Login Credentials". I have not found a reliable way to detect the deny on the client end, I'm able to catch it sometimes but when I see the status message, it's corrupted, usually it's truncated and sometimes has random non-alphanumeric characters at the start.

    Documentation is very sparse. https://code.google.com/p/lidgren-network-gen3/w/list is everything and https://code.google.com/p/lidgren-network-gen3/wiki/ConnectionApproval talks about the connection approval mechanism but only discusses things from the server side!

    I've cross-posted the issue over at the game development StackExchange, http://gamedev.stackexchange.com/questions/75636/how-to-i-access-deny-message-from-a-lidgren-client and I can't resist a little StackExchange jab here. I was unable to create the question using the "Lidgren" tag because I don't have enough reputation. WTF?? 👅 So now my question isn't really properly tagged and my reputation is low because I don't spend much time on StackExchanges.

    I have a backup plan but it's a minor WTF of its own. I can approve the connection, send a Data message to the client stating "Connection Disapproved - Bad Login" or whatever, and then kill the connection. I have no trouble sending or receiving Data messages. But I'd rather use the library feature which supposedly does exactly what I want...assuming it even works.



  • I went ahead and implemented my own "Approved" and "Deny" messages, it was easier and quicker than finding correct documentation or finding another programmer who has used Lidgren's built-in feature.



  • I believe the way that Minecraft handles this is to send a Kick packet, including a message, during the handshake and close the connection. Of course, the Minecraft code has way too many WTFs to count out here, so take that with a grain of salt...


  • Discourse touched me in a no-no place

    @mott555 said:

    I was unable to create the question using the "Lidgren" tag because I don't have enough reputation. WTF?? 👅 So now my question isn't really properly tagged and my reputation is low because I don't spend much time on StackExchanges.

    Write a comment on your post that says that you want to tag it with lidgren but can't, or (even better) flag it for moderator attention. Someone with more rep will (eventually) sort it out for you.

    Tag creation is restricted to higher-rep users to encourage people to reuse existing tags rather than abusing them like we used to back over on CS…


  • Winner of the 2016 Presidential Election

    @dkf said:

    Tag creation is restricted to higher-rep users to encourage people to reuse existing tags rather than abusing them like we used to back over on CS…

    Wait, you can reuse tags?


  • Discourse touched me in a no-no place

    @error said:

    Wait, you can reuse tags?

    It's a Stack Exchange thing. 😉


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.