Commit Graph
800 Commits
Author SHA1 Message Date
miniduikboot c672e19e99 Always store previous color
Because it's only restored in standard SA networking, the stored value
will be ignored in HA. This is preferred to logging when in HA mode
2025-05-22 23:48:50 +02:00
miniduikboot 104376b43f Record and restore player colors
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.
2025-05-22 23:48:50 +02:00
miniduikboot 92ca5aa9d7 Merge pull request #690 from Impostor/feature/16.0.5
Add 16.0.5 support
2025-05-22 23:13:49 +02:00
miniduikboot 67e94e8efc Add 16.0.5
Crossplay with the previous version is not supported, so it gets its own
compatibility group.

Further analysis on the changes is still needed
2025-05-20 19:48:57 +02:00
miniduikboot da8353655d Merge pull request #683 from Impostor/feature/16.0.0
Add support for 16.0.0
2025-04-03 21:31:35 +02:00
miniduikboot dab8751f1d Add note to old game methods
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
2025-04-01 23:50:17 +02:00
miniduikboot 723495e390 Add GameTags enum
Can't be generated from game files at the moment unfortunately
2025-04-01 23:49:46 +02:00
miniduikboot cd220530ac Remove GameListingV2
The game ignores unknown fields when deserializing, and as only fields
were added it's acceptable to merge the structs together
2025-04-01 23:48:32 +02:00
miniduikbootandNiko233 fc2679a8d2 Add stub for Find Lobby endpoint
Co-Authored-By: Niko233 <139348239+NikoCat233@users.noreply.github.com>
2025-03-30 20:35:19 +02:00
miniduikbootandNiko233 28e933092a Stop hardcoding the GameOptions in GameListingV2
To prevent needing to pull in Impostor.Hazel, use an extension method
instead.

Thanks Niko for researching this part

Co-Authored-By: Niko233 <139348239+NikoCat233@users.noreply.github.com>
2025-03-30 20:35:03 +02:00
miniduikboot 06289d46c0 Bump minor version
At this point it doesn't seem necessary to drop support for old
Amoguses, so just bump the minor version for support purposes
2025-03-30 20:34:18 +02:00
miniduikboot 6bd13c0399 Forbid crossplay between 2024.10.29 and 16.0
Innersloth also forbids it, and it's likely not possible due to the new
GameOption version
2025-03-30 20:34:18 +02:00
miniduikboot 7e85419b82 Add endpoint to find games by code
This is used in the new "Enter Code" flow

