s25client icon indicating copy to clipboard operation
s25client copied to clipboard

Direct IP and passwords

Open Spikeone opened this issue 6 years ago • 2 comments

When you open a direct IP game with a password and try to join without entering one, you get a message "connection to host lost". Which is simply incorrect as it has been refused as you entered no / wrong password.

Spikeone avatar Mar 28 '19 20:03 Spikeone

Well, I think the problem is that the connection is dropped by the host before sending the message to the client. Perhaps we can hold the connection a bit longer until deletion, or something like that.

Flow86 avatar Mar 28 '19 20:03 Flow86

You are right. The problem is: The host sends a "invalid pw" message and closes the connection. Although the message is posted (flushed) the connection is closes at the same time. So either

  1. The message is still received but the connection lost gets checked before
  2. The message is not sent if the connection gets closed before

I'm not sure how to check this especially as it is much less likely to occur using 2 game clients locally. :/

Perhaps we can hold the connection a bit longer until deletion

Possible. But how much longer? And this would complicate the code... Probably wait till we use Boost.ASIO

Flamefire avatar Mar 29 '19 08:03 Flamefire