mirror of
https://gitlab.com/Syroot/Worms.git
synced 2025-01-13 15:27:59 +03:00
Try to fix failing connects.
This commit is contained in:
parent
1b527a3f20
commit
e9c88caadc
@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua;
|
using Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua;
|
||||||
using Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua.Server;
|
using Syroot.Worms.Mgame.GameServer.Packets.WorldPartyAqua.Server;
|
||||||
|
|
||||||
@ -6,6 +7,10 @@ namespace Syroot.Worms.Mgame.GameServer
|
|||||||
{
|
{
|
||||||
internal partial class Client
|
internal partial class Client
|
||||||
{
|
{
|
||||||
|
// ---- FIELDS -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private int _sendConnectTries;
|
||||||
|
|
||||||
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
|
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
|
||||||
|
|
||||||
public void HandleWwpaServerChannelList(ChannelListQuery packet)
|
public void HandleWwpaServerChannelList(ChannelListQuery packet)
|
||||||
@ -81,16 +86,23 @@ namespace Syroot.Worms.Mgame.GameServer
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleWwpaServerConnect(ConnectQuery packet)
|
public async void HandleWwpaServerConnect(ConnectQuery packet)
|
||||||
{
|
{
|
||||||
// Client fails to detect reply at rare times due to unknown reasons.
|
// Client fails to detect reply at rare times due to unknown reasons. Resend packet some times.
|
||||||
SendPacket(new ConnectReply { ServerVersion = _server.Config.Version });
|
ConnectReply reply = new ConnectReply { ServerVersion = _server.Config.Version };
|
||||||
|
_sendConnectTries = 10;
|
||||||
|
while (_sendConnectTries-- > 0)
|
||||||
|
{
|
||||||
|
SendPacket(reply);
|
||||||
|
await Task.Delay(500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleWwpaServerDisconnect(DisconnectNotice packet) { }
|
public void HandleWwpaServerDisconnect(DisconnectNotice packet) { }
|
||||||
|
|
||||||
public void HandleWwpaServerLogin(LoginQuery packet)
|
public void HandleWwpaServerLogin(LoginQuery packet)
|
||||||
{
|
{
|
||||||
|
_sendConnectTries = 0;
|
||||||
SendPacket(new LoginReply { Result = LoginResult.Success });
|
SendPacket(new LoginReply { Result = LoginResult.Success });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user