mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-11 06:40:39 +00:00
RequestGameStateMessage: wait a bit before sending response to see if player has been kicked
This commit is contained in:
parent
85b232fd50
commit
630f311435
@ -386,6 +386,8 @@ namespace QSB.Menus
|
||||
|
||||
public void OnKicked(KickReason reason)
|
||||
{
|
||||
_intentionalDisconnect = true;
|
||||
|
||||
var text = reason switch
|
||||
{
|
||||
KickReason.QSBVersionNotMatching => "Server refused connection as QSB version does not match.",
|
||||
@ -408,8 +410,10 @@ namespace QSB.Menus
|
||||
|
||||
SetButtonActive(DisconnectButton, false);
|
||||
SetButtonActive(ConnectButton, true);
|
||||
SetButtonActive(HostButton, true);
|
||||
SetButtonActive(QuitButton, true);
|
||||
SetButtonActive(HostButton, true);
|
||||
SetButtonActive(ResumeGameButton, PlayerData.LoadLoopCount() > 1);
|
||||
SetButtonActive(NewGameButton, true);
|
||||
}
|
||||
|
||||
private void OnDisconnected(string error)
|
||||
|
@ -1,6 +1,8 @@
|
||||
using QSB.ConversationSync.Messages;
|
||||
using QSB.ConversationSync.Patches;
|
||||
using QSB.Messaging;
|
||||
using QSB.Player;
|
||||
using QSB.Utility;
|
||||
using System.Linq;
|
||||
|
||||
namespace QSB.SaveSync.Messages
|
||||
@ -12,8 +14,14 @@ namespace QSB.SaveSync.Messages
|
||||
{
|
||||
public RequestGameStateMessage() => To = 0;
|
||||
|
||||
public override void OnReceiveRemote()
|
||||
public override void OnReceiveRemote() => Delay.RunFramesLater(100, () =>
|
||||
{
|
||||
if (!QSBPlayerManager.PlayerExists(From))
|
||||
{
|
||||
// player was kicked
|
||||
return;
|
||||
}
|
||||
|
||||
new GameStateMessage(From).Send();
|
||||
|
||||
var gameSave = PlayerData._currentGameSave;
|
||||
@ -30,6 +38,6 @@ namespace QSB.SaveSync.Messages
|
||||
{
|
||||
new PersistentConditionMessage(item.Key, item.Value).Send();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user