* Deserialize gamecode as packed in PackedGameDataTo
Most packets use a normal 32 bit int but not PackedGameDataTo. Instead,
Innersloth decided to waste a byte by using WritePacked. As v2 game
codes are always negative, this is less efficient, but alas.
It was documented in the pseudocode and I didn't spot the difference
when reviewing the implementation, so I made this mistake when
deduplicating this code.
Test plan:
- Start EHR on at least 2 clients
- Use the game mode "Natural Disasters"
- Observe that pixelated blobs are visible for all players, not just the host
* uopt: stop parsing code to string
* Address review comments
* Add GameFilters interface
* Add Newtonsoft.Json
Used by InnerSloth
* Port 2025.3.25 Data
* Generate OptionNames
* Fix missing CategorizedOptionNames
* Remove Newtonsoft.Json
* Add missing GameFilterList
* Basic support for new filters
* Add FiltersController
Server need to tell clients its filters
* Add Tag filter in filtergames
* Add GameTags in legacy game options
* Correctly deserialize Filters
* Minor text fixes
---------
Co-authored-by: miniduikboot <mini@duikbo.at>
* Added an RPC packet size anti-cheat
* Support PackedGameDataTo
* Move packet size check to HazelConnection
* Update PacketSizeLimit to 1153 and add anti-cheat docs
* Change default to value determined on officials
Thanks Niko for doing the research
---------
Co-authored-by: miniduikboot <mini@duikbo.at>
Co-authored-by: NikoCat233 <139348239+NikoCat233@users.noreply.github.com>
On January 21 Innersloth released a document that details a few new
features. One of these are host chat commands: any chat message that
starts with "/cmd" is forwarded to the host and to the host only.
Implement this feature in Impostor too for implementation parity.
For more info, see their GitHub page:
https://github.com/Innersloth-LLC/AmongUsModdingInformation
From their Discord:
Admin has pushed hotfix v17.1.2 for mobile players! minor changes to the ad rewards to the daily cap (subject to future change) and updated the screen to clarify when the daily cap is reset.
The new Unity version used by Among Us 16.0.5 disables the
"InsecureHttpOption", which blocks UnityWebRequests via HTTP. Therefore
all Impostor servers should now switch to HTTPS.
https://docs.unity3d.com/2022.3/Documentation/ScriptReference/InsecureHttpOption.html
Thanks to TianMengLucky for reporting this and NikoCat233 for
identifying the cause
Among Us always adds a constant amount of roles to this dict, so it
doesn't make sense to clear this dictionary every time.
Furthermore, previously it was possible to trigger a
ConcurrentModificationException when running Deserialize in parallel
with Serialize. This should no longer happen, as new keys are no longer added
It is possible to spawn invalid network objects without an attached
PlayerInfo, and Impostor will throw exceptions everywhere if you happen
to spawn one. Officials do allow spawning objects like this, so allow it
in Impostor for compatibility reasons
For some network objects, like PlayerControl, we expect that there is an
PlayerInfo object associated to them. If there isn't, throw an exception
in this AC category
Force(.*)Async will perform the same function as \1Async but without
throwing exceptions. The old API is maintained for backwards
compatibility reasons.
Murder checks are now shared with the main function that handles
CheckMurder, as ProtectPlayerAsync and ExileAsync aren't used in the
code I didn't make a similar change there. Checks were also synced
between both methods
This prevents situations where a player that requested red has a
different color when rejoining because red is the default color of a
PlayerInfo object. This is most noticeable if the host is late with
rejoining, and a lot of players are alreading in WaitingForHost limbo.
When the host finally rejoins, they will not assign Red immediately to
players that requested Red as it is "in use", and instead assign the
next color.
By recording and restoring this is avoided, and players tend to get
their own colors back in most cases.
This is not something that officials do at the moment, but I don't think
this has an impact on mods, as a normal checkcolor/setcolor cycle will
take place as usual.
These are no longer used, so warn people who do want to edit them.
I don't foresee these getting removed soon though, as we do want to kick
players on old versions for having an old game version