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
miniduikboot [Thu, 26 Oct 2023 21:14:09 +0000 (23:14 +0200)]
Fix MurderPlayer for vanilla clients
In 2023.10.24, vanilla started expecting that CheckMurder is handled on
the server. That is, unless the host is modded, then CheckMurder calls
are handled by the host as before
miniduikboot [Wed, 25 Oct 2023 19:26:40 +0000 (21:26 +0200)]
Add 10.24 and drop the rest
We had a nice year of backwards compatibility, but the changes in Fungle
are large enough that dropping support for old versions is the only
logical path forward
miniduikboot [Wed, 31 May 2023 20:13:29 +0000 (22:13 +0200)]
Allow multiple SetName commands per CheckName
Some mods use SetName to set player-specific names, for example to set
player-specific roles. When Anticheat is disabled, this should be
allowed for feature-parity with officials.
miniduikboot [Tue, 7 Mar 2023 23:09:41 +0000 (00:09 +0100)]
Reorder GameFull and GameStarted join errors
If a game is in progress, a player can't join it anyway and spam-joining
to see if a spot becomes available is useless. So the GameFull error is
more important than the GameStarted error, therefore reorder them.
miniduikboot [Sun, 29 Jan 2023 23:10:55 +0000 (00:10 +0100)]
Add a warning for using the default PublicIp
This is a misconfiguration in most cases and it breaks Impostor.Http.
Throw a warning so that people know that they should return to the
install instructions.
miniduikboot [Sun, 29 Jan 2023 21:58:30 +0000 (22:58 +0100)]
Dockerfile: install Http plugin in separate folder
Some people mount a folder on the plugin directory. This is fine, but
our sneaky Impostor.Http install method won't work here. So put it in a
different folder and prepend our folder to the plugin search path.