3 extra fields are added to GameListing, including a Base 64
serialization method for game options
2025-03-30 20:34:18 +02:00
miniduikboot 3e2c3f1525 Update Game Options
Creating a game is now possible
2025-03-30 20:34:18 +02:00
miniduikboot 61cbd5c4d8 Add new network version 2025-03-30 20:34:18 +02:00
miniduikbootandjs6pak 495dc01948 Add diagnostic http message (#663)
* Add diagnostic message to test HTTP server

This makes it possible to diagnose if the reverse proxy setup is working
correctly or if the game configuration is wrong

* Print console log as well

Only print it once to prevent console spam

* Update src/Impostor.Server/Http/HelloController.cs

Co-authored-by: js6pak <me@6pak.dev>

---------

Co-authored-by: js6pak <me@6pak.dev>
2025-01-26 18:00:03 +01:00
Chipmunk a448ece73e Add missing cosmetic methods to IInnerPlayerControl 2025-01-26 17:58:42 +01:00
miniduikboot e7b98f1842 Push down AC checks in PlayerPhysics as well
I've checked Impostor for issues that are similar to #664, and found
this one: if mods add a custom rpc on PlayerPhysics, Impostor will check
ownership of it, which isn't intentional.
2025-01-26 17:42:18 +01:00
miniduikboot d65e99fe45 Move down target AC check in InnerShipStatus
Mods may send RPC's on a ShipStatus that aren't broadcasts. Previously
Impostor would forbid that, which doesn't make sense to me. By moving
down the check it'll allow mods to broadcast RPC's on ShipStatus.

Reported-By: xtracube
2025-01-26 17:41:13 +01:00
miniduikboot bb980096ff Bump version to 1.10.2 v1.10.2 2024-12-22 17:02:56 +01:00
miniduikbootandjs6pak 58a8bda8e7 Check for disconnection between handling messages
Without this, it is possible for clients to get the remainder of their
messages handled in a packet.

Co-Authored-By: js6pak <me@6pak.dev>
2024-12-22 17:02:56 +01:00
miniduikbootandjs6pak a7c37b6bcf Clean up abandoned games on disconnect
When a client disconnects without ever having joined a game, it leaves
behind an empty game on the server. Remove these when a player
disconnects.

Co-Authored-By: js6pak <me@6pak.dev>
2024-12-22 17:02:56 +01:00
miniduikbootandjs6pak 792c9626e4 Prevent clients from creating a second game
Legitimate clients will never create a second game using the same
connection.

Co-Authored-By: js6pak <me@6pak.dev>
2024-12-22 17:02:56 +01:00
miniduikboot e4f81b4a30 Bump to Among Us 2024.10.29 (#656)
Inspected mono, no networking changes found.

Ran dumpostor as well

Bumped Impostor version
v1.10.1
2024-10-24 19:47:01 +02:00
danbudworthmead 2603f34b89 Bugfix/fix outfit RPCs (#653)
* implemented the sequence ID

* implemented the sequence ID for the player outfits

the sequence ID in the set call must be greater than that stored on the client otherwise the client disregards the set call.

* make sequence IDs internal

* added space after closing brace

* make the sequence ID addition +5
2024-10-05 12:44:08 +02:00
Niko233 9b27edbb11 Remove unused HandleSetInfected 2024-10-05 12:28:50 +02:00
danbudworthmead 2f9406cb6a updated the api call to use the setnamerpc serialise
the client now expects a byte which is the netid otherwise the setname call wont work
2024-10-05 12:28:16 +02:00
Niko233 d5f48aa798 Fix vanilla venting as Phantom cause a ban v1.10.0 2024-09-07 08:53:45 +04:00
js6pak ff5501aab7 Add support for 2024.9.4 2024-09-05 05:09:34 +02:00
js6pak acc4da1210 Fix RemovePlayer reason on internal disconnects 2024-08-24 16:52:50 +02:00
js6pak a0f0a65cbf Send DisconnectReason.Hacking to other players when disconnecting for cheating
Base game doesn't have a specific message for it so it results in a generic "left the game due to error" but it's still better than the default "left the game".
This also allows client side mods to fix the message.
2024-08-24 16:51:51 +02:00
js6pak 6c91280125 Fix cheating disconnect message
DisconnectReason.Hacking has been broken in base game for a long time so replace it with a custom message.
Also add a random support code for easier debugging in case of false positives.
2024-08-24 16:51:51 +02:00
miniduikboot 2ddbb8891c Refactor SetColor anticheat
One issue with the ColorLimits checks is that it didn't account for mods
that add extra colors, this is fixed by checking if the route followed
is plausible instead of mimicking client logic and only accepting a
single answer that it expected. A false negative is possible where the
host decides to wrap back to the front but there are still custom colors
available at the end of the list. This is acceptable because Impostor
doesn't currently know the amount of colors available and this issue
isn't major enough to ask all mod authors to declare their custom color
amount to the server.

As extra colors should now be handled by this code, it makes sense to
change the category of the unknown colors check to ProtocolExtensions.
For these mods an exemption of the ColorLimits category is no longer
necessary.

Note that mods that allow duplicate colors that do not use a custom rpc
to set colors can only be supported by disabling the ColorLimits
category, this was already the case and I don't think it can be unified
with the existing check.
2024-08-23 18:04:52 +02:00
Niko233 8c52b13af4 更新 Game.State.cs 2024-08-22 08:12:47 +02:00
miniduikboot f6318c7040 Merge pull request #609 from Impostor/feature/2024.6.18-prepare
Prepare for 2024.6.18 update
2024-08-20 21:50:45 +02:00
Niko233 4d6c060c7c Add handler for phantom rpcs 2024-08-20 21:41:38 +02:00
Niko233 83bf1c4368 Add Phantom Rpcs support 2024-08-20 21:41:38 +02:00
miniduikboot ed9f6e3134 Add Phantom to the list of Impostor roles 2024-08-20 21:41:38 +02:00
miniduikboot 219b72a3d1 Clean up owned playerinfo's when disconnecting
This commit does what official servers do:
- despawn the PlayerInfo if someone disconnects while in the lobby
- despawn all PlayerInfos at the end of a game when the EndGame screen
is shown. At this point a lot of other netobjects are destroyed as well,
with the PlayerInfos generally done first.
2024-08-20 21:41:38 +02:00
miniduikboot 01e9cccdf5 Set PlayerLevel in PlayerInfo on RPC SetLevel
Previously this used to be done by the host, but this is now the
server's responsibility.
2024-08-20 21:41:38 +02:00
miniduikbootandjs6pak fc79bd1536 Add Message24EndGameHostMigration serialization
Looks like Innersloth added this but hasn't actually used this. Weird..

When sent it makes the new host perform a full rejoin, which gums up
Impostor's spawning logic. Fixing that causes the client to gum itself
up. Sigh.

After some testing it seems like host migration still works fine, so
this investigation wasn't needed. Committing for posterity.

Co-Authored-By: js6pak <me@6pak.dev>
2024-08-20 21:41:38 +02:00
miniduikboot 9e1abe07ef Switch PlayerName writes to Outfit
In 2024.6.18 Innersloth changed the storage location of the PlayerName
from PlayerInfo to PlayerOutfit. If we don't set the PlayerName, we'll
send an incomplete PlayerInfo to new players, so new players are unable
to stay connected as they will not receive complete PlayerInfo objects
before a timeout in the client activates.

Because we publish PlayerName in the API, we can't completely remove
the PlayerName field from PlayerInfo. We also use it internally in a few
places, so I don't this is worth removing.
2024-08-20 21:41:38 +02:00
miniduikboot ccd36b6571 Sync over tasks
As tasks used to be part of the GameData, 2024.6.18 has moved them to
the PlayerInfo. Because they are now called on the PlayerInfo of the
correct player, the playerId field in the RPC is no longer necessary.
2024-08-20 21:41:38 +02:00
miniduikboot 44e9dfe28d Bump to 2024.8.13
Network side seems unchanged and officials allow crossplay
2024-08-20 21:41:38 +02:00
miniduikboot 09cadcb63b Spawn PlayerInfo's if host is not authoritive
This PlayerInfo also needs to be synced over if it is server owned
2024-08-20 21:41:38 +02:00
miniduikboot b118af12be Add NetId to SetName and SetColor
2024.6.18 adds a NetId field *in front* of the existing fields to help link back to the PlayerInfo. We don't actually need this NetId and assume it's called on the correct PlayerControl, so we ignore it.
2024-08-20 21:41:38 +02:00
miniduikboot 372ed8511f Set RoleWhenAlive when set to a Ghost role 2024-08-20 21:41:38 +02:00
miniduikboot 85296d2d46 Serialize Color -1 as 0 in PlayerOutfit
Official servers send 0 instead of -1 when the outfit is still
incomplete to prevent some client issues.
2024-08-20 21:41:38 +02:00
miniduikboot c43fdd2a69 Demote InnerGameData, promote InnerPlayerInfo
In 2024.6.18 Innersloth promoted PlayerInfo to its own network object, and gave it to the server. InnerGameData is now a container that holds these players. This commit implements the changes necessary to handle these separate PlayerInfo network objects.
2024-08-20 21:41:38 +02:00
miniduikboot 615469c6c8 Add dirty tracking to PlayerOutfit
To prevent excessive modifications in the codebase, which is prone to
issues if a callsite is missed, automatically do this using properties.

Keep the access modifiers intact for now.
2024-08-20 21:41:38 +02:00