mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-03 17:38:30 +00:00
Merge pull request #444 from misternebula/refuse-connection-in-eye
Refuse connection in eye
This commit is contained in:
commit
acd2ff486f
@ -328,6 +328,7 @@ namespace QSB.Menus
|
||||
KickReason.GameVersionNotMatching => "Server refused connection as Outer Wilds version does not match.",
|
||||
KickReason.GamePlatformNotMatching => "Server refused connection as Outer Wilds platform does not match. (Steam/Epic)",
|
||||
KickReason.DLCNotMatching => "Server refused connection as DLC installation state does not match.",
|
||||
KickReason.InEye => "Server refused connection as game has progressed too far.",
|
||||
KickReason.None => "Kicked from server. No reason given.",
|
||||
_ => $"Kicked from server. KickReason:{reason}",
|
||||
};
|
||||
|
@ -6,6 +6,7 @@
|
||||
QSBVersionNotMatching,
|
||||
GameVersionNotMatching,
|
||||
GamePlatformNotMatching,
|
||||
DLCNotMatching
|
||||
DLCNotMatching,
|
||||
InEye
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
using QSB.Messaging;
|
||||
using QSB.Utility;
|
||||
using QuantumUNET.Transport;
|
||||
using System.Linq;
|
||||
|
||||
namespace QSB.Player.Messages
|
||||
{
|
||||
@ -44,43 +45,41 @@ namespace QSB.Player.Messages
|
||||
|
||||
public override void OnReceiveRemote()
|
||||
{
|
||||
if (QSBVersion != QSBCore.QSBVersion)
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
if (QSBCore.IsHost)
|
||||
if (QSBVersion != QSBCore.QSBVersion)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Client {PlayerName} connecting with wrong QSB version. (Client:{QSBVersion}, Server:{QSBCore.QSBVersion})", MessageType.Error);
|
||||
new PlayerKickMessage(From, KickReason.QSBVersionNotMatching).Send();
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (GameVersion != QSBCore.GameVersion)
|
||||
{
|
||||
if (QSBCore.IsHost)
|
||||
if (GameVersion != QSBCore.GameVersion)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Client {PlayerName} connecting with wrong game version. (Client:{GameVersion}, Server:{QSBCore.GameVersion})", MessageType.Error);
|
||||
new PlayerKickMessage(From, KickReason.GameVersionNotMatching).Send();
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (Platform != QSBCore.Platform)
|
||||
{
|
||||
if (QSBCore.IsHost)
|
||||
if (Platform != QSBCore.Platform)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Client {PlayerName} connecting with wrong game platform. (Client:{Platform}, Server:{QSBCore.Platform})", MessageType.Error);
|
||||
new PlayerKickMessage(From, KickReason.DLCNotMatching).Send();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (DlcInstalled != QSBCore.DLCInstalled)
|
||||
{
|
||||
if (QSBCore.IsHost)
|
||||
if (DlcInstalled != QSBCore.DLCInstalled)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Client {PlayerName} connecting with wrong DLC installation state. (Client:{DlcInstalled}, Server:{QSBCore.DLCInstalled})", MessageType.Error);
|
||||
new PlayerKickMessage(From, KickReason.GamePlatformNotMatching).Send();
|
||||
return;
|
||||
}
|
||||
|
||||
if (QSBPlayerManager.PlayerList.Any(x => x.EyeState > EyeState.WarpedToSurface))
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Client {PlayerName} connecting too late into eye scene.", MessageType.Error);
|
||||
new PlayerKickMessage(From, KickReason.InEye).Send();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user