Compare commits

..
Author SHA1 Message Date
js6pak 43acae16ed Rework LockGuard to avoid allocations when the lock isn't contested 2023-12-17 23:29:31 +01:00
miniduikboot d91ab5cfe8 Add a lock on most interactions with game objects
We see rare problems where multiple messages on the same game arriving at
the same game cause issues. This commit adds a coarse-grained lock on
all interactions with a game by adding a binary semaphore.

Because manually adding try{} finally{} blocks seems verbose, I added a
RAII-style LockGuard that locks the semaphore on creation and drops it
when disposed.
2023-12-17 20:45:40 +01:00
192 changed files with 3018 additions and 67142 deletions

No files matched your search

+7 -3
View File
@@ -5,11 +5,13 @@ on:
paths:
- '.github/workflows/ci.yml'
- 'src/**/**'
- '.gitmodules'
- 'build.cake'
pull_request:
paths:
- '.github/workflows/ci.yml'
- 'src/**/**'
- '.gitmodules'
- 'build.cake'
jobs:
@@ -18,7 +20,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
with:
submodules: true
- uses: actions/cache@v3
with:
@@ -30,7 +34,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.x
dotnet-version: 7.x
- name: Run the Cake script
uses: cake-build/cake-action@v1
@@ -50,4 +54,4 @@ jobs:
- name: Push NuGet package
if: github.ref_type == 'tag'
run: |
dotnet nuget push ./build/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_IMPOSTOR }}
dotnet nuget push ./build/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_IMPOSTOR }}
+12 -8
View File
@@ -6,6 +6,7 @@ on:
paths:
- 'src/Impostor.Server/**'
- 'src/Impostor.Shared/**'
- '.gitmodules'
- '.github/workflows/docker.yml'
- 'Dockerfile'
tags:
@@ -14,6 +15,7 @@ on:
paths:
- 'src/Impostor.Server/**'
- 'src/Impostor.Shared/**'
- '.gitmodules'
- '.github/workflows/docker.yml'
- 'Dockerfile'
@@ -23,7 +25,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v2
with:
submodules: true
- name: Prepare
id: prep
run: |
@@ -44,14 +48,14 @@ jobs:
if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
fi
echo version=${VERSION} >> $GITHUB_OUTPUT
echo tags=${TAGS} >> $GITHUB_OUTPUT
echo versionsuffix=${VERSIONSUFFIX} >> $GITHUB_OUTPUT
echo created=$(date -u +'%Y-%m-%dT%H:%M:%SZ') >> $GITHUB_OUTPUT
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=versionsuffix::${VERSIONSUFFIX}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
@@ -59,7 +63,7 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
View File
Whitespace-only changes.
+4 -2
View File
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
# See for all possible platforms
# https://github.com/containerd/containerd/blob/master/platforms/platforms.go#L17
@@ -36,10 +36,12 @@ RUN case "$TARGETARCH" in \
dotnet publish -c release -o /app -r "$NETCORE_PLATFORM" -p:VersionSuffix="$VERSIONSUFFIX" --no-restore ./src/Impostor.Server/Impostor.Server.csproj
# Final image.
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:7.0
WORKDIR /app
COPY --from=build /app ./
# Make the HttpServer listen to 0.0.0.0 to expose it to the outside world.
ENV IMPOSTOR_HttpServer__ListenIp=0.0.0.0
# Override ASPNETCORE_URLS to stop warning.
ENV ASPNETCORE_URLS=
+2 -2
View File
@@ -1,6 +1,6 @@
# Building from source
The solution contains the Impostor server and its dependencies, like Hazel and the plugin API. The server is built using [.NET 8](https://dotnet.microsoft.com/download/dotnet/8.0).
The solution contains the Impostor server and its dependencies, like Hazel and the plugin API. The server is built using [.NET 7](https://dotnet.microsoft.com/download/dotnet/7.0).
## Cloning Impostor
@@ -14,7 +14,7 @@ git clone https://github.com/Impostor/Impostor.git
### Dependencies
- [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)
- [.NET 7 SDK](https://dotnet.microsoft.com/download/dotnet/7.0)
- [Rider](https://www.jetbrains.com/rider/) or [Visual Studio](https://visualstudio.microsoft.com/vs/) (Optional, only if you want the full IDE experience)
### Build using the CLI
-8
View File
@@ -8,14 +8,6 @@ The Impostor project is a reverse engineered and open source server for the game
Yes, Impostor can be used with both the Android and iOS versions of the game. You can add a custom server via a link, you can do this using the [site](https://impostor.github.io/Impostor)
## Can this be used with the console version of the game?
Sadly not, as these don't allow adding custom servers.
## Can this be used with Among Us 3D/VR?
No, it's an entirely different game with a completely different network stack. So we'd need to develop another server completely from scratch. We're currently not interested in doing this.
## How can I get started?
See [Setting up your Server](Running-the-server.md) for more information on running the server and [Client Setup](https://impostor.github.io/Impostor/) for helping your friends join in!
+10 -27
View File
@@ -1,18 +1,22 @@
# HTTP Server
Since Impostor 1.9.0 a HTTP service is included for matchmaking, which is required for clients to connect to the Impostor server.
Since Impostor 1.9.0 a HTTP service is included for matchmaking. Recent versions of Among Us require this service in order to connect correctly and not kick players after a round.
Starting from Among Us 16.0.5, you need to set up HTTPS for players to connect to your server.
Unfortunately Impostor doesn't handle SSL certificates, so you need to set up a reverse proxy.
Depending on whether you want to support mobile players, you can set up the HTTP server in one of two ways:
- Directly expose the HTTP server. Simpler, but only works if you don't want to support mobile players
- Use a reverse proxy to expose the HTTP safer. More complex, but allows mobile players to connect
## Directly expose the HTTP server.
In config.json, set "ListenIp" to "0.0.0.0" in the "HttpServer" section. If you don't have this section, look in the example [config.json](https://github.com/Impostor/Impostor/blob/master/src/Impostor.Server/config.json)
## Use a reverse proxy
A reverse proxy allows you to forward HTTP requests from users to multiple services. If you already have one, you should configure it to add Impostor.
A reverse proxy allows you to forward HTTP requests from users to multiple services. If you already have one, you should configure it to add Impostor. This page contains an Nginx configuration you can use for reference.
If you have never set up a reverse proxy before, we recommend you to set up [Caddy](https://caddyserver.com/). It is easy to set up and comes with support for requesting SSL certificates out of the box.
To prevent people from connecting directly to Impostor, we recommend changing the "ListenIp" in the "HttpServer" section to "127.0.0.1". This makes sure people can't connect to your HTTP server other than via your reverse proxy. Keep the "ListenIp" in the "Server" section at "0.0.0.0" though, running the normal game traffic through a proxy is not supported.
### Caddy
To install Caddy, follow the [official installation guide](https://caddyserver.com/docs/install). Then use the following lines as your `Caddyfile` configuration file:
@@ -59,24 +63,3 @@ server {
```
</details>
## Stop exposing Impostor's HTTP server to the internet directly
To only allow connections to Impostor's HTTP servers via the reverse proxy, we recommend to set the ListenIp of the HTTP server to 127.0.0.1:
```json
{
// NOTE: merge this snippet into the rest of your configuration
"HttpServer": {
"ListenIp": "127.0.0.1"
}
}
```
Or if you're configuring Impostor with environment variables:
```sh
IMPOSTOR_HttpServer__ListenIp=127.0.0.1
```
For more information on server configuration, see [Server-configuration.md](Server Configuration).
+9 -12
View File
@@ -10,22 +10,19 @@ To connect to the server, you need to configure and install a region file on htt
Among Us connects to the server using two network services: the (TCP) HTTP service points Among Us to the UDP service, then the UDP service hosts the actual game traffic. Because of this, Impostor uses port 22023 using **both** the TCP and UDP protocols.
To connect to your Among Us version from another PC, you need to set up a HTTP reverse proxy to support HTTPS. If you're just running a version of Impostor for testing Setup instructions for this are in the [Http Server documentation](Http-server.md).
If you want to test if your Among Us HTTP server is working, open `http://localhost:22023` (assuming you're using the default settings, change the IP and port respectively) in a browser
As the phone version of Among Us requires this HTTP connection to be secure, we recommend using a HTTP reverse proxy to terminate SSL on the HTTP service. Setup instructions for this are in the [Http Server documentation](Http-server.md).
Depending on your host you may also need to port forward Impostor to the internet or pass Impostor traffic by your firewall. Port 22023 UDP needs to be accessible for everyone that wants to play on the server, then you also need to portforward your HTTP reverse proxy or port 22023 TCP if you don't use a reverse proxy. As port forwarding changes per host or router configuration, port forwarding is not covered by this guide.
## Normal installation
1. Install [.NET 8.0](https://dotnet.microsoft.com/download/dotnet/8.0). We recommend either the ASP.NET Core Runtime or the SDK. The SDK is necessary in case you want to develop Impostor or Impostor plugins.
1. Install [.NET 7.0](https://dotnet.microsoft.com/download/dotnet/7.0). We recommend either the ASP.NET Core Runtime or the SDK. The SDK is necessary in case you want to develop Impostor or Impostor plugins.
2. Download the [latest release](https://github.com/Impostor/Impostor/releases) or the [latest CI build](https://nightly.link/Impostor/Impostor/workflows/ci/master). Note that Impostor is built for multiple CPU-architectures and operating systems, you most likely want the x64 version, unless you are running on a Raspberry Pi or another device/VPS with an Arm processor.
3. Extract the zip.
4. Modify `config.json` to your liking. Documentation can be found [here](Server-configuration.md). You need to at least change `PublicIp` to the address people will connect to your server to.
5. Run `Impostor.Server` (Linux/macOS) or `Impostor.Server.exe` (Windows)
6. Set up a reverse proxy to support HTTPS, so you can connect to your server from another device. See [reverse proxy configuration](Http-server.md)
7. (OPTIONAL - Linux) Configure a systemd definition file and enable the service to start on boot, see [systemd configuration](Server-configuration.md#systemd)
6. (OPTIONAL - Linux) Configure a systemd definition file and enable the service to start on boot, see [systemd configuration](Server-configuration.md#systemd)
7. (OPTIONAL) Set up a reverse proxy to support HTTPS, so mobile phones can connect, see [reverse proxy configuration](Http-server.md)
## Using Docker
@@ -46,7 +43,7 @@ To configure the docker container, either use environment variables or mount con
## Using Docker Compose
Docker Compose allows you to start a Docker container using a predefined configuration. This is an example configuration you can continue on:
Docker Compose allows you to start a Docker container using a prefined configuration. This is an example configuration you can continue on:
```
version: '3.4'
@@ -56,12 +53,12 @@ services:
image: aeonlucid/impostor:nightly
container_name: impostor
ports:
- 127.0.0.1:22023:22023/tcp # Set up your own reverse proxy to terminate HTTPS
- 127.0.0.1:22023:22023/tcp # Remove "127.0.0.1:" if you want to expose Impostor's HTTP server directly to the internet
- 22023:22023/udp
environment: # Either configure Impostor using environment variables or mount config.json in your container
environment: # Either configure Impostor using environment variables or mount a copy of config.json
- IMPOSTOR_Server__PublicIp=your.public.ip.here
volumes:
- /path/to/local/config.json:/app/config.json # Mount config.json
- /path/to/local/config.json:/app/config.json # For easy editing of the config
- /path/to/local/plugins:/app/plugins # Only needed if using plugins
- /path/to/local/libraries:/app/libraries # Only needed if using external libraries (some plugins may need this)
- /path/to/local/libraries:/app/libraries # Only needed if using external libraries
```
+18 -32
View File
@@ -1,5 +1,7 @@
# Server configuration
Some information about all the possible configurations. Click [here](https://github.com/Impostor/Impostor/blob/master/src/Impostor.Server/config-full.json) to see all the possible config options.
## Options
### Required Server Configuration
@@ -15,45 +17,29 @@
Impostor has an Http Server that is used by recent versions of Among Us to connect to. See [the Http Server page](Http-server.md) for more details on how to set this up.
| Key | Default | Description |
|----------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Enabled** | `true` | Whether the http server should be enabled. |
| **ListenIp** | `0.0.0.0` | The network interface to listen on. Use `127.0.0.1` if you use a reverse proxy or just run locally. Use `0.0.0.0` if you are directly exposing this server to the internet |
| **ListenPort** | `22023` | The listen port of this server. For port forwarding purposes, this is an TCP port. |
| Key | Default | Description |
|----------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Enabled** | `true` | Whether the http server should be enabled. |
| **ListenIp** | `127.0.0.1` | The network interface to listen on. Use `127.0.0.1` if you use a reverse proxy or just run locally. Use `0.0.0.0` if you are directly exposing this server to the internet (not recommended) |
| **ListenPort** | `22023` | The listen port of this server. For port forwarding purposes, this is an TCP port. |
### AntiCheat
Impostor has an Anticheat that makes it possible to kick cheaters from games automatically. Note that the anticheat is tuned on the vanilla version of the game, so client-side modifications could trigger the Anticheat if you're playing with them.
| Key | Default | Value |
|-------------------------------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Enabled** | `true` | Whether the anticheat should be enabled. |
| **BanIpFromGame** | `true` | When anticheat is enabled and a player is caught hacking, they will be kicked from the server. If this value is set to `true`, the player will be banned instead and will not be able to rejoin that specific game. |
| **AllowCheatingHosts** | `"Never"` | Configure whether hosts are allowed to cheat. "Never" forbids it, "Always" allows it. "IfRequested" allows hosts to cheat if they connect with the DisableServerAuthorityFlag set. |
| **AllowHostOnlyExtensions** | "IfRequested" | Configure whether [Host-Only extensions](https://github.com/Innersloth-LLC/AmongUsModdingInformation#host-only-mods) are allowed in all games ("Always"), +25 games only ("IfRequested") or by nobody ("Never") |
| **EnableGameFlowChecks** | `true` | Enable checks that check if certain actions are done in the appropriate order or at the appropriate moment in the game. This includes changing cosmetics while in game or murdering too fast. |
| **EnableInvalidObjectChecks** | `true` | Enables checks that check if network objects are spawned properly. Disabling this option also implies disabling EnableRoleChecks. |
| **EnableMustBeHostChecks** | `true` | Enables checks that check if players are the host before they can do actions that require them to be host of the game. This includes starting the game and spawning objects. |
| **EnableColorLimitChecks** | `true` | Enables checks that checks if players request colors that are already in use. |
| **EnableNameLimitChecks** | `true` | Enables checks that checks if player names have a length that is possible to set using the user interface. |
| **EnableItemLimitChecks** | `true` | Enables checks for item counts that cannot be exceeded in the official clients. |
| **EnableOwnershipChecks** | `true` | Enables checks that check if players are allowed to perform a certain action on themself or another player. |
| **EnableRoleChecks** | `true` | Enables checks that check if players have the correct role when performing certain role abilities like venting or murdering. |
| **EnableTargetChecks** | `true` | Enables checks that check if certain packets to everyone that should only have been sent to certain players or vice versa. This includes sending votes or network objects. |
| **EnableIdentifierChecks** | `true` | Enables checks that verify if the friendcode and puid a host claims for a player in their PlayerInfo match the ones known for that player. |
| **ForbidProtocolExtensions** | `true` | If disabled allows players to send network packets that go beyond the network packets sent by the vanilla game. This is necessary for most mods that need all players to install it. |
| **EnablePacketSizeChecks** | `true` | Enables checks that verify if network messages exceed the maximum allowed size. |
| **PacketSizeLimit** | `1203` | The maximum allowed size (in bytes) for a network message. The official servers of Among Us requires that a Hazel packet is < 1204 bytes, excluding headers. |
| Key | Default | Value |
| ----------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Enabled** | `true` | Whether the anticheat should be enabled. |
| **BanIpFromGame** | `true` | When anticheat is enabled and a player is caught hacking, they will be kicked from the server. If this value is set to `true`, the player will be banned instead and will not be able to rejoin that specific game. |
### Compatibility
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.
Impostor has two compatibility options which allow some extra flexibility but may not work properly. Enabling either of these options is not recommended.
| 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. |
| 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. |
### Debug
@@ -103,11 +89,11 @@ Other Serilog sinks are also supported, but are out of scope for this documentat
### File
The `config.json` file contains all the configurable options.
The simplest option to configure is by using the `config.json` file next to the server executable. For all possible options see the [config-full.json](https://github.com/Impostor/Impostor/blob/dev/src/Impostor.Server/config-full.json) file.
### Environment variables
If you're unable to edit the `config.json` file, you can instead set Environment variables to configure Impostor. The general pattern for each variable is `IMPOSTOR_SectionName__VariableName`. For example, to disable the anticheat, you can set the environment variable `IMPOSTOR_AntiCheat__Enabled=false`. Here are some more examples:
If you're unable to edit the config.json file, you can instead set Environment variables to configure Impostor. The general pattern for each variable is `IMPOSTOR_SectionName__VariableName`. For example, to disable the anticheat, you can set the environment variable `IMPOSTOR_AntiCheat__Enabled=false`. Here are some more examples:
```
IMPOSTOR_Server__PublicIp=127.0.0.1
-6
View File
@@ -47,12 +47,6 @@ Also check if the port Impostor (ListenPort) is listening on is correctly port-f
Please check that you only have **working** plugins in the `plugins` folder.
This error can be caused by non-plugin files or plugins that are not working correctly.
## Disconnected with `You disconnected from the server. If this happens often, check your network strength. This may also be a server issue`
Usually this means that Among Us couldn't connect to Impostor's HTTP server.
Open the address of your server in a web browser, it should show you a small page confirming that Impostor is available.
## My question is not yet answered and I'm still having problems!
That's unfortunate. Join the [Impostor Discord](https://discord.gg/Mk3w6Tb), ask your question there and we'll try to help you out. Note that we're not always available, so it may take some time to get an answer. To make answering your question easier, please add the following details:
+12 -4
View File
@@ -27,16 +27,24 @@ https://dotnet.microsoft.com/download
## 2. Create a C# project
The first step is creating a new C# project, it must be a **Class Library (.NET Standard)**. The target framework can be any of those compatible with .NET 8, but we recommend sticking with **.NET 8.0**.
The first step is creating a new C# project, it must be a **Class Library (.NET Standard)**. The target framework can be any of those compatible with .NET 7, which includes:
- .NET Standard 2.0
- .NET Standard 2.1
- .NET 5
- .NET 6
- .NET 7
For more information about compatibility, see https://docs.microsoft.com/en-us/dotnet/standard/net-standard.
> At the moment of writing this document, I recommend you to use **.NET 7.0**.
When the project has been created, you should have `Class.cs` and `Project.csproj` files. Your `Project.csproj` should look something like this.
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
</Project>
```
@@ -262,7 +270,7 @@ Now your plugin is ready to be tested.
1. Right click your project and press `Build`.
2. Right click your project and press `Open Folder in File Explorer`.
3. Go to `bin/Debug/net8.0/`.
3. Go to `bin/Debug/net7.0/`.
4. In this directory, you should find your plugin named `Project.dll`.
5. Copy the `Project.dll` to the `plugins` directory in your Impostor server directory.
6. (Re)start your Impostor server.
@@ -301,7 +309,7 @@ Constantly copying the plugin dll to your server directory can be pretty annoyin
},
"PluginLoader": {
"Paths": [
"D:\\Projects\\Impostor\\src\\Impostor.Plugins.Example\\bin\\Debug\\net8.0"
"D:\\Projects\\Impostor\\src\\Impostor.Plugins.Example\\bin\\Debug\\net7.0"
],
"LibraryPaths": []
}
+2 -2
View File
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11</LangVersion>
<VersionPrefix>1.10.9</VersionPrefix>
<VersionPrefix>1.9.0</VersionPrefix>
<VersionSuffix>dev</VersionSuffix>
<EnforceCodeStyleInBuild Condition="$(MSBuildProjectName)!='Hazel'">true</EnforceCodeStyleInBuild>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
@@ -12,9 +12,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" />
<PackageReference Include="PolySharp" Version="1.14.0" PrivateAssets="all" />
<PackageReference Include="System.Text.Json" Version="8.0.5" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="System.Text.Json" Version="8.0.0" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" PrivateAssets="all" GeneratePathProperty="true" />
@@ -79,20 +79,10 @@ public sealed class SourceGenerator : IIncrementalGenerator
enumGenerator.Generate("GameOverReason", underlyingType: CSharpEnumUnderlyingType.Byte);
enumGenerator.Generate("Platforms");
enumGenerator.Generate("RoleTypes", underlyingType: CSharpEnumUnderlyingType.UnsignedShort);
enumGenerator.Generate("RulesPresets", underlyingType: CSharpEnumUnderlyingType.Byte);
enumGenerator.Generate("SpecialGameModes", underlyingType: CSharpEnumUnderlyingType.Byte);
enumGenerator.Generate("StringNames");
enumGenerator.Generate("SystemTypes", underlyingType: CSharpEnumUnderlyingType.Byte);
enumGenerator.Generate("Language", sourceName: "SupportedLangs");
enumGenerator.Generate("TaskTypes");
enumGenerator.Generate("BoolOptionNames", "Impostor.Api.Innersloth.GameFilters");
enumGenerator.Generate("ByteOptionNames", "Impostor.Api.Innersloth.GameFilters");
enumGenerator.Generate("CategorizedOptionNames", "Impostor.Api.Innersloth.GameFilters");
enumGenerator.Generate("FloatArrayOptionNames", "Impostor.Api.Innersloth.GameFilters");
enumGenerator.Generate("FloatOptionNames", "Impostor.Api.Innersloth.GameFilters");
enumGenerator.Generate("Int32ArrayOptionNames", "Impostor.Api.Innersloth.GameFilters");
enumGenerator.Generate("Int32OptionNames", "Impostor.Api.Innersloth.GameFilters");
enumGenerator.Generate("UInt32OptionNames", "Impostor.Api.Innersloth.GameFilters");
enumGenerator.Generate("RpcCalls", "Impostor.Api.Net.Inner", underlyingType: CSharpEnumUnderlyingType.Byte);
@@ -43,9 +43,9 @@
},
"PolySharp": {
"type": "Direct",
"requested": "[1.14.1, )",
"resolved": "1.14.1",
"contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ=="
"requested": "[1.14.0, )",
"resolved": "1.14.0",
"contentHash": "3K6beiIeVO0hOlHCHv2jgGW7UH3OXsOIiEW60CHpqGvbrHyy4iQfGkCOBtI92PDCaA8XC4ZM3+02g2qenRnHOA=="
},
"System.Text.Encodings.Web": {
"type": "Direct",
@@ -60,9 +60,9 @@
},
"System.Text.Json": {
"type": "Direct",
"requested": "[8.0.5, )",
"resolved": "8.0.5",
"contentHash": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==",
"requested": "[8.0.0, )",
"resolved": "8.0.0",
"contentHash": "OdrZO2WjkiEG6ajEFRABTRCi/wuXQPxeV6g8xvUJqdxMvvuCCEk86zPla8UiIQJz3durtUEbNyY/3lIhS0yZvQ==",
"dependencies": {
"Microsoft.Bcl.AsyncInterfaces": "8.0.0",
"System.Buffers": "4.5.1",
@@ -151,7 +151,6 @@
"System.Runtime.CompilerServices.Unsafe": "4.5.3"
}
}
},
".NETStandard,Version=v2.0/win-x64": {}
}
}
}
-47
View File
@@ -1,47 +0,0 @@
namespace Impostor.Api;
// NOTE: when adding items to this enum, add them to the bottom for API stability
public enum CheatCategory
{
/// <summary>A packet used a part of the network protocol that is unknown to Impostor, like a custom RPC.</summary>
ProtocolExtension,
/// <summary>A host-only mod extension is used outside of host-authoritive mode.</summary>
HostOnlyExtension,
/// <summary>A packet was sent at an inappropriate moment.</summary>
GameFlow,
/// <summary>A packet was sent by a non-host player that should normally only be sent by the host.</summary>
MustBeHost,
/// <summary>A packet was sent that violated limits on the selection of player colors.</summary>
ColorLimits,
/// <summary>A packet was sent that exceeded the limits of possible nicknames to enter ingame.</summary>
NameLimits,
/// <summary>A packet was sent on behalf of another player.</summary>
Ownership,
/// <summary>An ability was used that the current role cannot access.</summary>
Role,
/// <summary>A packet was sent to a player that should be broadcasted, or vice versa.</summary>
Target,
/// <summary>A packet was sent on an invalid network object, like a PlayerControl without PlayerInfo.</summary>
InvalidObject,
/// <summary>A packet was sent that exceeded the maximum allowed RPC size.</summary>
PacketSize,
/// <summary>Legacy category for unsorted anticheat checks.</summary>
Other,
/// <summary>A packet was sent with more items than possible in the game.</summary>
ItemLimits,
/// <summary>A packet contained an identifier (friendcode or puid) that does not match the one known for that player.</summary>
Identifiers,
}
+1 -31
View File
@@ -1,4 +1,4 @@
namespace Impostor.Api.Config
namespace Impostor.Api.Config
{
public class AntiCheatConfig
{
@@ -7,35 +7,5 @@ namespace Impostor.Api.Config
public bool Enabled { get; set; } = true;
public bool BanIpFromGame { get; set; } = true;
public CheatingHostMode AllowCheatingHosts { get; set; } = CheatingHostMode.Never;
public CheatingHostMode AllowHostOnlyExtensions { get; set; } = CheatingHostMode.IfRequested;
public bool EnableGameFlowChecks { get; set; } = true;
public bool EnableMustBeHostChecks { get; set; } = true;
public bool EnableInvalidObjectChecks { get; set; } = true;
public bool EnableColorLimitChecks { get; set; } = true;
public bool EnableNameLimitChecks { get; set; } = true;
public bool EnableItemLimitChecks { get; set; } = true;
public bool EnableOwnershipChecks { get; set; } = true;
public bool EnableRoleChecks { get; set; } = true;
public bool EnableTargetChecks { get; set; } = true;
public bool EnableIdentifierChecks { get; set; } = true;
public bool ForbidProtocolExtensions { get; set; } = true;
public bool EnablePacketSizeChecks { get; set; } = true;
public int PacketSizeLimit { get; set; } = 1203;
}
}
@@ -1,29 +0,0 @@
namespace Impostor.Api.Config
{
/// <summary>
/// Details if exceptions are made for hosts that are cheating.
/// </summary>
public enum CheatingHostMode
{
/// <summary>
/// Hosts follow the same policies as other players.
/// </summary>
Never,
/// <summary>
/// Hosts are allowed to cheat if they request HostAuthority. If they
/// do not request this, the same policies as for other players applies.
/// </summary>
/// <para>
/// HostAuthority can be requested by hosts by adding 25 to their patch
/// version when connecting. This flag is used by a lot of (host-only)
/// mods and also disable server authority over MurderPlayer packets.
/// </para>
IfRequested,
/// <summary>
/// Hosts are always allowed to cheat.
/// </summary>
Always,
}
}
@@ -6,8 +6,6 @@ namespace Impostor.Api.Config
public bool AllowFutureGameVersions { get; set; } = false;
public bool AllowHostAuthority { get; set; } = false;
public bool AllowVersionMixing { get; set; } = false;
}
}
@@ -30,7 +30,5 @@
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.";
}
}
+2 -2
View File
@@ -16,8 +16,8 @@ public class HttpServerConfig
/// Gets or sets the IP address the HTTP Matchmaking server will listen on.
/// </summary>
/// Use "127.0.0.1" if you are running behind a reverse proxy or just testing locally.
/// Use "0.0.0.0" if you are directly exposing this server to the internet.
public string ListenIp { get; set; } = "0.0.0.0";
/// Use "0.0.0.0" if you are directly exposing this server to the internet (not recommended).
public string ListenIp { get; set; } = "127.0.0.1";
/// <summary>
/// Gets or sets the port the HTTP Matchmaking server will listen on.
+1 -1
View File
@@ -13,7 +13,7 @@ namespace Impostor.Api.Config
public ushort PublicPort { get; set; } = 22023;
public string ListenIp { get; set; } = "0.0.0.0";
public string ListenIp { get; set; } = "127.0.0.1";
public ushort ListenPort { get; set; } = 22023;
@@ -1,24 +1,11 @@
using Impostor.Api.Games;
using Impostor.Api.Net;
namespace Impostor.Api.Events
{
/// <summary>
/// Called whenever a new <see cref="IGame" /> is created.
/// </summary>
/// <remarks>
/// Note that the game just has been created, so no players have joined
/// it yet. If you want to know the future host of this game, use the
/// <see cref="Host"/> property.
/// </remarks>
public interface IGameCreatedEvent : IGameEvent
{
/// <summary>
/// Gets the client that requested creation of the game.
/// </summary>
/// <remarks>
/// Will be null if game creation was requested by a plugin.
/// </remarks>
IClient? Host { get; }
}
}
@@ -1,49 +0,0 @@
using Impostor.Api.Games;
namespace Impostor.Api.Events
{
/// <summary>
/// This event is triggered when game options are going to be changed.
/// </summary>
/// <remarks>
/// Be careful when calling SyncSettingsAsync while handling this event,
/// as it may call this event again in some cases.
/// </remarks>
public interface IGameOptionsChangedEvent : IGameEvent
{
/// <summary>
/// Lists the possible reasons that the game options may have changed.
/// </summary>
public enum ChangeReason
{
/// <summary>
/// The options were changed by the host using LogicOptions deserialization.
/// </summary>
/// <remarks>
/// This event does not change the message sent to other players,
/// so changes made to Game.Options are not synced until
/// SyncSettingsAsync is called afterwards.
/// </remarks>
Host,
/// <summary>
/// The options were changed by a plugin using the
/// SyncSettingsAsync method in <see cref="IGame"/>.
/// </summary>
/// <remarks>
/// This event is called after serializing the settings, which
/// means that changes made by event handlers will not be synced
/// over.
///
/// We strongly recommend against calling SyncSettingsAsync while
/// handling this event.
/// </remarks>
Api,
}
/// <summary>
/// Gets the reason that the game options have changed.
/// </summary>
public ChangeReason ChangedBy { get; }
}
}
@@ -1,4 +1,4 @@
using Impostor.Api.Net.Inner.Objects;
using Impostor.Api.Net.Inner.Objects;
namespace Impostor.Api.Events.Meeting
{
@@ -13,15 +13,5 @@ namespace Impostor.Api.Events.Meeting
/// Gets a value indicating whether meeting result is a tie.
/// </summary>
bool IsTie { get; }
/// <summary>
/// Gets a value indicating whether a Judge overruled the vote result.
/// </summary>
bool WasOverruled { get; }
/// <summary>
/// Gets the nonce of the winning Judge overrule, or 0 if the meeting wasn't overruled.
/// </summary>
ushort OverrideId { get; }
}
}
@@ -1,4 +1,4 @@
namespace Impostor.Api.Events.Player
namespace Impostor.Api.Events.Player
{
public interface IPlayerChatEvent : IPlayerEvent, IEventCancelable
{
@@ -6,12 +6,5 @@ namespace Impostor.Api.Events.Player
/// Gets the message sent by the player.
/// </summary>
string Message { get; }
/// <summary>
/// Gets or sets a value indicating whether the message is sent to
/// all players (true) or only to the host (false).
/// To not send this message at all, cancel this event instead.
/// </summary>
bool SendToAllPlayers { get; set; }
}
}
@@ -1,4 +1,5 @@
using System;
using System.Runtime.Serialization;
namespace Impostor.Api
{
@@ -15,5 +16,9 @@ namespace Impostor.Api
public ImpostorConfigException(string? message, Exception? innerException) : base(message, innerException)
{
}
protected ImpostorConfigException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Runtime.Serialization;
namespace Impostor.Api
{
@@ -15,5 +16,9 @@ namespace Impostor.Api
public ImpostorException(string? message, Exception? innerException) : base(message, innerException)
{
}
protected ImpostorException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Runtime.Serialization;
namespace Impostor.Api
{
@@ -15,5 +16,9 @@ namespace Impostor.Api
public ImpostorProtocolException(string? message, Exception? innerException) : base(message, innerException)
{
}
protected ImpostorProtocolException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
+12 -30
View File
@@ -1,11 +1,12 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
using Impostor.Api.Events;
using Impostor.Api.Innersloth;
using Impostor.Api.Innersloth.GameOptions;
using Impostor.Api.Net;
using Impostor.Api.Net.Inner;
using Impostor.Api.Utils;
namespace Impostor.Api.Games
{
@@ -48,16 +49,16 @@ namespace Impostor.Api.Games
/// </remarks>
bool IsHostAuthoritive { get; }
/// <summary>
/// Gets the mod GUID that the game was registered with through the AMCI.
/// </summary>
Guid? ModGuid { get; }
IClientPlayer? GetClientPlayer(int clientId);
T? FindObjectByNetId<T>(uint netId)
where T : IInnerNetObject;
/// <summary>Lock an <see cref="IGame"/> to prevent concurrent modification.</summary>
/// <returns>A <see cref="AsyncLock.Releaser" /> that should be disposed after modifying the game.</returns>
/// <remarks>This method should be called when modifying a game outside of an <see cref="IGameEvent" /> handler.</remarks>
ValueTask<AsyncLock.Releaser> LockAsync();
/// <summary>
/// Adds an <see cref="IPAddress" /> to the ban list of this game.
/// Prevents all future joins from this <see cref="IPAddress" />.
@@ -107,41 +108,22 @@ namespace Impostor.Api.Games
/// <returns>A <see cref="ValueTask" /> representing the asynchronous operation.</returns>
ValueTask SendToAsync(IMessageWriter writer, int id);
/// <summary>
/// Start a GameData(To) message.
/// </summary>
/// <remarks>Use with caution, recommended only for advanced developers.</remarks>
/// <param name="targetClientId">The client to target if needed, `null` if the message should be sent to all players.</param>
/// <param name="type">Message type of the message.</param>
/// <returns>A <see cref="IMessageWriter" /> that you can fill and send using <see cref="FinishGameDataAsync"/>.</returns>
IMessageWriter StartGameData(int? targetClientId = null, MessageType type = MessageType.Reliable);
/// <summary>
/// Finishes GameData message and sends it to either the target or all players.
/// </summary>
/// <remarks>Use with caution, recommended only for advanced developers.</remarks>
/// <param name="writer">MessageWriter received from <see cref="StartGameData"/>.</param>
/// <param name="targetClientId">Same target ClientId passed to StartGameData.</param>
/// <returns>Task that sends the packet.</returns>
ValueTask FinishGameDataAsync(IMessageWriter writer, int? targetClientId = null);
/// <summary>
/// Creates a MessageWriter with GameData header.
/// </summary>
/// <remarks>Use with caution, recommended only for advanced developers.</remarks>
/// <param name="targetNetId">Net id of the InnerNetObject.</param>
/// <param name="callId">Rpc id of the message.</param>
/// <param name="targetClientId">The client to target if needed, `null` if the message should be sent to all players.</param>
/// <param name="targetClientId">Client id of GameDataTo's target.</param>
/// <param name="type">Message type of the message.</param>
/// <returns>A <see cref="IMessageWriter" /> that you can fill with rpc data and send using <see cref="FinishRpcAsync"/>.</returns>
IMessageWriter StartRpc(uint targetNetId, RpcCalls callId, int? targetClientId = null, MessageType type = MessageType.Reliable);
IMessageWriter StartRpc(uint targetNetId, RpcCalls callId, int? targetClientId, MessageType type = MessageType.Reliable);
/// <summary>
/// Finishes rpc message and sends it to either the target or all players.
/// Finishes rpc message and sends it to the target.
/// </summary>
/// <remarks>Use with caution, recommended only for advanced developers.</remarks>
/// <param name="writer">Message writer of the rpc.</param>
/// <param name="targetClientId">Same target client id passed to <see cref="StartRpc"/>.</param>
/// <param name="targetClientId">Id of the receiving client.</param>
/// <returns>A <see cref="ValueTask" /> representing the asynchronous operation.</returns>
ValueTask FinishRpcAsync(IMessageWriter writer, int? targetClientId = null);
}
+4 -4
View File
@@ -26,10 +26,10 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
<PackageReference Include="Impostor.Hazel.Abstractions" Version="1.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="all" />
<PackageReference Include="Impostor.Hazel.Abstractions" Version="1.0.0" />
<ProjectReference Include="..\Impostor.Api.Innersloth.Generator\Impostor.Api.Innersloth.Generator.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
<AdditionalFiles Include="Innersloth/Data/**/*.json" />
@@ -2,102 +2,42 @@ namespace Impostor.Api.Innersloth.Customization
{
public class PlayerOutfit
{
// Magic value that is assigned by default when the outfit is initially created. This is not
// `null` because existing API already exposed this magic value. It's also not 0 (which is
// the value exposed when serializing) because SetColor anticheat checks exist.
private const ColorType UnknownColor = (ColorType)(-1);
public ColorType Color { get; internal set; } = (ColorType)(-1);
private string _playerName = string.Empty;
private ColorType _color = UnknownColor;
private string _hatId = "missing";
private string _petId = "missing";
private string _skinId = "missing";
private string _visorId = "missing";
private string _namePlateId = "missing";
public string HatId { get; internal set; } = "missing";
public bool IsDirty { get; internal set; }
public string PetId { get; internal set; } = "missing";
public string PlayerName
public string SkinId { get; internal set; } = "missing";
public string VisorId { get; internal set; } = "missing";
public string NamePlateId { get; internal set; } = "missing";
public string PlayerName { get; internal set; } = "missing";
public bool IsIncomplete
{
get => _playerName;
internal set => SetField(ref _playerName, value);
get
{
if (!string.IsNullOrEmpty(PlayerName) && Color != (ColorType)(-1) && HatId != "missing" && PetId != "missing" && SkinId != "missing" && VisorId != "missing")
{
return NamePlateId == "missing";
}
return true;
}
}
public ColorType Color
{
get => _color;
internal set => SetField(ref _color, value);
}
public string HatId
{
get => _hatId;
internal set => SetField(ref _hatId, value);
}
public string PetId
{
get => _petId;
internal set => SetField(ref _petId, value);
}
public string SkinId
{
get => _skinId;
internal set => SetField(ref _skinId, value);
}
public string VisorId
{
get => _visorId;
internal set => SetField(ref _visorId, value);
}
public string NamePlateId
{
get => _namePlateId;
internal set => SetField(ref _namePlateId, value);
}
internal byte HatSequenceId { get; set; } = 0;
internal byte PetSequenceId { get; set; } = 0;
internal byte SkinSequenceId { get; set; } = 0;
internal byte VisorSequenceId { get; set; } = 0;
internal byte NamePlateSequenceId { get; set; } = 0;
/// <summary>
/// Gets a value indicating whether a player outfit is complete or whether it needs to receive additional cosmetics.
/// </summary>
/// <returns>true if the outfit is incomplete, false if the outfit is complete.</returns>
public bool IsIncomplete => string.IsNullOrEmpty(PlayerName)
|| Color == UnknownColor
|| HatId == "missing"
|| PetId == "missing"
|| SkinId == "missing"
|| VisorId == "missing"
|| NamePlateId == "missing";
public void Serialize(IMessageWriter writer)
{
writer.Write(PlayerName);
// Follow officials by not sending a color value that is out of range. Sending -1 can cause exceptions on the client side.
writer.WritePacked(Color == UnknownColor ? 0 : (int)Color);
writer.WritePacked((int)Color);
writer.Write(HatId);
writer.Write(PetId);
writer.Write(SkinId);
writer.Write(VisorId);
writer.Write(NamePlateId);
writer.Write(HatSequenceId);
writer.Write(PetSequenceId);
writer.Write(SkinSequenceId);
writer.Write(VisorSequenceId);
writer.Write(NamePlateSequenceId);
}
public void Deserialize(IMessageReader reader)
@@ -109,17 +49,6 @@ namespace Impostor.Api.Innersloth.Customization
SkinId = reader.ReadString();
VisorId = reader.ReadString();
NamePlateId = reader.ReadString();
HatSequenceId = reader.ReadByte();
PetSequenceId = reader.ReadByte();
SkinSequenceId = reader.ReadByte();
VisorSequenceId = reader.ReadByte();
NamePlateSequenceId = reader.ReadByte();
}
private void SetField<T>(ref T field, T value)
{
field = value;
IsDirty = true;
}
}
}
File diff suppressed because it is too large. Load diff
@@ -2,14 +2,13 @@
"0": "SkeldShipStatus",
"1": "MeetingHud",
"2": "LobbyBehaviour",
"3": "GameData",
"4": "PlayerControl",
"5": "MiraShipStatus",
"6": "PolusShipStatus",
"7": "SkeldShipStatus",
"7": "ShipStatus",
"8": "AirshipStatus",
"9": "HideAndSeekManager",
"10": "NormalGameManager",
"11": "NetworkedPlayerInfo",
"12": "VoteBanSystem",
"13": "FungleShipStatus"
}
@@ -1,17 +0,0 @@
{
"Invalid": 0,
"VisualTasks": 1,
"GhostsDoTasks": 2,
"ConfirmImpostor": 3,
"AnonymousVotes": 4,
"IsDefaults": 5,
"UseFlashlight": 6,
"SeekerFinalVents": 7,
"SeekerFinalMap": 8,
"SeekerPings": 9,
"ShowCrewmateNames": 10,
"Roles": 11,
"ShapeshifterLeaveSkin": 1000,
"ImpostorsCanSeeProtect": 1100,
"NoisemakerImpostorAlert": 1300
}
@@ -1,4 +0,0 @@
{
"Invalid": 0,
"MapId": 1
}
@@ -1,14 +0,0 @@
{
"KillCooldown": 0,
"PlayerSpeed": 1,
"EmergencyMeetingCount": 2,
"EmergencyMeetingCooldown": 3,
"DiscussionTime": 4,
"VotingTime": 5,
"CrewmateVision": 6,
"HidingTime": 7,
"MaxTimeInVent": 8,
"ImposterVision": 9,
"FinalHideTime": 10,
"FinalHideImposterSpeed": 11
}
@@ -16,7 +16,6 @@
"IncorrectGame": 18,
"ServerRequest": 19,
"ServerFull": 20,
"MismatchedVersion": 21,
"InternalPlayerMissing": 100,
"InternalNonceFailure": 101,
"InternalConnectionToken": 102,
@@ -43,6 +42,5 @@
"PlatformFailedToGetUserBlock": 213,
"ServerNotFound": 214,
"ClientTimeout": 215,
"ErrorAuthNonceFailure": 216,
"Unknown": 255
}
@@ -1,4 +0,0 @@
{
"Invalid": 0,
"KillDistances": 1
}
@@ -1,32 +0,0 @@
{
"Invalid": 0,
"KillCooldown": 1,
"PlayerSpeedMod": 2,
"ImpostorLightMod": 3,
"CrewLightMod": 4,
"CrewmateTimeInVent": 100,
"FinalEscapeTime": 101,
"EscapeTime": 102,
"SeekerFinalSpeed": 103,
"MaxPingTime": 104,
"CrewmateFlashlightSize": 105,
"ImpostorFlashlightSize": 106,
"ShapeshifterCooldown": 1000,
"ShapeshifterDuration": 1001,
"ProtectionDurationSeconds": 1100,
"GuardianAngelCooldown": 1101,
"ScientistCooldown": 1200,
"ScientistBatteryCharge": 1201,
"EngineerCooldown": 1300,
"EngineerInVentMaxTime": 1301,
"PhantomCooldown": 1500,
"PhantomDuration": 1501,
"TrackerCooldown": 1550,
"TrackerDuration": 1551,
"TrackerDelay": 1552,
"NoisemakerAlertDuration": 1600,
"ViperDissolveTime": 1601,
"DetectiveSuspectLimit": 1602,
"JudgeTaskRequirementPercentage": 1620,
"SpiritGuideCooldownSeconds": 1640
}
@@ -1,11 +1,11 @@
{
"CrewmatesByVote": 0,
"CrewmatesByTask": 1,
"ImpostorsByVote": 2,
"ImpostorsByKill": 3,
"ImpostorsBySabotage": 4,
"HumansByVote": 0,
"HumansByTask": 1,
"ImpostorByVote": 2,
"ImpostorByKill": 3,
"ImpostorBySabotage": 4,
"ImpostorDisconnect": 5,
"CrewmateDisconnect": 6,
"HideAndSeek_CrewmatesByTimer": 7,
"HideAndSeek_ImpostorsByKills": 8
"HumansDisconnect": 6,
"HideAndSeek_ByTimer": 7,
"HideAndSeek_ByKills": 8
}
@@ -1,5 +0,0 @@
{
"Invalid": 0,
"MaxImpostors": 1,
"MinPlayers": 2
}
@@ -1,21 +0,0 @@
{
"Invalid": 0,
"NumImpostors": 1,
"KillDistance": 2,
"NumEmergencyMeetings": 3,
"EmergencyCooldown": 4,
"DiscussionTime": 5,
"VotingTime": 6,
"MaxImpostors": 7,
"MinPlayers": 8,
"MaxPlayers": 9,
"NumCommonTasks": 10,
"NumShortTasks": 11,
"NumLongTasks": 12,
"TaskBarMode": 13,
"Tag": 14,
"CrewmatesRemainingForVitals": 100,
"CrewmateVentUses": 101,
"ImpostorPlayerID": 102,
"RulePreset": 200
}
@@ -6,12 +6,5 @@
"GuardianAngel": 4,
"Shapeshifter": 5,
"CrewmateGhost": 6,
"ImpostorGhost": 7,
"Noisemaker": 8,
"Phantom": 9,
"Tracker": 10,
"Detective": 12,
"Viper": 18,
"Judge": 19,
"SpiritGuide": 21
"ImpostorGhost": 7
}
@@ -8,15 +8,15 @@
"SetName": 6,
"CheckColor": 7,
"SetColor": 8,
"SetHat_Deprecated": 9,
"SetSkin_Deprecated": 10,
"SetHat": 9,
"SetSkin": 10,
"ReportDeadBody": 11,
"MurderPlayer": 12,
"SendChat": 13,
"StartMeeting": 14,
"SetScanner": 15,
"SendChatNote": 16,
"SetPet_Deprecated": 17,
"SetPet": 17,
"SetStartCounter": 18,
"EnterVent": 19,
"ExitVent": 20,
@@ -33,8 +33,8 @@
"SendQuickChat": 33,
"BootFromVent": 34,
"UpdateSystem": 35,
"SetVisor_Deprecated": 36,
"SetNamePlate_Deprecated": 37,
"SetVisor": 36,
"SetNamePlate": 37,
"SetLevel": 38,
"SetHatStr": 39,
"SetSkinStr": 40,
@@ -55,11 +55,5 @@
"CheckShapeshift": 55,
"RejectShapeshift": 56,
"LobbyTimeExpiring": 60,
"ExtendLobbyTimer": 61,
"CheckVanish": 62,
"StartVanish": 63,
"CheckAppear": 64,
"StartAppear": 65,
"QueueOverruleVotes": 66,
"SpiritGuideMessage": 67
"ExtendLobbyTimer": 61
}
@@ -1,6 +0,0 @@
{
"Standard": 0,
"StandardRoles": 1,
"Flashlight": 2,
"Custom": 100
}
@@ -1,23 +0,0 @@
{
"None": 0,
"ImpersonationCeleb": 1,
"Spamming": 2,
"InappropriateNameUnsportsmanlike": 3,
"UnsportsmanlikeConduct": 4,
"ImpersonationDevelopers": 5,
"InappropriateChatPersonalInfo": 6,
"InappropriateNameDerogatory": 7,
"InappropriateNameNsfw": 8,
"Bullying": 9,
"CheatingHacking": 10,
"InappropriateChatDating": 11,
"WeaponizingRules": 12,
"RepeatOffender3": 13,
"SexualMisconduct": 14,
"Doxing": 15,
"IllegalActivity": 16,
"Harassment": 17,
"SelfHarmPromotion": 18,
"RepeatOffender10": 19,
"InvalidUser": 20
}
@@ -1,4 +0,0 @@
{
"None": 0,
"AprilFools": 1
}
@@ -506,7 +506,6 @@
"ErrorSanction": 728,
"ErrorClientTimeout": 729,
"ErrorClientTimeoutConsole": 730,
"ErrorAuthNonceFailure": 731,
"VentDirection": 1000,
"VentMove": 1001,
"MenuNavigate": 1002,
@@ -570,39 +569,10 @@
"RolesHelp_Engineer_02": 1563,
"RolesHelp_GuardianAngel_01": 1564,
"RolesHelp_GuardianAngel_02": 1565,
"RolesHelp_Noisemaker_01": 1566,
"RolesHelp_Noisemaker_02": 1567,
"RolesHelp_Tracker_01": 1568,
"RolesHelp_Tracker_02": 1569,
"RolesHelp_Shapeshifter_01": 1600,
"RolesHelp_Shapeshifter_02": 1601,
"RolesHelp_Phantom_01": 1602,
"RolesHelp_Phantom_02": 1603,
"RolesHelpOutro_01": 1650,
"RolesHelpOutro_02": 1651,
"NoisemakerRole": 1660,
"NoisemakerBlurb": 1661,
"NoisemakerBlurbMed": 1662,
"NoisemakerBlurbLong": 1663,
"NoisemakerImpostorAlert": 1664,
"NoisemakerAlertDuration": 1665,
"PhantomAbility": 1670,
"PhantomRole": 1671,
"PhantomBlurb": 1672,
"PhantomBlurbMed": 1673,
"PhantomBlurbLong": 1674,
"PhantomCooldown": 1675,
"PhantomDuration": 1676,
"PhantomAbilityUndo": 1677,
"TrackerAbility": 1680,
"TrackerRole": 1681,
"TrackerBlurb": 1682,
"TrackerBlurbMed": 1683,
"TrackerBlurbLong": 1684,
"TrackerCooldown": 1685,
"TrackerDuration": 1686,
"TrackerAbilityUndo": 1687,
"TrackerDelay": 1688,
"SanctionDuration": 1700,
"SanctionPermanent": 1701,
"SanctionConduct": 1702,
@@ -626,14 +596,6 @@
"SanctionSelfHarmPromotion": 1720,
"SanctionRepeatOffender10": 1721,
"SanctionUnknown": 1722,
"ReplicatorAbility": 1800,
"ReplicatorRole": 1801,
"ReplicatorBlurb": 1802,
"ReplicatorBlurbMed": 1803,
"ReplicatorBlurbLong": 1804,
"ReplicatorCooldown": 1805,
"ReplicatorDuration": 1806,
"ReplicatorQuantity": 1807,
"ScreenShakeOption": 1900,
"FeaturedItems": 1901,
"FeaturedBundles": 1902,
@@ -1341,24 +1303,6 @@
"ConfirmDeleteAccountsEmpty": 3209,
"AccountRequestDelete": 3210,
"HasBeenKilled": 3211,
"RoomSettingsLabel": 3280,
"ViewLabel": 3281,
"RoomCodeLabel": 3282,
"ModeLabel": 3283,
"PrivacyLabel": 3284,
"CapacityLabel": 3285,
"GameSettingsLabel": 3286,
"RoleSettingsLabel": 3287,
"GamePresetsLabel": 3288,
"GamePresetsDescription": 3289,
"StandardRulesPresetDescription": 3290,
"GameModeStandard": 3291,
"GameModeStandardRoles": 3292,
"GameModeCustom": 3293,
"ReturnToLobby": 3294,
"GameModeFlashlight": 3295,
"HostNounLabel": 3296,
"RoleSettingsAll": 3297,
"ScrollList": 3300,
"ScrollNews": 3301,
"AmongUsAnnouncements": 3302,
@@ -1384,42 +1328,6 @@
"FriendsLabel": 3322,
"ReportNotificationHeader": 3323,
"ReportNotificationBody": 3324,
"MissingGuardianEmailText": 3325,
"AprilFoolsModeToggle": 3326,
"LobbyChangeSettingNotification": 3327,
"LoadingBarLoading": 3328,
"LoadingBarGameStart": 3329,
"LoadingBarGameStartWaitingPlayers": 3330,
"ImpostorsCategory": 3350,
"RolesCategory": 3351,
"MeetingsCategory": 3352,
"PlayersCategory": 3353,
"TasksCategory": 3354,
"GameSettingsDescription": 3355,
"RoleSettingsDescription": 3356,
"InfoLabel": 3357,
"RoleQuotaLabel": 3358,
"OverviewCategory": 3359,
"CrewmateRolesHeader": 3360,
"ImpostorRolesHeader": 3361,
"ViewingLabel": 3362,
"LocalLobbyLabel": 3363,
"NumberRoleHeader": 3364,
"ChanceRoleHeader": 3365,
"WaitingForPlayers": 3366,
"HideAndSeekModeDescription": 3367,
"RolesRulesPresetDescription": 3368,
"FlashlightRulesPresetDescription": 3369,
"RoomCodeCopied": 3370,
"FinalHideCategory": 3371,
"LobbyChangeSettingNotificationRole": 3372,
"StandardRulesPresetDescriptionHideAndSeek": 3373,
"GameModeStandardSeek": 3374,
"HostYouLabel": 3375,
"GamePresetsPopupTitle": 3376,
"GamePresetsPopupText": 3377,
"GamePresetsPopupContinue": 3378,
"GamePresetsPopupBack": 3379,
"MiningPit": 3400,
"Jungle": 3401,
"BuildSandcastle": 3402,
@@ -1454,9 +1362,6 @@
"CookFish": 3431,
"PrepVegetables": 3432,
"MushroomMixupName": 3433,
"EosAccountSilentMergeFail": 3434,
"AskForEosAccount": 3435,
"KwsCreateFail": 3436,
"GameType": 3500,
"GameTypeError": 3501,
"GameTypeClassic": 3502,
@@ -1490,199 +1395,5 @@
"HttpErrorInternalServerError": 3530,
"HttpErrorBadGateway": 3531,
"HttpErrorServiceUnavailable": 3532,
"HttpErrorGatewayTimeout": 3533,
"UserVersionError": 3534,
"QCLobbyRoleNoisemakers": 3535,
"QCLobbyRoleTrackers": 3536,
"QCLobbyRolePhantoms": 3537,
"QCSelfWasTracking": 3538,
"QCSelfGoingToNoisemaker": 3539,
"QCSelfSawRoleInLocation": 3540,
"QCCoreSettings": 3541,
"QCRolesGalore": 3542,
"QCPitchDark": 3543,
"QCFlashlight": 3544,
"QCPleaseWait": 3545,
"QCWaitMinute": 3546,
"QCLobbyClosing": 3547,
"QCChangeCosmetics": 3548,
"QCWaitingPlayers": 3549,
"QCLetsWaitPlayers": 3550,
"ServerLabel": 3551,
"JoinLobby": 3552,
"ChatLabel": 3553,
"ToolTipDefault": 3554,
"LevelLabel": 3555,
"NoneLowercaseLabel": 3556,
"ToolTipClassic": 3557,
"ToolTipHide": 3558,
"ToolTipMap": 3559,
"ToolTipCapacity": 3560,
"ToolTipLevel": 3561,
"ToolTipServer": 3562,
"ToolTipCrossplay": 3563,
"ToolTipNoCrossplay": 3564,
"ToolTipLanguage": 3565,
"ConfirmSettings": 3566,
"ConfirmSettingsTooltip": 3567,
"EnterCodeElipsis": 3568,
"ToolTipChatTab": 3569,
"DropshipsLabel": 3570,
"FiltersActive": 3571,
"ClearFilters": 3572,
"MoreLabel": 3573,
"HostNounEmpty": 3574,
"ToolTipSkeld": 3575,
"ToolTipMIRA": 3576,
"ToolTipPolus": 3577,
"ToolTipAirship": 3578,
"ToolTipFungle": 3579,
"FilterLow": 3580,
"FilterMed": 3581,
"FilterHigh": 3582,
"FilterVeryHigh": 3583,
"FilterLong": 3584,
"FilterNone": 3585,
"FilterPlayerLevel": 3586,
"RefreshLabel": 3587,
"JoinGameLabel": 3588,
"FilterClearText": 3589,
"MatchesFoundLabel": 3590,
"FilterGameTooltip": 3591,
"FilterMapTooltip": 3592,
"FilterImpostorTooltip": 3593,
"FilterRoleTooltip": 3594,
"FilterSpeedTooltip": 3595,
"FilterKillCDTooltip": 3596,
"FilterVotingTooltip": 3597,
"FilterVisualTaskTooltip": 3598,
"FilterAnonVotesTooltip": 3599,
"FilterConfirmEjectTooltip": 3600,
"FilterLevelTooltip": 3601,
"FilterCrossplayTooltip": 3602,
"FilterDefaultTooltip": 3603,
"FilterFlashlightTooltip": 3604,
"FilterHidingTimeTooltip": 3605,
"FilterFinalTimeTooltip": 3606,
"FilterMaxVentTooltip": 3607,
"FilterBeginner": 3608,
"FilterIntermediate": 3609,
"FilterExpert": 3610,
"FilterTag": 3611,
"FilterTagTooltip": 3612,
"TooltipTag": 3613,
"SelectedLabel": 3614,
"TooltipSpeedInfo": 3615,
"TooltipKillCDInfo": 3616,
"TooltipVotingInfo": 3617,
"TooptipHidingTimeInfo": 3618,
"TooltipFinalTimeInfo": 3619,
"FilterNoMaps": 3620,
"MaxFilters": 3621,
"XboxCommsMultiplayerError": 3700,
"XboxCommsUGError": 3701,
"XboxCommsCreateGameError": 3702,
"XboxCommsSearchError": 3703,
"XboxCommsJoinError": 3704,
"WatchAdBody": 3800,
"WatchAdTitle": 3801,
"WatchAd": 3802,
"RewardAdTitle": 3803,
"RewardAdBody1": 3804,
"RewardAdBody2": 3805,
"WatchAdErrorBody": 3806,
"WatchAdErrorTitle": 3807,
"DetectiveRole": 4000,
"DetectiveAbility": 4001,
"DetectiveAbilityNotes": 4002,
"DetectiveBlurb": 4003,
"DetectiveBlurbMed": 4004,
"DetectiveBlurbLong": 4005,
"DetectiveNotesEmpty": 4006,
"DetectiveNotesFoundDead": 4007,
"DetectiveNotesSuspectInfo": 4008,
"DetectiveNearLocation": 4009,
"DetectiveNotesKiller": 4010,
"StatsDetectiveQuestioned": 4011,
"StatsDetectiveCasesFilled": 4012,
"DetectiveSuspectLimit": 4013,
"RolesHelp_Detective_01": 4014,
"RolesHelp_Detective_02": 4015,
"ViperRole": 4037,
"ViperBlurb": 4038,
"ViperBlurbMed": 4039,
"ViperBlurbLong": 4040,
"ViperDissolveTime": 4041,
"ViperAbility": 4042,
"StatsViperBodiesDissolved": 4043,
"RolesHelp_Viper_01": 4044,
"RolesHelp_Viper_02": 4045,
"QCWhereWasDead": 4060,
"QCInterrogateCrew": 4061,
"QCInterrogated": 4062,
"QCBodyDissolved": 4063,
"QCBodyVeryDissolved": 4064,
"QCBodyAlmostDissolved": 4065,
"QCDetectives": 4066,
"QCVipers": 4067,
"DetectiveNotesTitleVictim": 4068,
"DetectiveNotesTitleFoundDead": 4069,
"DetectiveNotesTitleKiller": 4070,
"DetectiveNotesTitleSuspects": 4071,
"DetectiveNotesTitleLocationsAtTimeOfDeath": 4072,
"DetectiveNotesPromptPreposition": 4073,
"DetectiveNotesPromptLocation": 4074,
"DetectiveNotesPromptImpostor": 4075,
"DetectiveNotesPromptSuspect": 4076,
"DetectiveNotesPrepositionIn": 4077,
"DetectiveNotesPrepositionBy": 4078,
"DetectiveNotesPrepositionMaybe": 4079,
"DetectiveNotesTitlePostIt": 4080,
"DetectiveNotesPostIt": 4081,
"DetectiveNotesSuspectNumber": 4082,
"AprilFoolsMode": 4083,
"MatchInfoGuideTitle": 4084,
"MatchInfoGuidePlayersLabel": 4085,
"MatchInfoGuideNoRolesMessage": 4086,
"JudgeRole": 4090,
"JudgeAbility": 4091,
"JudgeBlurb": 4092,
"JudgeBlurbMed": 4093,
"JudgeBlurbLong": 4094,
"JudgeTaskRequirement": 4095,
"RolesHelp_Judge_01": 4096,
"RolesHelp_Judge_02": 4097,
"JudgeAbilityUnlocked": 4098,
"JudgeAbilityProgress": 4099,
"JudgeCourtAdjourned": 4100,
"JudgeHasSpoken": 4101,
"StatsJudgeSuccessfulOverrules": 4102,
"StatsJudgeFailedOverrules": 4103,
"QCJudges": 4104,
"QCJudgeOverrule": 4105,
"QCJudgePlease": 4106,
"QCJudgeWillOverrule": 4107,
"JudgeBeatYouToIt": 4108,
"SpiritGuideRole": 4120,
"SpiritGuideAbility": 4121,
"SpiritGuideBlurb": 4122,
"SpiritGuideBlurbMed": 4123,
"SpiritGuideBlurbLong": 4124,
"SpiritGuideCooldown": 4125,
"SpiritGuideAbilityCancel": 4126,
"SpiritGuideAbilitySend": 4127,
"SpiritGuideAbilityRefresh": 4128,
"StatsSpiritGuideSentMessage": 4129,
"RolesHelp_SpiritGuide_01": 4130,
"RolesHelp_SpiritGuide_02": 4131,
"QCInfluencerMessage": 4132,
"QCBecauseInfluencer": 4133,
"QCAnyInfluencerMessage": 4134,
"QCInfluencers": 4135,
"RedeemCodeLabel": 4200,
"CodeLengthLabel": 4201,
"CodeErrorLabel": 4202,
"CodeAlreadyRedeemedLabel": 4203,
"CodeRedeemPopupLabel": 4204,
"HorseModeToggle": 4300
"HttpErrorGatewayTimeout": 3533
}
@@ -1,4 +0,0 @@
{
"Invalid": 0,
"Keywords": 1
}
+3 -3
View File
@@ -1,5 +1,5 @@
{
"dumpostorVersion": "1.0.2-dev",
"gameVersion": "2026.9.29",
"platformType": "StandaloneItch"
"dumpostorVersion": "1.0.0",
"gameVersion": "2023.10.24",
"platformType": "StandaloneSteamPC"
}
@@ -1,93 +1,93 @@
{
"0": {
"room": "Cafeteria",
"position": {
"x": -5.1432004,
"y": 1.3355999
}
},
"1": {
"room": "Cafeteria",
"position": {
"x": 0.708,
"y": -4.992
}
},
"2": {
"room": "Cafeteria",
"position": {
"x": 6.3936,
"y": 1.33848
}
},
"3": {
"room": "Electrical",
"position": {
"x": 9.53616,
"y": -13.416001
}
},
"4": {
"room": "Storage",
"position": {
"x": -1.1316001,
"y": -11.98128
}
},
"5": {
"room": "Storage",
"position": {
"x": 0.70919997,
"y": -8.560801
}
},
"6": {
"1": {
"room": "Storage",
"position": {
"x": 5.268,
"y": -14.2884
}
},
"7": {
"room": "LowerEngine",
"position": {
"x": 14.6808,
"y": -11.472
}
},
"8": {
"room": "LowerEngine",
"position": {
"x": 16.930801,
"y": -8.9664
}
},
"9": {
"room": "UpperEngine",
"position": {
"x": 14.676002,
"y": 1.3406401
}
},
"10": {
"2": {
"room": "UpperEngine",
"position": {
"x": 16.930801,
"y": -2.1276002
}
},
"11": {
"3": {
"room": "Cafeteria",
"position": {
"x": 0.708,
"y": -4.992
}
},
"4": {
"room": "LowerEngine",
"position": {
"x": 14.6808,
"y": -11.472
}
},
"5": {
"room": "UpperEngine",
"position": {
"x": 14.676002,
"y": 1.3406401
}
},
"6": {
"room": "Security",
"position": {
"x": 14.734801,
"y": -5.1417603
}
},
"12": {
"7": {
"room": "Storage",
"position": {
"x": -1.1316001,
"y": -11.98128
}
},
"8": {
"room": "Cafeteria",
"position": {
"x": -5.1432004,
"y": 1.3355999
}
},
"9": {
"room": "Electrical",
"position": {
"x": 9.53616,
"y": -13.416001
}
},
"10": {
"room": "MedBay",
"position": {
"x": 9.1452,
"y": -0.4439999
}
},
"11": {
"room": "LowerEngine",
"position": {
"x": 16.930801,
"y": -8.9664
}
},
"12": {
"room": "Storage",
"position": {
"x": 0.70919997,
"y": -8.560801
}
}
}
@@ -1,11 +1,11 @@
{
"initialSpawnCenter": {
"x": 0.87,
"y": 0.69
"x": -0.72,
"y": 0.62
},
"meetingSpawnCenter": {
"x": 0.87,
"y": 0.69
"x": -0.72,
"y": 0.62
},
"meetingSpawnCenter2": {
"x": 0,
@@ -476,138 +476,5 @@
"usableDistance": 1
}
]
},
"29": {
"type": "NormalPlayerTask",
"taskType": "VentCleaning",
"length": "Short",
"consoles": [
{
"id": 0,
"room": "Admin",
"position": {
"x": -2.544,
"y": -9.955201
},
"usableDistance": 1
},
{
"id": 2,
"room": "Cafeteria",
"position": {
"x": -4.2588,
"y": -0.27600002
},
"usableDistance": 1
},
{
"id": 13,
"room": "Nav",
"position": {
"x": -16.008001,
"y": -6.3840003
},
"usableDistance": 1
},
{
"id": 12,
"room": "Nav",
"position": {
"x": -16.008001,
"y": -3.1680002
},
"usableDistance": 1
},
{
"id": 7,
"room": "Weapons",
"position": {
"x": -8.820001,
"y": 3.3240001
},
"usableDistance": 1
},
{
"id": 10,
"room": "Shields",
"position": {
"x": -9.5232,
"y": -14.337601
},
"usableDistance": 1
},
{
"id": 1,
"room": "Hallway",
"position": {
"x": -9.384,
"y": -6.438
},
"usableDistance": 1
},
{
"id": 3,
"room": "Electrical",
"position": {
"x": 9.7764,
"y": -8.034
},
"usableDistance": 1
},
{
"id": 8,
"room": "Reactor",
"position": {
"x": 20.796001,
"y": -6.9528003
},
"usableDistance": 1
},
{
"id": 11,
"room": "Reactor",
"position": {
"x": 21.876,
"y": -3.0516002
},
"usableDistance": 1
},
{
"id": 9,
"room": "LowerEngine",
"position": {
"x": 15.2508,
"y": -13.656001
},
"usableDistance": 1
},
{
"id": 4,
"room": "UpperEngine",
"position": {
"x": 15.288,
"y": 2.52
},
"usableDistance": 1
},
{
"id": 5,
"room": "Security",
"position": {
"x": 12.534,
"y": -6.9492
},
"usableDistance": 1
},
{
"id": 6,
"room": "MedBay",
"position": {
"x": 10.608001,
"y": -4.176
},
"usableDistance": 1
}
]
}
}
@@ -1,6 +1,6 @@
{
"0": {
"name": "AdminVent (1)",
"name": "AdminVent",
"position": {
"x": -2.544,
"y": -9.955201
@@ -10,7 +10,7 @@
"right": 1
},
"1": {
"name": "BigYVent (1)",
"name": "BigYVent",
"position": {
"x": -9.384,
"y": -6.438
@@ -20,7 +20,7 @@
"right": 2
},
"2": {
"name": "CafeVent (1)",
"name": "CafeVent",
"position": {
"x": -4.2588,
"y": -0.27600002
@@ -30,7 +30,7 @@
"right": 1
},
"3": {
"name": "ElecVent (1)",
"name": "ElecVent",
"position": {
"x": 9.7764,
"y": -8.034
@@ -40,7 +40,7 @@
"right": 6
},
"4": {
"name": "LEngineVent (1)",
"name": "LEngineVent",
"position": {
"x": 15.288,
"y": 2.52
@@ -50,7 +50,7 @@
"right": null
},
"5": {
"name": "SecurityVent",
"name": "LifeSuppVent",
"position": {
"x": 12.534,
"y": -6.9492
@@ -60,7 +60,7 @@
"right": 3
},
"6": {
"name": "MedVent (1)",
"name": "MedVent",
"position": {
"x": 10.608001,
"y": -4.176
@@ -70,7 +70,7 @@
"right": 3
},
"7": {
"name": "WeaponsVent (1)",
"name": "WeaponsVent",
"position": {
"x": -8.820001,
"y": 3.3240001
@@ -80,7 +80,7 @@
"right": 12
},
"8": {
"name": "ReactorVent (1)",
"name": "ReactorVent",
"position": {
"x": 20.796001,
"y": -6.9528003
@@ -90,7 +90,7 @@
"right": null
},
"9": {
"name": "REngineVent (1)",
"name": "REngineVent",
"position": {
"x": 15.2508,
"y": -13.656001
@@ -100,7 +100,7 @@
"right": null
},
"10": {
"name": "ShieldsVent (1)",
"name": "ShieldsVent",
"position": {
"x": -9.5232,
"y": -14.337601
@@ -110,7 +110,7 @@
"right": null
},
"11": {
"name": "UpperReactorVent (1)",
"name": "UpperReactorVent",
"position": {
"x": 21.876,
"y": -3.0516002
@@ -120,7 +120,7 @@
"right": null
},
"12": {
"name": "NavVentNorth (1)",
"name": "NavVentNorth",
"position": {
"x": -16.008001,
"y": -3.1680002
@@ -130,7 +130,7 @@
"right": 7
},
"13": {
"name": "NavVentSouth (1)",
"name": "NavVentSouth",
"position": {
"x": -16.008001,
"y": -6.3840003
@@ -1,37 +0,0 @@
{
"hatIds": [
"hat_pk04_beanie",
"hat_pk05_Cheese",
"hat_pk05_Cherry",
"hat_Chocolate",
"hat_Zipper",
"hat_pk02_Crown",
"hat_babybean",
"hat_Sorry",
"hat_mareLwyd",
"hat_fishingHat",
"hat_schnapp",
"hat_pk03_Traffic",
"hat_Pot",
"hat_AbominalHat",
"hat_tombstone",
"hat_pk04_MiniCrewmate",
"hat_pk05_Wizardhat",
"hat_pk05_Ellryhat",
"hat_pk05_EllieToppat"
],
"visorIds": [
"visor_pk01_AngeryVisor",
"visor_pk01_DumStickerVisor",
"visor_vr_Vr-Black",
"visor_pk01_PaperMaskVisor",
"visor_wash"
],
"petIds": [
"pet_YuleGoatPet",
"pet_HamPet",
"pet_Lava",
"pet_Snow",
"pet_Bush"
]
}
File diff suppressed because it is too large. Load diff
@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class BoolGameFilter : ISubFilter
{
[JsonPropertyName("FilterType")]
public string FilterType { get; } = "bool";
[JsonPropertyName("AcceptedValues")]
public required List<bool> AcceptedValues { get; set; }
[JsonPropertyName("OptionEnum")]
public required BoolOptionNames OptionEnum { get; set; }
}
}
@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class CategorizedGameFilter : ISubFilter
{
[JsonPropertyName("FilterType")]
public string FilterType { get; } = "cat";
[JsonPropertyName("AcceptedValues")]
public required List<int> AcceptedValues { get; set; }
[JsonPropertyName("OptionEnum")]
public required CategorizedOptionNames OptionEnum { get; set; }
}
}
@@ -1,15 +0,0 @@
using System;
using System.Text.Json.Serialization;
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class ChatModeGameFilter : ISubFilter
{
[JsonPropertyName("FilterType")]
public string FilterType { get; } = "chat";
[JsonPropertyName("AcceptedValues")]
public required byte AcceptedValues { get; set; }
}
}
@@ -1,87 +0,0 @@
using System;
using System.Runtime.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class GameFilter
{
[JsonConstructor]
public GameFilter(string optionType, string key, string subFilterString)
{
this.OptionType = optionType;
this.Key = key;
this.SubFilterString = subFilterString;
this.SubFilter = ResolveSubFilter(OptionType, SubFilterString);
}
[JsonIgnore]
public ISubFilter SubFilter { get; set; }
[JsonPropertyName("OptionType")]
public required string OptionType { get; set; }
[JsonPropertyName("Key")]
public required string Key { get; set; }
[JsonPropertyName("SubFilterString")]
public required string SubFilterString { get; set; }
public void ModifySubFilter(ISubFilter subFilter)
{
this.SubFilter = subFilter;
}
[OnSerializing]
internal void OnSerializing(StreamingContext context)
{
this.SubFilterString = JsonSerializer.Serialize(this.SubFilter);
}
[OnDeserialized]
internal void OnDeserialized(StreamingContext context)
{
this.SubFilter = this.ResolveSubFilter(this.OptionType, this.SubFilterString);
}
private ISubFilter ResolveSubFilter(string type, string filterString)
{
if (type != null)
{
switch (type.ToLower())
{
case "int":
return JsonSerializer.Deserialize<IntGameFilter>(filterString)
?? throw new InvalidOperationException("Deserialization returned null for IntGameFilter");
case "platform":
return JsonSerializer.Deserialize<PlatformGameFilter>(filterString)
?? throw new InvalidOperationException("Deserialization returned null for PlatformGameFilter");
case "cat":
return JsonSerializer.Deserialize<CategorizedGameFilter>(filterString)
?? throw new InvalidOperationException("Deserialization returned null for CategorizedGameFilter");
case "languages":
return JsonSerializer.Deserialize<LanguageFilter>(filterString)
?? throw new InvalidOperationException("Deserialization returned null for LanguageFilter");
case "chat":
return JsonSerializer.Deserialize<ChatModeGameFilter>(filterString)
?? throw new InvalidOperationException("Deserialization returned null for ChatModeGameFilter");
case "map":
return JsonSerializer.Deserialize<MapGameFilter>(filterString)
?? throw new InvalidOperationException("Deserialization returned null for MapGameFilter");
case "bool":
return JsonSerializer.Deserialize<BoolGameFilter>(filterString)
?? throw new InvalidOperationException("Deserialization returned null for BoolGameFilter");
case "mod":
return JsonSerializer.Deserialize<ModFilter>(filterString)
?? throw new InvalidOperationException("Deserialization returned null for ModFilter");
default:
throw new InvalidOperationException("No type matches subfilter");
}
}
throw new InvalidOperationException("Must provide type for sub filter");
}
}
}
@@ -1,23 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class GameFilterSet
{
[JsonConstructor]
public GameFilterSet(GameModes gameMode, List<GameFilter> filters)
{
GameMode = gameMode;
Filters = filters;
}
[JsonPropertyName("GameMode")]
public required GameModes GameMode { get; set; }
[JsonPropertyName("Filters")]
public required List<GameFilter> Filters { get; set; }
}
}
@@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class GameFiltersList
{
[JsonPropertyName("FilterSets")]
public required List<GameFilterSet> FilterSets { get; set; }
}
}
@@ -1,7 +0,0 @@
namespace Impostor.Api.Innersloth.GameFilters
{
public interface ISubFilter
{
string FilterType { get; }
}
}
@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class IntGameFilter : ISubFilter
{
[JsonPropertyName("FilterType")]
public string FilterType { get; } = "int";
[JsonPropertyName("AcceptedValues")]
public required List<int> AcceptedValues { get; set; }
[JsonPropertyName("OptionEnum")]
public required Int32OptionNames OptionEnum { get; set; }
}
}
@@ -1,15 +0,0 @@
using System;
using System.Text.Json.Serialization;
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class LanguageFilter : ISubFilter
{
[JsonPropertyName("FilterType")]
public string FilterType { get; } = "languages";
[JsonPropertyName("AcceptedValues")]
public required uint AcceptedValues { get; set; }
}
}
@@ -1,15 +0,0 @@
using System;
using System.Text.Json.Serialization;
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class MapGameFilter : ISubFilter
{
[JsonPropertyName("FilterType")]
public string FilterType { get; } = "map";
[JsonPropertyName("AcceptedValues")]
public required byte AcceptedValues { get; set; }
}
}
@@ -1,16 +0,0 @@
using System;
using System.Text.Json.Serialization;
// https://github.com/Innersloth-LLC/AmongUsModdingInformation
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class ModFilter : ISubFilter
{
[JsonPropertyName("FilterType")]
public string FilterType { get; } = "mod";
[JsonPropertyName("AcceptedValues")]
public required Guid AcceptedValues { get; set; }
}
}
@@ -1,15 +0,0 @@
using System;
using System.Text.Json.Serialization;
namespace Impostor.Api.Innersloth.GameFilters
{
[Serializable]
public class PlatformGameFilter : ISubFilter
{
[JsonPropertyName("FilterType")]
public string FilterType { get; } = "platform";
[JsonPropertyName("AcceptedValues")]
public required uint AcceptedValues { get; set; }
}
}
-2
View File
@@ -5,7 +5,5 @@ namespace Impostor.Api.Innersloth
None,
Normal,
HideNSeek,
NormalFools,
SeekFools,
}
}
@@ -39,8 +39,8 @@ public static class GameOptionsFactory
return gameMode switch
{
GameModes.Normal or GameModes.NormalFools => NormalGameOptions.Deserialize(optionsReader, version),
GameModes.HideNSeek or GameModes.SeekFools => HideNSeekGameOptions.Deserialize(optionsReader, version),
GameModes.Normal => NormalGameOptions.Deserialize(optionsReader, version),
GameModes.HideNSeek => HideNSeekGameOptions.Deserialize(optionsReader, version),
_ => throw new ArgumentOutOfRangeException(),
};
}
@@ -62,11 +62,9 @@ public static class GameOptionsFactory
switch (gameMode)
{
case GameModes.Normal:
case GameModes.NormalFools:
((NormalGameOptions)gameOptions).Deserialize(optionsReader);
break;
case GameModes.HideNSeek:
case GameModes.SeekFools:
((HideNSeekGameOptions)gameOptions).Deserialize(optionsReader);
break;
default:
@@ -1,14 +0,0 @@
namespace Impostor.Api.Innersloth.GameOptions;
// TODO: generate this enum based on game data
/// <summary>
/// Tag that can be added to indicate the expected skill level of players in this lobby.
/// </summary>
public enum GameTags
{
None = 0,
Beginner = 1,
Intermediate = 2,
Expert = 3,
}
@@ -2,7 +2,7 @@ namespace Impostor.Api.Innersloth.GameOptions;
public class HideNSeekGameOptions : IGameOptions
{
public const int LatestVersion = 12;
public const int LatestVersion = 7;
public HideNSeekGameOptions(byte version = LatestVersion)
{
@@ -16,12 +16,6 @@ public class HideNSeekGameOptions : IGameOptions
/// <inheritdoc />
public GameModes GameMode => GameModes.HideNSeek;
/// <inheritdoc />
public SpecialGameModes SpecialMode { get; set; } = SpecialGameModes.None;
/// <inheritdoc />
public RulesPresets RulesPreset { get; set; } = RulesPresets.Custom;
/// <inheritdoc />
public byte MaxPlayers { get; set; } = 15;
@@ -93,11 +87,6 @@ public class HideNSeekGameOptions : IGameOptions
public float MaxPingTime { get; set; } = 6f;
/// <summary>
/// Gets or sets the experience level of people in the lobby: Beginner, Intermediate or Expert.
/// </summary>
public GameTags Tag { get; set; } = 0;
public static HideNSeekGameOptions Deserialize(IMessageReader reader, byte version)
{
var options = new HideNSeekGameOptions(version);
@@ -107,17 +96,6 @@ public class HideNSeekGameOptions : IGameOptions
public void Deserialize(IMessageReader reader)
{
if (Version > LatestVersion)
{
IGameOptions.ThrowUnknownVersion<HideNSeekGameOptions>(Version);
}
if (Version >= 8)
{
SpecialMode = (SpecialGameModes)reader.ReadByte();
RulesPreset = (RulesPresets)reader.ReadByte();
}
MaxPlayers = reader.ReadByte();
Keywords = (GameKeywords)reader.ReadInt32();
Map = (MapTypes)reader.ReadByte();
@@ -143,20 +121,14 @@ public class HideNSeekGameOptions : IGameOptions
MaxPingTime = reader.ReadSingle();
CrewmateTimeInVent = reader.ReadSingle();
if (Version >= 9)
if (Version > 7)
{
Tag = (GameTags)reader.ReadByte();
IGameOptions.ThrowUnknownVersion<HideNSeekGameOptions>(Version);
}
}
public void Serialize(IMessageWriter writer)
{
if (Version >= 8)
{
writer.Write((byte)SpecialMode);
writer.Write((byte)RulesPreset);
}
writer.Write(MaxPlayers);
writer.Write((uint)Keywords);
writer.Write((byte)Map);
@@ -182,12 +154,7 @@ public class HideNSeekGameOptions : IGameOptions
writer.Write(MaxPingTime);
writer.Write(CrewmateTimeInVent);
if (Version >= 9)
{
writer.Write((byte)Tag);
}
if (Version > LatestVersion)
if (Version > 7)
{
IGameOptions.ThrowUnknownVersion<HideNSeekGameOptions>(Version);
}
@@ -10,20 +10,10 @@ public interface IGameOptions
public byte Version { get; }
/// <summary>
/// Gets the currently active gamemode. This is currently used for the Normal and HideAndSeek gamemodes.
/// Gets the currently active gamemode.
/// </summary>
public GameModes GameMode { get; }
/// <summary>
/// Gets the currently active special gamemode. This is currently used for the AprilFools gamemode.
/// </summary>
public SpecialGameModes SpecialMode { get; }
/// <summary>
/// Gets the rule preset.
/// </summary>
public RulesPresets RulesPreset { get; }
/// <summary>
/// Gets or sets the maximum amount of players for this lobby.
/// </summary>
@@ -49,8 +39,6 @@ public interface IGameOptions
/// </summary>
public bool IsDefaults { get; set; }
public GameTags Tag { get; set; }
public void Serialize(IMessageWriter writer);
public static void EnsureVersionIsModular<TCaller>(byte version)
@@ -21,12 +21,6 @@ public class LegacyGameOptionsData : IGameOptions
public GameModes GameMode => GameModes.Normal;
/// <inheritdoc />
public SpecialGameModes SpecialMode { get; } = SpecialGameModes.None;
/// <inheritdoc />
public RulesPresets RulesPreset { get; } = RulesPresets.Custom;
/// <summary>
/// Gets or sets the maximum amount of players for this lobby.
/// </summary>
@@ -145,8 +139,6 @@ public class LegacyGameOptionsData : IGameOptions
/// </summary>
public bool IsDefaults { get; set; } = true;
public GameTags Tag { get; set; } = 0;
public static LegacyGameOptionsData Deserialize(IMessageReader reader, byte version)
{
var options = new LegacyGameOptionsData(version);
@@ -4,7 +4,7 @@ namespace Impostor.Api.Innersloth.GameOptions;
public class NormalGameOptions : IGameOptions
{
public const int LatestVersion = 12;
public const int LatestVersion = 7;
public NormalGameOptions(byte version = LatestVersion)
{
@@ -19,12 +19,6 @@ public class NormalGameOptions : IGameOptions
/// <inheritdoc />
public GameModes GameMode => GameModes.Normal;
/// <inheritdoc />
public SpecialGameModes SpecialMode { get; set; } = SpecialGameModes.None;
/// <inheritdoc />
public RulesPresets RulesPreset { get; set; } = RulesPresets.Custom;
/// <inheritdoc />
public byte MaxPlayers { get; set; } = 10;
@@ -128,11 +122,6 @@ public class NormalGameOptions : IGameOptions
/// </summary>
public TaskBarUpdate TaskBarUpdate { get; set; } = TaskBarUpdate.Always;
/// <summary>
/// Gets or sets the experience level of people in the lobby: Beginner, Intermediate or Expert.
/// </summary>
public GameTags Tag { get; set; } = 0;
public RoleOptionsCollection RoleOptions { get; set; }
public static NormalGameOptions Deserialize(IMessageReader reader, byte version)
@@ -144,17 +133,6 @@ public class NormalGameOptions : IGameOptions
public void Deserialize(IMessageReader reader)
{
if (Version > LatestVersion)
{
IGameOptions.ThrowUnknownVersion<NormalGameOptions>(Version);
}
if (Version >= 8)
{
SpecialMode = (SpecialGameModes)reader.ReadByte();
RulesPreset = (RulesPresets)reader.ReadByte();
}
MaxPlayers = reader.ReadByte();
Keywords = (GameKeywords)reader.ReadUInt32();
Map = (MapTypes)reader.ReadByte();
@@ -183,22 +161,16 @@ public class NormalGameOptions : IGameOptions
AnonymousVotes = reader.ReadBoolean();
TaskBarUpdate = (TaskBarUpdate)reader.ReadByte();
if (Version >= 9)
{
Tag = (GameTags)reader.ReadByte();
}
RoleOptions.Deserialize(reader);
if (Version > 7)
{
IGameOptions.ThrowUnknownVersion<NormalGameOptions>(Version);
}
}
public void Serialize(IMessageWriter writer)
{
if (Version >= 8)
{
writer.Write((byte)SpecialMode);
writer.Write((byte)RulesPreset);
}
writer.Write(MaxPlayers);
writer.Write((uint)Keywords);
writer.Write((byte)Map);
@@ -227,14 +199,9 @@ public class NormalGameOptions : IGameOptions
writer.Write(AnonymousVotes);
writer.Write((byte)TaskBarUpdate);
if (Version >= 9)
{
writer.Write((byte)Tag);
}
RoleOptions.Serialize(writer);
if (Version > LatestVersion)
if (Version > 7)
{
IGameOptions.ThrowUnknownVersion<NormalGameOptions>(Version);
}
@@ -1,29 +0,0 @@
namespace Impostor.Api.Innersloth.GameOptions.RoleOptions;
public class DetectiveRoleOptions : IRoleOptions
{
public DetectiveRoleOptions(byte version)
{
Version = version;
}
public byte Version { get; }
public RoleTypes Type => RoleTypes.Detective;
public byte DetectiveSuspectLimit { get; set; } = 3;
public static DetectiveRoleOptions Deserialize(IMessageReader reader, byte version)
{
var options = new DetectiveRoleOptions(version);
options.DetectiveSuspectLimit = reader.ReadByte();
return options;
}
public void Serialize(IMessageWriter writer)
{
writer.Write((byte)DetectiveSuspectLimit);
}
}
@@ -1,29 +0,0 @@
namespace Impostor.Api.Innersloth.GameOptions.RoleOptions;
public class JudgeRoleOptions : IRoleOptions
{
public JudgeRoleOptions(byte version)
{
Version = version;
}
public byte Version { get; }
public RoleTypes Type => RoleTypes.Judge;
public float JudgeTaskRequirementPercentage { get; set; } = 50f;
public static JudgeRoleOptions Deserialize(IMessageReader reader, byte version)
{
var options = new JudgeRoleOptions(version);
options.JudgeTaskRequirementPercentage = (int)reader.ReadByte();
return options;
}
public void Serialize(IMessageWriter writer)
{
writer.Write((byte)JudgeTaskRequirementPercentage);
}
}
@@ -1,33 +0,0 @@
namespace Impostor.Api.Innersloth.GameOptions.RoleOptions;
public class NoisemakerRoleOptions : IRoleOptions
{
public NoisemakerRoleOptions(byte version)
{
Version = version;
}
public byte Version { get; }
public RoleTypes Type => RoleTypes.Noisemaker;
public bool ImpostorAlert { get; set; } = true;
public byte AlertDuration { get; set; } = 10;
public static NoisemakerRoleOptions Deserialize(IMessageReader reader, byte version)
{
var options = new NoisemakerRoleOptions(version);
options.AlertDuration = reader.ReadByte();
options.ImpostorAlert = reader.ReadBoolean();
return options;
}
public void Serialize(IMessageWriter writer)
{
writer.Write(AlertDuration);
writer.Write(ImpostorAlert);
}
}
@@ -1,33 +0,0 @@
namespace Impostor.Api.Innersloth.GameOptions.RoleOptions;
public class PhantomRoleOptions : IRoleOptions
{
public PhantomRoleOptions(byte version)
{
Version = version;
}
public byte Version { get; }
public RoleTypes Type => RoleTypes.Phantom;
public byte Cooldown { get; set; } = 15;
public byte Duration { get; set; } = 30;
public static PhantomRoleOptions Deserialize(IMessageReader reader, byte version)
{
var options = new PhantomRoleOptions(version);
options.Cooldown = reader.ReadByte();
options.Duration = reader.ReadByte();
return options;
}
public void Serialize(IMessageWriter writer)
{
writer.Write(Cooldown);
writer.Write(Duration);
}
}
@@ -16,6 +16,8 @@ public class RoleOptionsCollection
public void Deserialize(IMessageReader reader)
{
Roles.Clear();
var count = reader.ReadPackedInt32();
Roles.EnsureCapacity(count);
for (var i = 0; i < count; i++)
@@ -29,17 +31,10 @@ public class RoleOptionsCollection
RoleTypes.Engineer => EngineerRoleOptions.Deserialize(roleOptionsReader, Version),
RoleTypes.GuardianAngel => GuardianAngelRoleOptions.Deserialize(roleOptionsReader, Version),
RoleTypes.Shapeshifter => ShapeshifterRoleOptions.Deserialize(roleOptionsReader, Version),
RoleTypes.Noisemaker => NoisemakerRoleOptions.Deserialize(roleOptionsReader, Version),
RoleTypes.Phantom => PhantomRoleOptions.Deserialize(roleOptionsReader, Version),
RoleTypes.Tracker => TrackerRoleOptions.Deserialize(roleOptionsReader, Version),
RoleTypes.Detective => DetectiveRoleOptions.Deserialize(roleOptionsReader, Version),
RoleTypes.Viper => ViperRoleOptions.Deserialize(roleOptionsReader, Version),
RoleTypes.Judge => JudgeRoleOptions.Deserialize(roleOptionsReader, Version),
RoleTypes.SpiritGuide => SpiritGuideRoleOptions.Deserialize(roleOptionsReader, Version),
_ => throw new ArgumentOutOfRangeException(nameof(roleType), roleType, null),
};
Roles[roleType] = new RoleData(roleType, roleOptions, roleRate);
Roles.Add(roleType, new RoleData(roleType, roleOptions, roleRate));
}
}
@@ -1,29 +0,0 @@
namespace Impostor.Api.Innersloth.GameOptions.RoleOptions;
public class SpiritGuideRoleOptions : IRoleOptions
{
public SpiritGuideRoleOptions(byte version)
{
Version = version;
}
public byte Version { get; }
public RoleTypes Type => RoleTypes.SpiritGuide;
public float SpiritGuideCooldownSeconds { get; set; } = 20f;
public static SpiritGuideRoleOptions Deserialize(IMessageReader reader, byte version)
{
var options = new SpiritGuideRoleOptions(version);
options.SpiritGuideCooldownSeconds = reader.ReadByte();
return options;
}
public void Serialize(IMessageWriter writer)
{
writer.Write((byte)SpiritGuideCooldownSeconds);
}
}
@@ -1,37 +0,0 @@
namespace Impostor.Api.Innersloth.GameOptions.RoleOptions;
public class TrackerRoleOptions : IRoleOptions
{
public TrackerRoleOptions(byte version)
{
Version = version;
}
public byte Version { get; }
public RoleTypes Type => RoleTypes.Tracker;
public byte Cooldown { get; set; } = 15;
public byte Duration { get; set; } = 30;
public byte Delay { get; set; } = 1;
public static TrackerRoleOptions Deserialize(IMessageReader reader, byte version)
{
var options = new TrackerRoleOptions(version);
options.Cooldown = reader.ReadByte();
options.Duration = reader.ReadByte();
options.Delay = reader.ReadByte();
return options;
}
public void Serialize(IMessageWriter writer)
{
writer.Write(Cooldown);
writer.Write(Duration);
writer.Write(Delay);
}
}
@@ -1,29 +0,0 @@
namespace Impostor.Api.Innersloth.GameOptions.RoleOptions;
public class ViperRoleOptions : IRoleOptions
{
public ViperRoleOptions(byte version)
{
Version = version;
}
public byte Version { get; }
public RoleTypes Type => RoleTypes.Viper;
public byte ViperDissolveTime { get; set; } = 15;
public static ViperRoleOptions Deserialize(IMessageReader reader, byte version)
{
var options = new ViperRoleOptions(version);
options.ViperDissolveTime = reader.ReadByte();
return options;
}
public void Serialize(IMessageWriter writer)
{
writer.Write((byte)ViperDissolveTime);
}
}
@@ -14,7 +14,6 @@ public abstract class MapData
[MapTypes.Skeld] = new SkeldData(),
[MapTypes.MiraHQ] = new MiraData(),
[MapTypes.Polus] = new PolusData(),
[MapTypes.Dleks] = new AprilData(),
[MapTypes.Airship] = new AirshipData(),
[MapTypes.Fungle] = new FungleData(),
}.AsReadOnly();
+1 -21
View File
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Impostor.Api.Innersloth;
@@ -8,7 +7,7 @@ namespace Impostor.Api.Net
/// <summary>
/// Represents a connected game client.
/// </summary>
public interface IClient : IEquatable<IClient>
public interface IClient
{
/// <summary>
/// Gets or sets the unique ID of the client.
@@ -60,22 +59,6 @@ namespace Impostor.Api.Net
/// </remarks>
IDictionary<object, object> Items { get; }
/// <summary>
/// Gets or sets the friendcode of the player.
/// </summary>
/// <remarks>
/// Impostor's HTTP server does not resolve friendcodes, so this value will remain null unless a plugin has written a value in this field.
/// </remarks>
string? FriendCode { get; set; }
/// <summary>
/// Gets or sets the puid of the player.
/// </summary>
/// <remarks>
/// Impostor's HTTP server does not resolve puids, so this value will remain null unless a plugin has written a value in this field.
/// </remarks>
string? Puid { get; set; }
/// <summary>
/// Gets the current game data of the <see cref="IClient" />.
/// </summary>
@@ -91,9 +74,6 @@ namespace Impostor.Api.Net
/// </summary>
PlatformSpecificData PlatformSpecificData { get; }
ValueTask<bool> ReportCheatAsync(CheatContext context, CheatCategory category, string message);
[Obsolete("Please use the overload that adds a cheat category")]
ValueTask<bool> ReportCheatAsync(CheatContext context, string message);
ValueTask HandleMessageAsync(IMessageReader message, MessageType messageType);
+1 -1
View File
@@ -1,4 +1,4 @@
using System.Threading.Tasks;
using System.Threading.Tasks;
using Impostor.Api.Games;
using Impostor.Api.Net.Inner;
using Impostor.Api.Net.Inner.Objects;
@@ -1,6 +1,6 @@
namespace Impostor.Api.Net.Inner.Objects
{
public interface IInnerGameData
public interface IInnerGameData : IInnerNetObject
{
}
}
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Impostor.Api.Events.Player;
@@ -6,24 +6,6 @@ namespace Impostor.Api.Net.Inner.Objects
{
public interface IInnerMeetingHud : IInnerNetObject
{
public interface IJudgeOverrule
{
/// <summary>
/// Gets the player id of the Judge that queued this overrule.
/// </summary>
byte JudgePlayerId { get; }
/// <summary>
/// Gets the player id of the player the Judge wants to overrule.
/// </summary>
byte OverruledPlayerId { get; }
/// <summary>
/// Gets the overrule nonce used to match this overrule to the voting result.
/// </summary>
ushort OverruleNonce { get; }
}
public interface IPlayerVoteArea
{
/// <summary>
@@ -73,10 +55,5 @@ namespace Impostor.Api.Net.Inner.Objects
/// Gets the player that started the meeting.
/// </summary>
IInnerPlayerInfo? Reporter { get; }
/// <summary>
/// Gets the Judge overrules queued in this meeting.
/// </summary>
IReadOnlyCollection<IJudgeOverrule> JudgeOverrules { get; }
}
}
@@ -1,4 +1,3 @@
using System;
using System.Threading.Tasks;
using Impostor.Api.Innersloth;
using Impostor.Api.Innersloth.Customization;
@@ -29,14 +28,13 @@ namespace Impostor.Api.Net.Inner.Objects
/// Gets the <see cref="IInnerPlayerInfo" /> of the <see cref="IInnerPlayerControl" />.
/// Contains metadata about the player.
/// </summary>
IInnerPlayerInfo? PlayerInfo { get; }
IInnerPlayerInfo PlayerInfo { get; }
/// <summary>
/// Sets the name of the current <see cref="IInnerPlayerControl" />.
/// Visible to all players.
/// </summary>
/// <param name="name">A name for the player.</param>
/// <exception cref="ImpostorProtocolException">Thrown when player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask SetNameAsync(string name);
@@ -45,7 +43,6 @@ namespace Impostor.Api.Net.Inner.Objects
/// Visible to all players.
/// </summary>
/// <param name="colorType">A color for the player.</param>
/// <exception cref="ImpostorProtocolException">Thrown when player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask SetColorAsync(ColorType colorType);
@@ -54,7 +51,6 @@ namespace Impostor.Api.Net.Inner.Objects
/// Visible to all players.
/// </summary>
/// <param name="hatId">An hat for the player.</param>
/// <exception cref="ImpostorProtocolException">Thrown when player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask SetHatAsync(string hatId);
@@ -63,7 +59,6 @@ namespace Impostor.Api.Net.Inner.Objects
/// Visible to all players.
/// </summary>
/// <param name="petId">A pet for the player.</param>
/// <exception cref="ImpostorProtocolException">Thrown when player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask SetPetAsync(string petId);
@@ -72,26 +67,9 @@ namespace Impostor.Api.Net.Inner.Objects
/// Visible to all players.
/// </summary>
/// <param name="skinId">A skin for the player.</param>
/// <exception cref="ImpostorProtocolException">Thrown when player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask SetSkinAsync(string skinId);
/// <summary>
/// Sets the visor of the current <see cref="IInnerPlayerControl" />.
/// Visible to all players.
/// </summary>
/// <param name="visorId">A visor for the player.</param>
/// <returns>Task that must be awaited.</returns>
ValueTask SetVisorAsync(string visorId);
/// <summary>
/// Sets the nameplate of the current <see cref="IInnerPlayerControl" />.
/// Visible to all players.
/// </summary>
/// <param name="nameplateId">A nameplate for the player.</param>
/// <returns>Task that must be awaited.</returns>
ValueTask SetNamePlateAsync(string nameplateId);
/// <summary>
/// Send a chat message as the current <see cref="IInnerPlayerControl" />.
/// Visible to all players.
@@ -120,60 +98,32 @@ namespace Impostor.Api.Net.Inner.Objects
/// <exception cref="ImpostorProtocolException">Thrown when player is not the impostor.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when player is dead.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when target is dead.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when player or target player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask MurderPlayerAsync(IInnerPlayerControl target, MurderResultFlags result);
/// <summary>
/// Murder <paramref name="target" /> player.
/// </summary>
/// <param name="target">Target player to murder.</param>
/// <param name="result">The result of the murder operation.</param>
/// <returns>Task that must be awaited.</returns>
ValueTask ForceMurderPlayerAsync(IInnerPlayerControl target, MurderResultFlags result);
/// <summary>
/// Murder <paramref name="target" /> player after validating if this is a valid kill.
/// Murder <paramref name="target" /> player successfully.
/// </summary>
/// <param name="target">Target player to murder.</param>
/// <exception cref="ImpostorProtocolException">Thrown when player is not the impostor.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when player is dead.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when target is dead.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when player or target player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
[Obsolete("Please switch to version with the MurderResultFlags argument")]
ValueTask MurderPlayerAsync(IInnerPlayerControl target);
/// <summary>
/// Protect <paramref name="target" /> player.
/// </summary>
/// <param name="target">Target player to protect.</param>
/// <exception cref="ImpostorProtocolException">Thrown when target is dead.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when player or target player doesn't have a PlayerInfo.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when target is a guardian angel.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask ProtectPlayerAsync(IInnerPlayerControl target);
/// <summary>
/// Protect <paramref name="target" /> player.
/// </summary>
/// <param name="target">Target player to protect.</param>
/// <returns>Task that must be awaited.</returns>
ValueTask ForceProtectPlayerAsync(IInnerPlayerControl target);
/// <summary>
/// Exile the current player. This doesn't produce a body to be reported.
/// Visible to all players.
/// </summary>
/// <exception cref="ImpostorProtocolException">Thrown if player to be exiled is already dead.</exception>
/// <exception cref="ImpostorProtocolException">Thrown when player or target player doesn't have a PlayerInfo.</exception>
/// <returns>Task that must be awaited.</returns>
ValueTask ExileAsync();
/// <summary>
/// Exile the current player. This doesn't produce a body to be reported.
/// Visible to all players.
/// </summary>
/// <returns>Task that must be awaited.</returns>
ValueTask ForceExileAsync();
}
}
@@ -43,21 +43,5 @@ namespace Impostor.Api.Net.Inner.Objects
DateTimeOffset LastMurder { get; }
uint PlayerLevel { get; }
/// <summary>
/// Gets the friendcode of the player.
/// </summary>
/// <remarks>
/// Impostor's HTTP server does not resolve friendcodes, so this value will remain null unless a plugin has written a value on the player's client.
/// </remarks>
string? FriendCode { get; }
/// <summary>
/// Gets the puid of the player.
/// </summary>
/// <remarks>
/// Impostor's HTTP server does not resolve puids, so this value will remain null unless a plugin has written a value on the player's client.
/// </remarks>
string? Puid { get; }
}
}
@@ -1,6 +0,0 @@
namespace Impostor.Api.Net.Inner.Objects.ShipStatus
{
public interface IInnerDleksShipStatus : IInnerShipStatus
{
}
}
@@ -1,4 +1,4 @@
using Impostor.Api.Innersloth;
using Impostor.Api.Innersloth;
using Impostor.Api.Innersloth.GameOptions;
namespace Impostor.Api.Net.Messages.C2S
@@ -1,25 +0,0 @@
using System;
using Impostor.Api.Innersloth;
using Impostor.Api.Innersloth.GameOptions;
namespace Impostor.Api.Net.Messages.C2S
{
/// <summary>
/// Special serialization rules for AU MCI HostGame messages.
/// <see href="https://github.com/Innersloth-LLC/AmongUsModdingInformation?tab=readme-ov-file#all-client-mod-client-identification"/>
/// for more information.
/// </summary>
public static class Message25HostModdedGameC2S
{
public static void Serialize(IMessageWriter writer, IGameOptions gameOptions, CrossplayFlags crossplayFlags, GameFilterOptions gameFilterOptions)
{
Message00HostGameC2S.Serialize(writer, gameOptions, crossplayFlags, gameFilterOptions);
}
public static void Deserialize(IMessageReader reader, out IGameOptions gameOptions, out CrossplayFlags crossplayFlags, out GameFilterOptions gameFilterOptions, out Guid modGuid)
{
Message00HostGameC2S.Deserialize(reader, out gameOptions, out crossplayFlags, out gameFilterOptions);
modGuid = new Guid(reader.ReadBytes(16).Span);
}
}
}
+2 -10
View File
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
@@ -28,9 +28,6 @@ namespace Impostor.Api.Net.Messages
public const byte SetActivePodType = 21;
public const byte QueryPlatformIds = 22;
public const byte QueryLobbyInfo = 23;
public const byte EndGameHostMigration = 24;
public const byte HostModdedGame = 25;
public const byte PackedGameDataTo = 26;
private static readonly Dictionary<byte, string> FlagCache;
@@ -42,14 +39,9 @@ namespace Impostor.Api.Net.Messages
.ToDictionary(x => (byte)x.GetValue(null)!, y => y.Name);
}
/// <summary>
/// Convert a MessageFlag to the corresponding string.
/// </summary>
/// <param name="flag">The MessageFlag to convert.</param>
/// <returns>A string corresponding with the value of flag.</returns>
public static string FlagToString(byte flag)
{
return FlagCache.TryGetValue(flag, out var res) ? res : $"Unknown Flag {flag}";
return FlagCache[flag];
}
}
}
@@ -0,0 +1,22 @@
using Impostor.Api.Innersloth.GameOptions;
namespace Impostor.Api.Net.Messages.Rpcs
{
public static class Rpc02SyncSettings
{
public static void Serialize(IMessageWriter writer, IGameOptions gameOptionsData)
{
GameOptionsFactory.Serialize(writer, gameOptionsData);
}
public static void Deserialize(IMessageReader reader, out IGameOptions gameOptionsData)
{
gameOptionsData = GameOptionsFactory.Deserialize(reader);
}
public static void DeserializeInto(IMessageReader reader, IGameOptions gameOptionsData)
{
GameOptionsFactory.DeserializeInto(reader, gameOptionsData);
}
}
}
@@ -2,15 +2,13 @@ namespace Impostor.Api.Net.Messages.Rpcs
{
public static class Rpc06SetName
{
public static void Serialize(IMessageWriter writer, uint netId, string name)
public static void Serialize(IMessageWriter writer, string name)
{
writer.Write(netId);
writer.Write(name);
}
public static void Deserialize(IMessageReader reader, out uint netId, out string name)
public static void Deserialize(IMessageReader reader, out string name)
{
netId = reader.ReadUInt32();
name = reader.ReadString();
}
}
@@ -4,15 +4,13 @@ namespace Impostor.Api.Net.Messages.Rpcs
{
public static class Rpc08SetColor
{
public static void Serialize(IMessageWriter writer, uint netId, ColorType color)
public static void Serialize(IMessageWriter writer, ColorType color)
{
writer.Write(netId);
writer.Write((byte)color);
}
public static void Deserialize(IMessageReader reader, out uint netId, out ColorType color)
public static void Deserialize(IMessageReader reader, out ColorType color)
{
netId = reader.ReadUInt32();
color = (ColorType)reader.ReadByte();
}
}
@@ -2,8 +2,6 @@ namespace Impostor.Api.Net.Messages.Rpcs
{
public static class Rpc23VotingComplete
{
// Pre 18.0 version
// TODO clean up when 17.4 and below are unsupported
public static void Serialize(IMessageWriter writer, byte[] states, byte playerId, bool tie)
{
writer.WriteBytesAndSize(states);
@@ -11,15 +9,6 @@ namespace Impostor.Api.Net.Messages.Rpcs
writer.Write(tie);
}
public static void Serialize(IMessageWriter writer, byte[] states, byte playerId, bool tie, bool wasOverruled, ushort overrideId)
{
writer.WriteBytesAndSize(states);
writer.Write(playerId);
writer.Write(tie);
writer.Write(wasOverruled);
writer.Write(overrideId);
}
public static void Deserialize(IMessageReader reader, out IMessageReader[] states, out byte playerId, out bool tie)
{
var length = reader.ReadPackedInt32();
@@ -32,21 +21,5 @@ namespace Impostor.Api.Net.Messages.Rpcs
playerId = reader.ReadByte();
tie = reader.ReadBoolean();
}
public static void Deserialize(IMessageReader reader, out IMessageReader[] states, out byte playerId, out bool tie, out bool wasOverruled, out ushort overrideId)
{
var length = reader.ReadPackedInt32();
states = new IMessageReader[length];
for (var i = 0; i < length; i++)
{
states[i] = reader.ReadMessage();
}
playerId = reader.ReadByte();
tie = reader.ReadBoolean();
wasOverruled = reader.ReadBoolean();
overrideId = reader.ReadUInt16();
}
}
}
@@ -4,13 +4,15 @@ namespace Impostor.Api.Net.Messages.Rpcs
{
public static class Rpc29SetTasks
{
public static void Serialize(IMessageWriter writer, ReadOnlyMemory<byte> taskTypeIds)
public static void Serialize(IMessageWriter writer, byte playerId, ReadOnlyMemory<byte> taskTypeIds)
{
writer.Write(playerId);
writer.Write(taskTypeIds);
}
public static void Deserialize(IMessageReader reader, out ReadOnlyMemory<byte> taskTypeIds)
public static void Deserialize(IMessageReader reader, out byte playerId, out ReadOnlyMemory<byte> taskTypeIds)
{
playerId = reader.ReadByte();
taskTypeIds = reader.ReadBytesAndSize();
}
}
Loaded 100 of 192 files, more files were not shown because too many files have changed in this diff. Show more