miniduikboot [Thu, 8 Aug 2024 19:31:07 +0000 (21:31 +0200)]
Add scene param to forbidden scene log statement
I'm seeing multiple warnings in my server log about forbidden scene
changes. Unfortunately this warning does not include the actual scene
that was triggering the issue, which makes diagnosis/remediation difficult.
Additionally change this logging call to use names suitable for
structured logging.
miniduikboot [Sat, 10 Aug 2024 16:24:21 +0000 (18:24 +0200)]
Change default ListenIp to match with config
The default ListenIp for the base game server has been set to 0.0.0.0 in
config.json for as long as I remember, and a different value is only
sporadically used. I remember a case where someone was fancy with Split
DNS. 0 is better as a default than localhost, so change the code
accordingly to aligh with config.json
Impostor doesn't use the affected
JsonSerializer.DeserializeAsyncEnumerable method as it doesn't accept
JSON formatted payloads, but the NU1903 warning is shown on all builds,
leading to warning fatigue.
Previously Impostor liked to kill exiled players server side to raise an
event. This is quite early, as the host will SetRole them to a ghost
role later.
However as PlayerInfo is server-owned by default in 2024.6.18, it starts
killing players client side. This caused meetings to immediately
conclude if the final impostor was voted out, ruining the cutscene.
So this commit makes Impostor wait for hosts to actually kill the player
using SetRole. Do set the LastDeathReason property though for players
using the API.
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.
Some people were confused by config-full.json, thinking that this file
should be edited too. This is not the case and the values in this file
don't apply as it was only meant as an example, so rename the file to
make that more clear.
Also update this file to add the options from the Modular Anticheat
miniduikboot [Fri, 14 Jun 2024 19:49:12 +0000 (21:49 +0200)]
Improve CompatMgr behaviour for unknown versions
Currently, Impostor will show an "Client is in an invalid state."
message if a player tries to join a match where the host or the joining
player is using a version unknown to Impostor.
This message confused a *lot* of people, so this PR changes the API such
that if the version is not registered, the version itself is put in a
compatibility group and compared, assuming no other game versions are
compatible with it. This works fine in most cases, as Among Us network
versions generally increase over time.
Failure on 2222.2.2 (which is ancient at this point, so likely no longer
used) and future cases where Innersloth messes up (which is unlikely) is
an acceptable consequence to me.
miniduikboot [Thu, 13 Jun 2024 18:52:25 +0000 (20:52 +0200)]
Accept RPC's called on GameManager
Previously Impostor would just throw when a method was called on a
GameManager, but this caused issues with client mods that did just this,
even through vanilla never calls an RPC on GameManager.
This commit changes that throw statement to pass the exception to the
custom message handler/anticheat instead, which is also how it works for
the other NetObjects
miniduikboot [Sun, 26 May 2024 20:05:21 +0000 (22:05 +0200)]
Clean up clients that refuse to quit properly
When a player is kicked or banned from a game, the client is expected to
disconnect in response. When they decide not to *or* the disconnect
packet is lost, Impostor just silently disposes of the connection.
This does not remove them from ClientManager, which is how I tracked
this bug down.
By sending them a proper disconnect message, clients should have
received *a* disconnection message before dropping their connection.
Future work should split this entire method in removing players from a
game and processing kick/bans because the latter feature is not relevant
for other callers of this method.
Refactor if statements to be more vertically dense
Multiple guard clauses make the file harder to navigate, so put them in
a single guard clause with one validation rule per line. Some statements
in the file were already set up like this, so this commit makes it consistent
When a game has just been created, it does not yet have any players in
them, and as a result you can't get the host or its connection id when
this event is called. This makes it annoying to link between this event
and the IGameCreationEvent that came just before it.
Having this link is useful for the usecase of a game code allocation
plugin that allocates codes from a pool, and needs to return codes to
a pool if these codes weren't picked.
* Add extra configuration options for the anticheat
* Implement option to exempt hosts from AC checks
* Add AntiCheatConfig to InnerNetObject and friends
* Categorize calls in InnerNetObject.Anticheat
* Categorize other calls to ReportCheatAsync
* Update cosmetics AC handling
When Innersloth changed SetHat etc to SetHatStr as part of the cosmicube
update we accidentally created a few dead methods. Restore and update
the code.
* Push up cheat category to ReportCheatAsync
This makes it possible to log failed checks for diagnosis. Also much
cleaner now that we don't have to push AntiCheatConfig everywhere.
Should've done this immediately q.q
* Add back old version of ReportCheatAsync
some plugins used this method. affected plugins should rebuild after the
next impostor release
* Add documentation for modular anticheat
* Address comments
* Sort AntiCheatConfig keys
* Rework the option to allow cheating hosts
This option should actually be tristate: to not break host-only mods we
should disable the anticheat for hosts running host-only mods.
miniduikboot [Wed, 24 Jan 2024 20:37:37 +0000 (21:37 +0100)]
Update Github actions
- Update versions to the latest one
- Get rid of .gitmodules as we dumped that years ago
- Change ::set-output to output files as the former is slated for removal
miniduikboot [Wed, 10 Jan 2024 18:06:15 +0000 (19:06 +0100)]
Change default ListenIp of Http server to 0.0.0.0
We see that a lot of support tickets are caused by this default setting,
as it is one of the things that blocks connections to the server with no
obvious indication that this is happening. To make it easier for first
time users to set up Impostor, it is important that this setting is
changed.
Previously we also recommended against direct exposing due to security
reasons, but I believe this fear to be unfounded: Microsoft claims that
the Kestrel server is hardened against web server vulnerabilities and
supports its use both with and without a reverse proxy.[1]
We still recommend using reverse proxies if HTTPS support is needed, so
that section of documentation still remains. Setting the ListenIp to
127.0.0.1 is still recommended when using a reverse proxy to remove the
ability for people to connect directly, so we add it there as a recommendation.
miniduikboot [Wed, 29 Nov 2023 21:14:59 +0000 (22:14 +0100)]
Get rid of Rpc02 SyncSettings
This RPC is still sent by clients, but no longer used by clients. As the
server can get the info it wants from LogicOptions instead, remove this
RPC to prevent people from using it accidentally
miniduikboot [Sun, 26 Nov 2023 22:01:54 +0000 (23:01 +0100)]
Implement event to detect game option changes
This can be triggered by both RPC 02 and a(nother) plugin calling
SyncSettings to force certain settings on the host. Users of this API
could cause this event to recurse by calling SyncSettingsAsync inside an
event handler, so we prevent such reasonable foreseeable misuse.
miniduikboot [Thu, 16 Nov 2023 16:55:50 +0000 (17:55 +0100)]
Debounce CheckMurder calls
In games where players have a high ping, they can get disconnected if
they try and murder a player twice. If a player tries to kill a player
again while they are still under a cooldown from their previous kill,
cancel their request if the game is server authoritive and don't process
it anymore if the game is host authoritive
miniduikboot [Sat, 28 Oct 2023 22:37:30 +0000 (00:37 +0200)]
Refresh Murder Event API
- IPlayerCheckMurderEvent now exists
- You can see if a kill was successful with IPlayerMurderEvent
- You can now see if host authority was requested with Game.IsHostAuthoritive