]> git.deb.at Git - rhonda/impostor.git/commitdiff
Add compatibility option to allow host authority
authorminiduikboot <mini@duikbo.at>
Tue, 9 Jul 2024 20:41:27 +0000 (22:41 +0200)
committerminiduikboot <mini@duikbo.at>
Sat, 27 Jul 2024 16:49:04 +0000 (18:49 +0200)
There are various bugs in the 2024.6.18 implementation of host-authoritive
multiplayer such that I can't recommend players to use it. Fixing these
issues on the server side is impossible, and I can't smell remotely if
clients have applied the necessary fixes. The currently known bugs
include at least:

- Unable to join more than 8 players in a room
- Unable for new players to join if host switched from host authoritive
  to server authoritive
- Host is unable to kill if it is in a host authoritive game while it
  thinks it is in server authoritive mode

If Innersloth fixes this mode in future game patches, this option may be
reconsidered.

docs/Server-configuration.md
src/Impostor.Api/Config/CompatibilityConfig.cs
src/Impostor.Api/Config/DisconnectMessages.cs
src/Impostor.Server/Net/Manager/ClientManager.cs
src/Impostor.Server/full-config-example.json

index 5a9a4eb08705a50e0676f3d830fafb6f4642fc84..2dd1b9059e30256dd6389ed4e203f3cc52930657 100644 (file)
@@ -43,12 +43,13 @@ Impostor has an Anticheat that makes it possible to kick cheaters from games aut
 
 ### Compatibility
 
-Impostor has two compatibility options which allow some extra flexibility but may not work properly. Enabling either of these options is not recommended.
+Impostor has some compatibility options which allow some extra flexibility but may not work properly. Enabling any of these options is not recommended. When contacting support, please mention which of these options are enabled.
 
-| Key                      | Default | Value                                                                                                                                                                          |
-| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| **AllowNewGameVersions** | `false` | Warning: Setting this option to `true` is unsupported and may cause issues when large updates to Among Us are released. Allow future versions of Among Us to join your server. |
-| **AllowVersionMixing**   | `false` | Allow players using different game versions to play in one lobby.                                                                                                              |
+| Key                         | Default | Value                                                                                                                                                                                                                                                            |
+|-----------------------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **AllowFutureGameVersions** | `false` | Warning: Setting this option to `true` is unsupported and may cause issues when large updates to Among Us are released, but can be useful when a small patch is released. Allows future versions of Among Us to join your server.                                |
+| **AllowHostAuthority**      | `false` | Certain Among Us mods allow disabling some server-authoritative features, which also changes some code paths in the client. These code paths have not undergone as much testing and contain bugs, which can't be fixed from the Impostor side. Use with caution. |
+| **AllowVersionMixing**      | `false` | Allows players using different game versions to play in one lobby that have not been marked by the Impostor developers as compatible.                                                                                                                            |
 
 ### Debug
 
index c18c7d8bd65b230f4fe19a8ac0ded4e60c47f4ca..650d33dbb0e05b068f681e34b4129970896267b6 100644 (file)
@@ -6,6 +6,8 @@ namespace Impostor.Api.Config
 
         public bool AllowFutureGameVersions { get; set; } = false;
 
+        public bool AllowHostAuthority { get; set; } = false;
+
         public bool AllowVersionMixing { get; set; } = false;
     }
 }
index e722f32143f151145c142ed4876da081b9d6a4cf..47438785385778e91ae9113e496fea63cdf7df1b 100644 (file)
@@ -30,5 +30,7 @@
                                                         Sorry, UDP Matchmaking is no longer supported.
                                                         See <link={UpgradingDocsLink}#impostor-190>Impostor documentation</link> on how to migrate to HTTP Matchmaking
                                                         """;
+
+        public const string HostAuthorityUnsupported = "Your client is requesting host authority, which is not enabled on this Impostor server.";
     }
 }
index 772840a7d2e9ceab36379ee448ecdca114f347af..aa477e54b3e50e04ab8c908b95e0bc2feeeafb33 100644 (file)
@@ -34,6 +34,28 @@ namespace Impostor.Server.Net.Manager
             _clients = new ConcurrentDictionary<int, ClientBase>();
             _compatibilityManager = compatibilityManager;
             _compatibilityConfig = compatibilityConfig.Value;
+
+            if (_compatibilityConfig.AllowFutureGameVersions
+                || _compatibilityConfig.AllowHostAuthority
+                || _compatibilityConfig.AllowVersionMixing)
+            {
+                _logger.LogWarning("One or more compatibility options were enabled, please mention these when seeking support:");
+
+                if (_compatibilityConfig.AllowFutureGameVersions)
+                {
+                    _logger.LogWarning("AllowFutureGameVersions, which allows future Among Us versions to connect that were unknown at the time this Impostor was built");
+                }
+
+                if (_compatibilityConfig.AllowHostAuthority)
+                {
+                    _logger.LogWarning("AllowHostAuthority, which allows game hosts to control more game features, but it uses less well tested code on the client, which causes some bugs");
+                }
+
+                if (_compatibilityConfig.AllowVersionMixing)
+                {
+                    _logger.LogWarning("AllowVersionMixing, which allows players to join games created on different game versions that they may not be 100% compatible with");
+                }
+            }
         }
 
         public IEnumerable<ClientBase> Clients => _clients.Values;
@@ -79,6 +101,20 @@ namespace Impostor.Server.Net.Manager
                 return;
             }
 
+            // Warn when players connect using the +25 flag that disables server authority. The host authority version
+            // of 2024.6.18 contains various bugs that break the game, so print a message if this mode is in use
+            if (clientVersion.HasDisableServerAuthorityFlag)
+            {
+                if (!_compatibilityConfig.AllowHostAuthority)
+                {
+                    _logger.LogInformation("Player {Name} kicked because they requested host authority.", name);
+                    await connection.CustomDisconnectAsync(DisconnectReason.Custom, DisconnectMessages.HostAuthorityUnsupported);
+                    return;
+                }
+
+                _logger.LogWarning("Player {Name} connected with server authority disabled, this may cause issues as there are known bugs in this mode. Please mention that this mode is in use when asking for support.", name);
+            }
+
             if (name.Length > 10)
             {
                 await connection.CustomDisconnectAsync(DisconnectReason.Custom, DisconnectMessages.UsernameLength);
index f24570e8fb7d483465930a9d1f2161a7e0c68aec..0a93548fb7cb78494dd9b291f065aeb157b26463 100644 (file)
@@ -29,6 +29,7 @@
   },
   "Compatibility": {
     "AllowFutureGameVersions": false,
+    "AllowHostAuthority": false,
     "AllowVersionMixing": false
   },
   "Debug": {