├── src
├── Impostor.Benchmarks
│ ├── .gitignore
│ ├── Impostor.Benchmarks.csproj
│ ├── Data
│ │ ├── Span
│ │ │ ├── MessageReaderOwner.cs
│ │ │ └── MessageReader_Span.cs
│ │ └── Pool
│ │ │ └── MessageReader_Bytes_Pooled_ImprovedPolicy.cs
│ ├── Program.cs
│ └── Extensions
│ │ └── SpanExtensions.cs
├── .gitignore
├── Impostor.Server
│ ├── icon.ico
│ ├── Net
│ │ ├── Inner
│ │ │ ├── Objects
│ │ │ │ ├── Systems
│ │ │ │ │ ├── IActivatable.cs
│ │ │ │ │ ├── ISystemType.cs
│ │ │ │ │ └── ShipStatus
│ │ │ │ │ │ ├── SecurityCameraSystemType.cs
│ │ │ │ │ │ ├── HudOverrideSystemType.cs
│ │ │ │ │ │ ├── SabotageSystemType.cs
│ │ │ │ │ │ ├── SwitchSystem.cs
│ │ │ │ │ │ ├── MedScanSystem.cs
│ │ │ │ │ │ ├── ReactorSystemType.cs
│ │ │ │ │ │ └── LifeSuppSystemType.cs
│ │ │ │ ├── InnerMeetingHud.Api.cs
│ │ │ │ ├── Components
│ │ │ │ │ ├── InnerPlayerPhysics.Api.cs
│ │ │ │ │ └── InnerCustomNetworkTransform.Api.cs
│ │ │ │ ├── InnerPlayerInfo.Api.cs
│ │ │ │ ├── InnerGameData.TaskInfo.cs
│ │ │ │ └── InnerLobbyBehaviour.cs
│ │ │ ├── SpawnFlags.cs
│ │ │ ├── RpcInfo.cs
│ │ │ ├── GameDataTag.cs
│ │ │ └── GameObject.cs
│ │ ├── Redirector
│ │ │ ├── INodeProvider.cs
│ │ │ ├── INodeLocator.cs
│ │ │ ├── NodeLocatorNoOp.cs
│ │ │ ├── NodeProviderConfig.cs
│ │ │ └── NodeLocatorRedis.cs
│ │ ├── GameCodeFactory.cs
│ │ ├── Manager
│ │ │ └── ClientManager.Api.cs
│ │ ├── Factories
│ │ │ ├── IClientFactory.cs
│ │ │ └── ClientFactory.cs
│ │ ├── Messages
│ │ │ └── MessageWriterProvider.cs
│ │ └── State
│ │ │ ├── ClientPlayer.Api.cs
│ │ │ ├── GameNet.Api.cs
│ │ │ └── GameNet.cs
│ ├── Constants.cs
│ ├── Config
│ │ ├── ServerRedirectorNode.cs
│ │ ├── DebugConfig.cs
│ │ ├── AntiCheatConfig.cs
│ │ ├── AnnouncementsServerConfig.cs
│ │ ├── ServerRedirectorConfig.cs
│ │ ├── ServerConfig.cs
│ │ └── DisconnectMessages.cs
│ ├── config.json
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Recorder
│ │ ├── RecordedPacketType.cs
│ │ ├── PacketSerializationContextPooledObjectPolicy.cs
│ │ └── PacketSerializationContext.cs
│ ├── Plugins
│ │ ├── PluginConfig.cs
│ │ ├── IAssemblyInformation.cs
│ │ ├── LoadedAssemblyInformation.cs
│ │ ├── PluginLoaderException.cs
│ │ ├── AssemblyInformation.cs
│ │ └── PluginInformation.cs
│ ├── Events
│ │ ├── Game
│ │ │ ├── GameCreatedEvent.cs
│ │ │ ├── GameStartedEvent.cs
│ │ │ ├── GameStartingEvent.cs
│ │ │ ├── GameDestroyedEvent.cs
│ │ │ ├── GameAlterEvent.cs
│ │ │ ├── GamePlayerJoinedEvent.cs
│ │ │ ├── GameEndedEvent.cs
│ │ │ ├── Meeting
│ │ │ │ ├── MeetingEndedEvent.cs
│ │ │ │ └── MeetingStartedEvent.cs
│ │ │ ├── GamePlayerLeftEvent.cs
│ │ │ └── Player
│ │ │ │ ├── PlayerExileEvent.cs
│ │ │ │ ├── PlayerSpawnedEvent.cs
│ │ │ │ ├── PlayerDestroyedEvent.cs
│ │ │ │ ├── PlayerCompletedTaskEvent.cs
│ │ │ │ ├── PlayerMurderEvent.cs
│ │ │ │ ├── PlayerStartMeetingEvent.cs
│ │ │ │ ├── PlayerSetStartCounterEvent.cs
│ │ │ │ ├── PlayerChatEvent.cs
│ │ │ │ ├── PlayerVentEvent.cs
│ │ │ │ └── PlayerMovementEvent.cs
│ │ ├── Register
│ │ │ ├── IRegisteredEventListener.cs
│ │ │ ├── WrappedRegisteredEventListener.cs
│ │ │ ├── ManualRegisteredEventListener.cs
│ │ │ └── InvokedRegisteredEventListener.cs
│ │ ├── EventHandler.cs
│ │ ├── MultiDisposable.cs
│ │ └── Announcements
│ │ │ └── AnnouncementRequestEvent.cs
│ ├── Extensions
│ │ ├── NodeLocatorExtensions.cs
│ │ └── ServiceProviderExtensions.cs
│ ├── Impostor.Server.csproj.DotSettings
│ ├── Utils
│ │ ├── DotnetUtils.cs
│ │ └── IpUtils.cs
│ ├── config-full.json
│ └── ProjectRules.ruleset
├── Impostor.Api
│ ├── Events
│ │ ├── IEvent.cs
│ │ ├── IEventListener.cs
│ │ ├── Game
│ │ │ ├── IGamePlayerLeftEvent.cs
│ │ │ ├── IGamePlayerJoinedEvent.cs
│ │ │ ├── Meeting
│ │ │ │ ├── IMeetingEndedEvent.cs
│ │ │ │ ├── IMeetingStartedEvent.cs
│ │ │ │ └── IMeetingEvent.cs
│ │ │ ├── Player
│ │ │ │ ├── IPlayerMovementEvent.cs
│ │ │ │ ├── IPlayerSpawnedEvent.cs
│ │ │ │ ├── IPlayerDestroyedEvent.cs
│ │ │ │ ├── IPlayerExileEvent.cs
│ │ │ │ ├── IPlayerCompletedTaskEvent.cs
│ │ │ │ ├── IPlayerChatEvent.cs
│ │ │ │ ├── IPlayerSetStartCounterEvent.cs
│ │ │ │ ├── IPlayerMurderEvent.cs
│ │ │ │ ├── IPlayerStartMeetingEvent.cs
│ │ │ │ ├── IPlayerVentEvent.cs
│ │ │ │ └── IPlayerEvent.cs
│ │ │ ├── IGameAlterEvent.cs
│ │ │ ├── IGameEndedEvent.cs
│ │ │ ├── IGameStartedEvent.cs
│ │ │ ├── IGameCreatedEvent.cs
│ │ │ ├── IGameDestroyedEvent.cs
│ │ │ ├── IGameEvent.cs
│ │ │ └── IGameStartingEvent.cs
│ │ ├── EventPriority.cs
│ │ ├── IEventCancelable.cs
│ │ ├── IManualEventListener.cs
│ │ ├── Announcements
│ │ │ └── IAnnouncementRequestEvent.cs
│ │ └── Attributes
│ │ │ └── EventListenerAttribute.cs
│ ├── Net
│ │ ├── IConnection.cs
│ │ ├── Inner
│ │ │ ├── Objects
│ │ │ │ ├── IInnerMeetingHud.cs
│ │ │ │ ├── IInnerGameData.cs
│ │ │ │ ├── IInnerShipStatus.cs
│ │ │ │ ├── IInnerVoteBanSystem.cs
│ │ │ │ ├── IInnerLobbyBehaviour.cs
│ │ │ │ ├── Components
│ │ │ │ │ ├── IInnerPlayerPhysics.cs
│ │ │ │ │ └── IInnerCustomNetworkTransform.cs
│ │ │ │ └── ITaskInfo.cs
│ │ │ ├── IInnerNetObject.cs
│ │ │ ├── IGameNet.cs
│ │ │ └── RpcCalls.cs
│ │ ├── Manager
│ │ │ └── IClientManager.cs
│ │ ├── LimboStates.cs
│ │ ├── Messages
│ │ │ ├── AnnouncementsMessageFlags.cs
│ │ │ ├── Rpcs
│ │ │ │ ├── Rpc04Exiled.cs
│ │ │ │ ├── Rpc22Close.cs
│ │ │ │ ├── Rpc25ClearVote.cs
│ │ │ │ ├── Rpc06SetName.cs
│ │ │ │ ├── Rpc05CheckName.cs
│ │ │ │ ├── Rpc13SendChat.cs
│ │ │ │ ├── Rpc19EnterVent.cs
│ │ │ │ ├── Rpc20ExitVent.cs
│ │ │ │ ├── Rpc14StartMeeting.cs
│ │ │ │ ├── Rpc01CompleteTask.cs
│ │ │ │ ├── Rpc11ReportDeadBody.cs
│ │ │ │ ├── Rpc00PlayAnimation.cs
│ │ │ │ ├── Rpc08SetColor.cs
│ │ │ │ ├── Rpc09SetHat.cs
│ │ │ │ ├── Rpc17SetPet.cs
│ │ │ │ ├── Rpc07CheckColor.cs
│ │ │ │ ├── Rpc10SetSkin.cs
│ │ │ │ ├── Rpc03SetInfected.cs
│ │ │ │ ├── Rpc30UpdateGameData.cs
│ │ │ │ ├── Rpc27CloseDoorsOfType.cs
│ │ │ │ ├── Rpc02SyncSettings.cs
│ │ │ │ ├── Rpc15SetScanner.cs
│ │ │ │ ├── Rpc26AddVote.cs
│ │ │ │ ├── Rpc12MurderPlayer.cs
│ │ │ │ ├── Rpc24CastVote.cs
│ │ │ │ ├── Rpc21SnapTo.cs
│ │ │ │ ├── Rpc18SetStartCounter.cs
│ │ │ │ ├── Rpc29SetTasks.cs
│ │ │ │ ├── Rpc16SendChatNote.cs
│ │ │ │ ├── Rpc23VotingComplete.cs
│ │ │ │ └── Rpc28RepairSystem.cs
│ │ │ ├── Announcements
│ │ │ │ ├── Message00UseCache.cs
│ │ │ │ ├── MessageHello.cs
│ │ │ │ ├── Message02SetFreeWeekend.cs
│ │ │ │ └── Message01Update.cs
│ │ │ ├── C2S
│ │ │ │ ├── Message04RemovePlayerC2S.cs
│ │ │ │ ├── Message11KickPlayerC2S.cs
│ │ │ │ ├── Message08EndGameC2S.cs
│ │ │ │ ├── Message16GetGameListC2S.cs
│ │ │ │ ├── Message01JoinGameC2S.cs
│ │ │ │ ├── Message00HostGameC2S.cs
│ │ │ │ └── Message10AlterGameC2S.cs
│ │ │ ├── S2C
│ │ │ │ ├── Message00HostGameS2C.cs
│ │ │ │ ├── Message12WaitForHostS2C.cs
│ │ │ │ ├── Message13RedirectS2C.cs
│ │ │ │ ├── Message11KickPlayerS2C.cs
│ │ │ │ ├── Message10AlterGameS2C.cs
│ │ │ │ ├── Message07JoinedGameS2C.cs
│ │ │ │ ├── Message04RemovePlayerS2C.cs
│ │ │ │ └── Message01JoinGameS2C.cs
│ │ │ ├── IMessageWriterProvider.cs
│ │ │ ├── MessageFlags.cs
│ │ │ └── MessageType.cs
│ │ ├── IHazelConnection.cs
│ │ └── IClientPlayer.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Innersloth
│ │ ├── ChatNoteType.cs
│ │ ├── AlterGameTags.cs
│ │ ├── MapTypes.cs
│ │ ├── DeathReason.cs
│ │ ├── TaskBarUpdate.cs
│ │ ├── Language.cs
│ │ ├── MapFlags.cs
│ │ ├── KillDistances.cs
│ │ ├── FreeWeekendState.cs
│ │ ├── GameStates.cs
│ │ ├── GameVersion.cs
│ │ ├── Announcement.cs
│ │ ├── GameOverReason.cs
│ │ ├── TextBox.cs
│ │ ├── GameKeywords.cs
│ │ ├── Customization
│ │ │ ├── ColorType.cs
│ │ │ ├── PetType.cs
│ │ │ └── SkinType.cs
│ │ ├── SystemTypeHelpers.cs
│ │ ├── ServerInfo.cs
│ │ ├── SystemTypes.cs
│ │ ├── VentLocation.cs
│ │ ├── TaskTypes.cs
│ │ └── RegionInfo.cs
│ ├── Games
│ │ ├── IGameCodeFactory.cs
│ │ ├── Managers
│ │ │ └── IGameManager.cs
│ │ ├── Extensions
│ │ │ ├── GameManagerExtensions.cs
│ │ │ └── GameExtensions.cs
│ │ └── GameJoinError.cs
│ ├── Plugins
│ │ ├── IPlugin.cs
│ │ ├── IPluginStartup.cs
│ │ ├── PluginBase.cs
│ │ └── ImpostorPluginAttribute.cs
│ ├── Extensions
│ │ └── SystemTypesExtensions.cs
│ ├── Reactor
│ │ ├── ModdedHandshakeS2C.cs
│ │ ├── Mod.cs
│ │ ├── PluginSide.cs
│ │ ├── ModdedHandshakeC2S.cs
│ │ └── ModList.cs
│ ├── CheatContext.cs
│ ├── Exceptions
│ │ ├── ImpostorException.cs
│ │ ├── ImpostorConfigException.cs
│ │ └── ImpostorProtocolException.cs
│ ├── ProjectRules.ruleset
│ └── Impostor.Api.csproj.DotSettings
├── Impostor.Plugins.Debugger
│ ├── Shared
│ │ └── MainLayout.razor
│ ├── DebugPlugin.cs
│ ├── _Imports.razor
│ ├── App.razor
│ ├── Impostor.Plugins.Debugger.csproj
│ ├── Pages
│ │ └── _Host.cshtml
│ └── DebugPluginStartup.cs
├── Impostor.Patcher
│ ├── Impostor.Patcher.WinForms
│ │ ├── icon.ico
│ │ ├── App.config
│ │ ├── Properties
│ │ │ ├── Settings.settings
│ │ │ └── Settings.Designer.cs
│ │ ├── Program.cs
│ │ └── Impostor.Patcher.WinForms.csproj
│ ├── Directory.Build.props
│ ├── Impostor.Patcher.Shared
│ │ ├── Events
│ │ │ ├── ErrorEventArgs.cs
│ │ │ └── SavedEventArgs.cs
│ │ ├── Impostor.Patcher.Shared.csproj
│ │ └── Innersloth
│ │ │ ├── ServerInfo.cs
│ │ │ └── RegionInfo.cs
│ └── Impostor.Patcher.Cli
│ │ └── Impostor.Patcher.Cli.csproj
├── Impostor.Tools.ServerReplay
│ ├── sessions
│ │ └── session_1604255331821_dead_player_exception.dat
│ ├── Mocks
│ │ ├── MockGameCodeFactory.cs
│ │ └── MockHazelConnection.cs
│ └── Impostor.Tools.ServerReplay.csproj
├── Impostor.Plugins.Example
│ ├── Impostor.Plugins.Example.csproj
│ ├── Handlers
│ │ ├── MeetingEventListener.cs
│ │ └── AnnouncementsListener.cs
│ ├── ExamplePluginStartup.cs
│ └── ExamplePlugin.cs
├── Impostor.Client
│ └── Impostor.Client.csproj
├── Impostor.Client.App
│ └── Impostor.Client.App.csproj
├── Impostor.Hazel
│ ├── HazelException.cs
│ ├── Impostor.Hazel.csproj
│ ├── ConnectionState.cs
│ ├── DataReceivedEventArgs.cs
│ ├── NewConnectionEventArgs.cs
│ ├── NetworkConnectionListener.cs
│ ├── MessageReaderPolicy.cs
│ ├── DisconnectedEventArgs.cs
│ ├── Extensions
│ │ └── ServiceProviderExtensions.cs
│ ├── Udp
│ │ └── SendOptionInternal.cs
│ ├── IPMode.cs
│ └── IRecyclable.cs
├── Impostor.Tools.Proxy
│ └── Impostor.Tools.Proxy.csproj
└── Impostor.Tests
│ ├── Impostor.Tests.csproj
│ ├── GameCodeTests.cs
│ └── Hazel
│ └── MessageWriterTests.cs
├── .github
├── ISSUE_TEMPLATE
│ ├── config.yml
│ ├── 6--api-other.md
│ ├── 3--api-suggestion.md
│ ├── 5--api-unavailable-data.md
│ ├── 2--feature-request.md
│ ├── 4--api-invalid-data.md
│ └── 1--bug-reporting.md
├── PULL_REQUEST_TEMPLATE.md
├── workflows
│ └── main.yml
└── stale.yml
├── docs
├── images
│ ├── client.jpg
│ ├── logo_458.png
│ └── logo_64.png
├── README.md
└── FAQ.md
├── .dockerignore
├── .gitignore
├── .config
└── dotnet-tools.json
├── appveyor.yml
└── CONTRIBUTING.md
/src/Impostor.Benchmarks/.gitignore:
--------------------------------------------------------------------------------
1 | BenchmarkDotNet.Artifacts
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: true
2 |
--------------------------------------------------------------------------------
/src/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 | /packages/
4 | riderModule.iml
5 | /_ReSharper.Caches/
6 | .idea
--------------------------------------------------------------------------------
/docs/images/client.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NuclearPowered/Impostor/HEAD/docs/images/client.jpg
--------------------------------------------------------------------------------
/docs/images/logo_458.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NuclearPowered/Impostor/HEAD/docs/images/logo_458.png
--------------------------------------------------------------------------------
/docs/images/logo_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NuclearPowered/Impostor/HEAD/docs/images/logo_64.png
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | .dockerignore
2 | .env
3 | .gitignore
4 | .vs
5 | .vscode
6 | **/.git
7 | **/.idea
8 | **/bin
9 | **/obj
--------------------------------------------------------------------------------
/src/Impostor.Server/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NuclearPowered/Impostor/HEAD/src/Impostor.Server/icon.ico
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/IEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events
2 | {
3 | public interface IEvent
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.vscode
2 | /build
3 | /.vs
4 | /src/Impostor.Plugins.Debugger/Properties/launchSettings.json
5 | /tools
6 |
7 | .local/
8 |
--------------------------------------------------------------------------------
/src/Impostor.Plugins.Debugger/Shared/MainLayout.razor:
--------------------------------------------------------------------------------
1 | @inherits LayoutComponentBase
2 |
3 |
4 | @Body
5 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/IEventListener.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events
2 | {
3 | public interface IEventListener
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/IConnection.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net
2 | {
3 | public interface IConnection
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | [assembly:InternalsVisibleTo("Impostor.Server")]
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/ChatNoteType.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public enum ChatNoteType : byte
4 | {
5 | DidVote = 0,
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Inner/Objects/IInnerMeetingHud.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Inner.Objects
2 | {
3 | public interface IInnerMeetingHud
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Patcher/Impostor.Patcher.WinForms/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NuclearPowered/Impostor/HEAD/src/Impostor.Patcher/Impostor.Patcher.WinForms/icon.ico
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/IGamePlayerLeftEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events
2 | {
3 | public interface IGamePlayerLeftEvent : IGameEvent
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Games/IGameCodeFactory.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Games
2 | {
3 | public interface IGameCodeFactory
4 | {
5 | GameCode Create();
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/IGamePlayerJoinedEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events
2 | {
3 | public interface IGamePlayerJoinedEvent : IGameEvent
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/AlterGameTags.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public enum AlterGameTags : byte
4 | {
5 | ChangePrivacy = 1,
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Inner/Objects/IInnerGameData.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Inner.Objects
2 | {
3 | public interface IInnerGameData : IInnerNetObject
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Meeting/IMeetingEndedEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events.Meeting
2 | {
3 | public interface IMeetingEndedEvent : IMeetingEvent
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Player/IPlayerMovementEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events.Player
2 | {
3 | public interface IPlayerMovementEvent : IPlayerEvent
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Player/IPlayerSpawnedEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events.Player
2 | {
3 | public interface IPlayerSpawnedEvent : IPlayerEvent
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Inner/Objects/IInnerShipStatus.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Inner.Objects
2 | {
3 | public interface IInnerShipStatus : IInnerNetObject
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Meeting/IMeetingStartedEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events.Meeting
2 | {
3 | public interface IMeetingStartedEvent : IMeetingEvent
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Player/IPlayerDestroyedEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events.Player
2 | {
3 | public interface IPlayerDestroyedEvent : IPlayerEvent
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Inner/Objects/IInnerVoteBanSystem.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Inner.Objects
2 | {
3 | public interface IInnerVoteBanSystem : IInnerNetObject
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/IGameAlterEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events
2 | {
3 | public interface IGameAlterEvent : IGameEvent
4 | {
5 | bool IsPublic { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/MapTypes.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public enum MapTypes
4 | {
5 | Skeld = 0,
6 | MiraHQ = 1,
7 | Polus = 2,
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Inner/Objects/IInnerLobbyBehaviour.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Inner.Objects
2 | {
3 | public interface IInnerLobbyBehaviour : IInnerNetObject
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/DeathReason.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public enum DeathReason
4 | {
5 | Exile = 0,
6 | Kill = 1,
7 | Disconnect = 2,
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/Objects/Systems/IActivatable.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Server.Net.Inner.Objects.Systems
2 | {
3 | public interface IActivatable
4 | {
5 | bool IsActive { get; }
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/TaskBarUpdate.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public enum TaskBarUpdate : byte
4 | {
5 | Always = 0,
6 | Meetings = 1,
7 | Never = 2
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Inner/Objects/Components/IInnerPlayerPhysics.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Inner.Objects.Components
2 | {
3 | public interface IInnerPlayerPhysics : IInnerNetObject
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Redirector/INodeProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 |
3 | namespace Impostor.Server.Net.Redirector
4 | {
5 | internal interface INodeProvider
6 | {
7 | IPEndPoint Get();
8 | }
9 | }
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/6--api-other.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 6. Api other
3 | about: For anything about the api that does not fit in the other issues
4 | title: ''
5 | labels: api
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {
5 | "cake.tool": {
6 | "version": "0.38.5",
7 | "commands": [
8 | "dotnet-cake"
9 | ]
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Inner/IInnerNetObject.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Inner
2 | {
3 | public interface IInnerNetObject
4 | {
5 | public uint NetId { get; }
6 |
7 | public int OwnerId { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Server
2 | {
3 | internal static class Constants
4 | {
5 | public const int SpawnTimeout = 2500;
6 | public const int ConnectionTimeout = 2500;
7 | }
8 | }
--------------------------------------------------------------------------------
/src/Impostor.Tools.ServerReplay/sessions/session_1604255331821_dead_player_exception.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NuclearPowered/Impostor/HEAD/src/Impostor.Tools.ServerReplay/sessions/session_1604255331821_dead_player_exception.dat
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Manager/IClientManager.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Impostor.Api.Net.Manager
4 | {
5 | public interface IClientManager
6 | {
7 | IEnumerable Clients { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Config/ServerRedirectorNode.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Server.Config
2 | {
3 | public class ServerRedirectorNode
4 | {
5 | public string Ip { get; set; }
6 |
7 | public ushort Port { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/Objects/InnerMeetingHud.Api.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Inner.Objects;
2 |
3 | namespace Impostor.Server.Net.Inner.Objects
4 | {
5 | internal partial class InnerMeetingHud : IInnerMeetingHud
6 | {
7 |
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/Language.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public enum Language
4 | {
5 | English,
6 | Spanish,
7 | Portuguese,
8 | Korean,
9 | Russian,
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/MapFlags.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Api.Innersloth
4 | {
5 | [Flags]
6 | public enum MapFlags
7 | {
8 | Skeld = 1,
9 | MiraHQ = 2,
10 | Polus = 4,
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/SpawnFlags.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Server.Net.Inner
4 | {
5 | [Flags]
6 | public enum SpawnFlags : byte
7 | {
8 | None = 0,
9 | IsClientCharacter = 1,
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "Server": {
3 | "PublicIp": "127.0.0.1",
4 | "PublicPort": 22023,
5 | "ListenIp": "0.0.0.0",
6 | "ListenPort": 22023
7 | },
8 | "AntiCheat": {
9 | "BanIpFromGame": true
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Impostor.Patcher/Impostor.Patcher.WinForms/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | [assembly:InternalsVisibleTo("Impostor.Benchmarks")]
4 | [assembly:InternalsVisibleTo("Impostor.Tests")]
5 | [assembly:InternalsVisibleTo("Impostor.Tools.ServerReplay")]
6 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/IGameEndedEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Events
4 | {
5 | public interface IGameEndedEvent : IGameEvent
6 | {
7 | public GameOverReason GameOverReason { get; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/KillDistances.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Api.Innersloth
4 | {
5 | [Flags]
6 | public enum KillDistances : byte
7 | {
8 | Short = 0,
9 | Normal = 1,
10 | Long = 2,
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/FreeWeekendState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Api.Innersloth
4 | {
5 | [Flags]
6 | public enum FreeWeekendState : byte
7 | {
8 | NotFree,
9 | FreeMIRA,
10 | FreePolus,
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Recorder/RecordedPacketType.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Server.Recorder
2 | {
3 | internal enum RecordedPacketType : byte
4 | {
5 | Connect = 1,
6 | Disconnect = 2,
7 | Message = 3,
8 | GameCreated = 4
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Meeting/IMeetingEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Inner.Objects;
2 |
3 | namespace Impostor.Api.Events.Meeting
4 | {
5 | public interface IMeetingEvent : IGameEvent
6 | {
7 | IInnerMeetingHud MeetingHud { get; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/GameStates.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public enum GameStates : byte
4 | {
5 | NotStarted = 0,
6 | Starting = 1,
7 | Started = 2,
8 | Ended = 3,
9 | Destroyed = 4,
10 | }
11 | }
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # Impostor Documentation
2 |
3 | 1. [Running the server](Running-the-server.md)
4 | 2. [Server configuration](Server-configuration.md)
5 | 3. [Building from source](Building-from-source.md)
6 | 4. [Writing a plugin](Writing-a-plugin.md)
7 | 5. [Frequently answered questions](FAQ.md)
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/EventPriority.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events
2 | {
3 | public enum EventPriority
4 | {
5 | Lowest = 0,
6 | Low = 1,
7 | Normal = 2,
8 | High = 3,
9 | Highest = 4,
10 | Monitor = 5,
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.Api.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Inner.Objects.Components;
2 |
3 | namespace Impostor.Server.Net.Inner.Objects.Components
4 | {
5 | internal partial class InnerPlayerPhysics : IInnerPlayerPhysics
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/IGameStartedEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events
2 | {
3 | ///
4 | /// The game is started here and players have been initialized.
5 | ///
6 | public interface IGameStartedEvent : IGameEvent
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Games/Managers/IGameManager.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Impostor.Api.Games.Managers
4 | {
5 | public interface IGameManager
6 | {
7 | IEnumerable Games { get; }
8 |
9 | IGame? Find(GameCode code);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Player/IPlayerExileEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events.Player
2 | {
3 | ///
4 | /// Called whenever a player gets exiled (voted out).
5 | ///
6 | public interface IPlayerExileEvent : IPlayerEvent
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Impostor.Patcher/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | Impostor
4 | Impostor
5 | Copyright © AeonLucid 2020
6 | 1.0.0
7 |
8 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/GameCodeFactory.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Games;
2 |
3 | namespace Impostor.Server.Net
4 | {
5 | public class GameCodeFactory : IGameCodeFactory
6 | {
7 | public GameCode Create()
8 | {
9 | return GameCode.Create();
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/IEventCancelable.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events
2 | {
3 | public interface IEventCancelable : IEvent
4 | {
5 | ///
6 | /// True if the event was cancelled.
7 | ///
8 | bool IsCancelled { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/LimboStates.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Api.Net
4 | {
5 | [Flags]
6 | public enum LimboStates
7 | {
8 | PreSpawn = 1,
9 | NotLimbo = 2,
10 | WaitingForHost = 4,
11 | All = PreSpawn | NotLimbo | WaitingForHost,
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/AnnouncementsMessageFlags.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages
2 | {
3 | public class AnnouncementsMessageFlags
4 | {
5 | public const byte UseCache = 0;
6 | public const byte SetUpdate = 1;
7 | public const byte SetFreeWeekend = 2;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Config/DebugConfig.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Server.Config
2 | {
3 | public class DebugConfig
4 | {
5 | public const string Section = "Debug";
6 |
7 | public bool GameRecorderEnabled { get; set; }
8 |
9 | public string GameRecorderPath { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/IGameCreatedEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Games;
2 |
3 | namespace Impostor.Api.Events
4 | {
5 | ///
6 | /// Called whenever a new is created.
7 | ///
8 | public interface IGameCreatedEvent : IGameEvent
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Player/IPlayerCompletedTaskEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 | using Impostor.Api.Net.Inner.Objects;
3 |
4 | namespace Impostor.Api.Events.Player
5 | {
6 | public interface IPlayerCompletedTaskEvent : IPlayerEvent
7 | {
8 | ITaskInfo Task { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/GameVersion.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public class GameVersion
4 | {
5 | public static int GetVersion(int year, int month, int day, int rev = 0)
6 | {
7 | return (year * 25000) + (month * 1800) + (day * 50) + rev;
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/IGameDestroyedEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Games;
2 |
3 | namespace Impostor.Api.Events
4 | {
5 | ///
6 | /// Called whenever a new is destroyed.
7 | ///
8 | public interface IGameDestroyedEvent : IGameEvent
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Player/IPlayerChatEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events.Player
2 | {
3 | public interface IPlayerChatEvent : IPlayerEvent
4 | {
5 | ///
6 | /// Gets the message sent by the player.
7 | ///
8 | string Message { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Impostor.Patcher/Impostor.Patcher.WinForms/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Config/AntiCheatConfig.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Server.Config
2 | {
3 | public class AntiCheatConfig
4 | {
5 | public const string Section = "AntiCheat";
6 |
7 | public bool Enabled { get; set; } = true;
8 |
9 | public bool BanIpFromGame { get; set; } = true;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Plugins/IPlugin.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Impostor.Api.Events;
3 |
4 | namespace Impostor.Api.Plugins
5 | {
6 | public interface IPlugin : IEventListener
7 | {
8 | ValueTask EnableAsync();
9 |
10 | ValueTask DisableAsync();
11 |
12 | ValueTask ReloadAsync();
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/IGameEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Games;
2 |
3 | namespace Impostor.Api.Events
4 | {
5 | public interface IGameEvent : IEvent
6 | {
7 | ///
8 | /// Gets the this event belongs to.
9 | ///
10 | IGame Game { get; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Impostor.Plugins.Example/Impostor.Plugins.Example.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Plugins/PluginConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Impostor.Server.Plugins
4 | {
5 | public class PluginConfig
6 | {
7 | public List Paths { get; set; } = new List();
8 |
9 | public List LibraryPaths { get; set; } = new List();
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Inner/Objects/ITaskInfo.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 | using Impostor.Api.Net.Messages;
3 |
4 | namespace Impostor.Api.Net.Inner.Objects
5 | {
6 | public interface ITaskInfo
7 | {
8 | uint Id { get; }
9 |
10 | TaskTypes Type { get; }
11 |
12 | bool Complete { get; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Extensions/SystemTypesExtensions.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api
4 | {
5 | public static class SystemTypesExtensions
6 | {
7 | public static string GetFriendlyName(this SystemTypes type)
8 | {
9 | return SystemTypeHelpers.Names[(int)type];
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Impostor.Plugins.Debugger/DebugPlugin.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Plugins;
2 |
3 | namespace Impostor.Plugins.Debugger
4 | {
5 | [ImpostorPlugin(
6 | package: "gg.impostor.debugger",
7 | name: "Debugger",
8 | author: "Gerard",
9 | version: "1.0.0")]
10 | public class DebugPlugin : PluginBase
11 | {
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Player/IPlayerSetStartCounterEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events.Player
2 | {
3 | public interface IPlayerSetStartCounterEvent : IPlayerEvent
4 | {
5 | ///
6 | /// Gets the current time of the start counter.
7 | ///
8 | byte SecondsLeft { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc04Exiled.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc04Exiled
4 | {
5 | public static void Serialize(IMessageWriter writer)
6 | {
7 | }
8 |
9 | public static void Deserialize(IMessageReader reader)
10 | {
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc22Close.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc22Close
4 | {
5 | public static void Serialize(IMessageWriter writer)
6 | {
7 | }
8 |
9 | public static void Deserialize(IMessageReader reader)
10 | {
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.Api.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Impostor.Api.Net.Inner.Objects;
3 |
4 | namespace Impostor.Server.Net.Inner.Objects
5 | {
6 | internal partial class InnerPlayerInfo : IInnerPlayerInfo
7 | {
8 | IEnumerable IInnerPlayerInfo.Tasks => Tasks;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/IManualEventListener.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Impostor.Api.Events
4 | {
5 | public interface IManualEventListener : IEventListener
6 | {
7 | public bool CanExecute();
8 |
9 | public ValueTask Execute(IEvent @event);
10 |
11 | EventPriority Priority { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc25ClearVote.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc25ClearVote
4 | {
5 | public static void Serialize(IMessageWriter writer)
6 | {
7 | }
8 |
9 | public static void Deserialize(IMessageReader reader)
10 | {
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Plugins/IPluginStartup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 | using Microsoft.Extensions.Hosting;
3 |
4 | namespace Impostor.Api.Plugins
5 | {
6 | public interface IPluginStartup
7 | {
8 | void ConfigureHost(IHostBuilder host);
9 |
10 | void ConfigureServices(IServiceCollection services);
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Manager/ClientManager.Api.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Impostor.Api.Net;
3 | using Impostor.Api.Net.Manager;
4 |
5 | namespace Impostor.Server.Net.Manager
6 | {
7 | internal partial class ClientManager : IClientManager
8 | {
9 | IEnumerable IClientManager.Clients => _clients.Values;
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/Objects/Systems/ISystemType.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Messages;
2 |
3 | namespace Impostor.Server.Net.Inner.Objects.Systems
4 | {
5 | public interface ISystemType
6 | {
7 | void Serialize(IMessageWriter writer, bool initialState);
8 |
9 | void Deserialize(IMessageReader reader, bool initialState);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Impostor.Patcher/Impostor.Patcher.Shared/Events/ErrorEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Patcher.Shared.Events
4 | {
5 | public class ErrorEventArgs : EventArgs
6 | {
7 | public ErrorEventArgs(string message)
8 | {
9 | Message = message;
10 | }
11 |
12 | public string Message { get; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Factories/IClientFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Impostor.Api.Net;
3 | using Impostor.Api.Reactor;
4 |
5 | namespace Impostor.Server.Net.Factories
6 | {
7 | internal interface IClientFactory
8 | {
9 | ClientBase Create(IHazelConnection connection, string name, int clientVersion, ISet mods);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Impostor.Plugins.Debugger/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using System.Net.Http
2 | @using Microsoft.AspNetCore.Authorization
3 | @using Microsoft.AspNetCore.Components.Authorization
4 | @using Microsoft.AspNetCore.Components.Forms
5 | @using Microsoft.AspNetCore.Components.Routing
6 | @using Microsoft.AspNetCore.Components.Web
7 | @using Microsoft.JSInterop
8 | @using Impostor.Plugins.Debugger.Shared
--------------------------------------------------------------------------------
/src/Impostor.Server/Plugins/IAssemblyInformation.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.Loader;
3 |
4 | namespace Impostor.Server.Plugins
5 | {
6 | public interface IAssemblyInformation
7 | {
8 | AssemblyName AssemblyName { get; }
9 |
10 | bool IsPlugin { get; }
11 |
12 | Assembly Load(AssemblyLoadContext context);
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Impostor.Tools.ServerReplay/Mocks/MockGameCodeFactory.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Games;
2 |
3 | namespace Impostor.Tools.ServerReplay.Mocks
4 | {
5 | public class MockGameCodeFactory : IGameCodeFactory
6 | {
7 | public GameCode Result { get; set; }
8 |
9 | public GameCode Create()
10 | {
11 | return Result;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/Announcement.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public readonly struct Announcement
4 | {
5 | public readonly int Id;
6 | public readonly string Message;
7 |
8 | public Announcement(int id, string message)
9 | {
10 | Id = id;
11 | Message = message;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/3--api-suggestion.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 3. Api suggestion
3 | about: To make suggestions for the plugin api
4 | title: ''
5 | labels: api
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Api Suggestion
11 |
12 | ## Suggestion
13 |
16 |
17 | ## Use case
18 |
21 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Player/IPlayerMurderEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Inner.Objects;
2 |
3 | namespace Impostor.Api.Events.Player
4 | {
5 | public interface IPlayerMurderEvent : IPlayerEvent
6 | {
7 | ///
8 | /// Gets the player who got murdered.
9 | ///
10 | IInnerPlayerControl Victim { get; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Game/GameCreatedEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events;
2 | using Impostor.Api.Games;
3 |
4 | namespace Impostor.Server.Events
5 | {
6 | public class GameCreatedEvent : IGameCreatedEvent
7 | {
8 | public GameCreatedEvent(IGame game)
9 | {
10 | Game = game;
11 | }
12 |
13 | public IGame Game { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Game/GameStartedEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events;
2 | using Impostor.Api.Games;
3 |
4 | namespace Impostor.Server.Events
5 | {
6 | public class GameStartedEvent : IGameStartedEvent
7 | {
8 | public GameStartedEvent(IGame game)
9 | {
10 | Game = game;
11 | }
12 |
13 | public IGame Game { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Game/GameStartingEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events;
2 | using Impostor.Api.Games;
3 |
4 | namespace Impostor.Server.Events
5 | {
6 | public class GameStartingEvent : IGameStartingEvent
7 | {
8 | public GameStartingEvent(IGame game)
9 | {
10 | Game = game;
11 | }
12 |
13 | public IGame Game { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Game/GameDestroyedEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events;
2 | using Impostor.Api.Games;
3 |
4 | namespace Impostor.Server.Events
5 | {
6 | public class GameDestroyedEvent : IGameDestroyedEvent
7 | {
8 | public GameDestroyedEvent(IGame game)
9 | {
10 | Game = game;
11 | }
12 |
13 | public IGame Game { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Client/Impostor.Client.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Redirector/INodeLocator.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 | using System.Threading.Tasks;
3 |
4 | namespace Impostor.Server.Net.Redirector
5 | {
6 | public interface INodeLocator
7 | {
8 | ValueTask FindAsync(string gameCode);
9 |
10 | ValueTask SaveAsync(string gameCode, IPEndPoint endPoint);
11 |
12 | ValueTask RemoveAsync(string gameCode);
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/GameOverReason.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public enum GameOverReason : byte
4 | {
5 | HumansByVote = 0,
6 | HumansByTask = 1,
7 | ImpostorByVote = 2,
8 | ImpostorByKill = 3,
9 | ImpostorBySabotage = 4,
10 |
11 | // Unused (?)
12 | ImpostorDisconnect = 5,
13 | HumansDisconnect = 6,
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Impostor.Patcher/Impostor.Patcher.Shared/Impostor.Patcher.Shared.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0;netstandard2.1
5 | 1.0.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Impostor.Plugins.Debugger/App.razor:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sorry, there's nothing at this address.
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/TextBox.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth
2 | {
3 | public static class TextBox
4 | {
5 | public static bool IsCharAllowed(char i)
6 | {
7 | return i == ' ' || (i >= 'A' && i <= 'Z') || (i >= 'a' && i <= 'z') || (i >= '0' && i <= '9') || (i >= 'À' && i <= 'ÿ') || (i >= 'Ѐ' && i <= 'џ') || (i >= 'ㄱ' && i <= 'ㆎ') || (i >= '가' && i <= '힣');
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/5--api-unavailable-data.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 5. Api unavailable data
3 | about: To let us know about unavailable data from the api that you would like to use
4 | title: ''
5 | labels: api
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Api missing data
11 |
12 | ## Data
13 |
16 |
17 | ## Use-case
18 |
21 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Messages/MessageWriterProvider.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Messages;
2 | using Impostor.Hazel;
3 |
4 | namespace Impostor.Server.Net.Messages
5 | {
6 | public class MessageWriterProvider : IMessageWriterProvider
7 | {
8 | public IMessageWriter Get(MessageType sendOption = MessageType.Unreliable)
9 | {
10 | return MessageWriter.Get(sendOption);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/GameKeywords.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Api.Innersloth
4 | {
5 | [Flags]
6 | public enum GameKeywords : uint
7 | {
8 | All = 0,
9 | Other = 1,
10 | Spanish = 2,
11 | Korean = 4,
12 | Russian = 8,
13 | Portuguese = 16,
14 | Arabic = 32,
15 | Filipone = 64,
16 | Polish = 128,
17 | English = 256,
18 | }
19 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Reactor/ModdedHandshakeS2C.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Messages;
2 |
3 | namespace Impostor.Api.Reactor
4 | {
5 | public static class ModdedHandshakeS2C
6 | {
7 | public static void Serialize(IMessageWriter writer, string serverBrand)
8 | {
9 | writer.StartMessage(byte.MaxValue);
10 | writer.Write(serverBrand);
11 | writer.EndMessage();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Extensions/NodeLocatorExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Impostor.Server.Net.Redirector;
3 |
4 | namespace Impostor.Server
5 | {
6 | public static class NodeLocatorExtensions
7 | {
8 | public static async ValueTask ExistsAsync(this INodeLocator nodeLocator, string gameCode)
9 | {
10 | return await nodeLocator.FindAsync(gameCode) != null;
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/IGameStartingEvent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Events
2 | {
3 | ///
4 | /// Called when the game is going to start.
5 | /// When this is called, not all players are initialized properly yet.
6 | /// If you want to get correct player states, use .
7 | ///
8 | public interface IGameStartingEvent : IGameEvent
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/Customization/ColorType.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth.Customization
2 | {
3 | public enum ColorType : byte
4 | {
5 | Red = 0,
6 | Blue = 1,
7 | Green = 2,
8 | Pink = 3,
9 | Orange = 4,
10 | Yellow = 5,
11 | Black = 6,
12 | White = 7,
13 | Purple = 8,
14 | Brown = 9,
15 | Cyan = 10,
16 | Lime = 11,
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/Customization/PetType.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth.Customization
2 | {
3 | public enum PetType : uint
4 | {
5 | NoPet = 0,
6 | Alien = 1,
7 | Crewmate = 2,
8 | Doggy = 3,
9 | Stickmin = 4,
10 | Hamster = 5,
11 | Robot = 6,
12 | Ufo = 7,
13 | Ellie = 8,
14 | Squig = 9,
15 | Bedcrab = 10,
16 | Glitch = 11,
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Player/IPlayerStartMeetingEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Inner.Objects;
2 |
3 | namespace Impostor.Api.Events.Player
4 | {
5 | public interface IPlayerStartMeetingEvent : IPlayerEvent
6 | {
7 | ///
8 | /// Gets the player who's body got reported. Is null when the meeting started by Emergency call button
9 | ///
10 | IInnerPlayerControl? Body { get; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Impostor.Patcher/Impostor.Patcher.Shared/Events/SavedEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Patcher.Shared.Events
4 | {
5 | public class SavedEventArgs : EventArgs
6 | {
7 | public SavedEventArgs(string ipAddress, ushort port)
8 | {
9 | IpAddress = ipAddress;
10 | Port = port;
11 | }
12 |
13 | public string IpAddress { get; }
14 | public ushort Port { get; }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Register/IRegisteredEventListener.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Impostor.Api.Events;
4 |
5 | namespace Impostor.Server.Events.Register
6 | {
7 | internal interface IRegisteredEventListener
8 | {
9 | Type EventType { get; }
10 |
11 | EventPriority Priority { get; }
12 |
13 | ValueTask InvokeAsync(object eventHandler, object @event, IServiceProvider provider);
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/RpcInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Server.Net.Inner
2 | {
3 | public class RpcInfo
4 | {
5 | public RpcTargetType TargetType { get; init; }
6 |
7 | public bool CheckOwnership { get; init; } = true;
8 |
9 | public bool RequireHost { get; init; }
10 | }
11 |
12 | public enum RpcTargetType
13 | {
14 | Broadcast,
15 | Target,
16 | Both,
17 | Cmd
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc06SetName.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc06SetName
4 | {
5 | public static void Serialize(IMessageWriter writer, string name)
6 | {
7 | writer.Write(name);
8 | }
9 |
10 | public static void Deserialize(IMessageReader reader, out string name)
11 | {
12 | name = reader.ReadString();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc05CheckName.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc05CheckName
4 | {
5 | public static void Serialize(IMessageWriter writer, string name)
6 | {
7 | writer.Write(name);
8 | }
9 |
10 | public static void Deserialize(IMessageReader reader, out string name)
11 | {
12 | name = reader.ReadString();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/GameDataTag.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Server.Net.Inner
2 | {
3 | public static class GameDataTag
4 | {
5 | public const byte DataFlag = 1;
6 | public const byte RpcFlag = 2;
7 | public const byte SpawnFlag = 4;
8 | public const byte DespawnFlag = 5;
9 | public const byte SceneChangeFlag = 6;
10 | public const byte ReadyFlag = 7;
11 | public const byte ChangeSettingsFlag = 8;
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Games/Extensions/GameManagerExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using Impostor.Api.Games.Managers;
3 | using Impostor.Api.Innersloth;
4 |
5 | namespace Impostor.Api.Games
6 | {
7 | public static class GameManagerExtensions
8 | {
9 | public static int GetGameCount(this IGameManager manager, MapFlags map)
10 | {
11 | return manager.Games.Count(game => map.HasFlag((MapFlags)(1 << game.Options.MapId)));
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc13SendChat.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc13SendChat
4 | {
5 | public static void Serialize(IMessageWriter writer, string message)
6 | {
7 | writer.Write(message);
8 | }
9 |
10 | public static void Deserialize(IMessageReader reader, out string message)
11 | {
12 | message = reader.ReadString();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc19EnterVent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc19EnterVent
4 | {
5 | public static void Serialize(IMessageWriter writer, int ventId)
6 | {
7 | writer.WritePacked(ventId);
8 | }
9 |
10 | public static void Deserialize(IMessageReader reader, out int ventId)
11 | {
12 | ventId = reader.ReadPackedInt32();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc20ExitVent.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc20ExitVent
4 | {
5 | public static void Serialize(IMessageWriter writer, int ventId)
6 | {
7 | writer.WritePacked(ventId);
8 | }
9 |
10 | public static void Deserialize(IMessageReader reader, out int ventId)
11 | {
12 | ventId = reader.ReadPackedInt32();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Plugins.Debugger/Impostor.Plugins.Debugger.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0
5 | Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Game/GameAlterEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events;
2 | using Impostor.Api.Games;
3 |
4 | namespace Impostor.Server.Events
5 | {
6 | public class GameAlterEvent : IGameAlterEvent
7 | {
8 | public GameAlterEvent(IGame game, bool isPublic)
9 | {
10 | Game = game;
11 | IsPublic = isPublic;
12 | }
13 |
14 | public IGame Game { get; }
15 |
16 | public bool IsPublic { get; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc14StartMeeting.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc14StartMeeting
4 | {
5 | public static void Serialize(IMessageWriter writer, byte targetId)
6 | {
7 | writer.Write(targetId);
8 | }
9 |
10 | public static void Deserialize(IMessageReader reader, out byte targetId)
11 | {
12 | targetId = reader.ReadByte();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### Description
2 |
3 |
4 |
13 |
14 | ### Closes issues
15 |
16 | - closes #
17 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Announcements/Message00UseCache.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Announcements
2 | {
3 | public static class Message00UseCache
4 | {
5 | public static void Serialize(IMessageWriter writer)
6 | {
7 | writer.StartMessage(AnnouncementsMessageFlags.UseCache);
8 | writer.EndMessage();
9 | }
10 |
11 | public static void Deserialize(IMessageReader reader)
12 | {
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc01CompleteTask.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc01CompleteTask
4 | {
5 | public static void Serialize(IMessageWriter writer, uint taskId)
6 | {
7 | writer.WritePacked(taskId);
8 | }
9 |
10 | public static void Deserialize(IMessageReader reader, out uint taskId)
11 | {
12 | taskId = reader.ReadPackedUInt32();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc11ReportDeadBody.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc11ReportDeadBody
4 | {
5 | public static void Serialize(IMessageWriter writer, byte targetId)
6 | {
7 | writer.Write(targetId);
8 | }
9 |
10 | public static void Deserialize(IMessageReader reader, out byte targetId)
11 | {
12 | targetId = reader.ReadByte();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Tools.ServerReplay/Impostor.Tools.ServerReplay.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net5.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/2--feature-request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 2. Feature request
3 | about: To ask and request new features with Impostor
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Feature Request
11 |
12 | ## Feature Information:
13 |
17 |
18 | ## I confirm:
19 | - [ ] that I have searched for an existing feature request matching the description.
20 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/4--api-invalid-data.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 4. Api invalid data
3 | about: To let us know about invalid data in the api
4 | title: ''
5 | labels: api
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Api missing data
11 |
12 | ## Data
13 |
16 |
17 | ## Expectations
18 |
21 |
22 | ## Reproduce
23 |
26 |
--------------------------------------------------------------------------------
/src/Impostor.Client.App/Impostor.Client.App.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net5.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Impostor.Hazel/HazelException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Hazel
4 | {
5 | ///
6 | /// Wrapper for exceptions thrown from Hazel.
7 | ///
8 | [Serializable]
9 | public class HazelException : Exception
10 | {
11 | internal HazelException(string msg) : base (msg)
12 | {
13 |
14 | }
15 |
16 | internal HazelException(string msg, Exception e) : base (msg, e)
17 | {
18 |
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Impostor.Patcher/Impostor.Patcher.WinForms/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 | using Impostor.Patcher.WinForms.Forms;
4 |
5 | namespace Impostor.Patcher.WinForms
6 | {
7 | internal static class Program
8 | {
9 | [STAThread]
10 | private static void Main()
11 | {
12 | Application.EnableVisualStyles();
13 | Application.SetCompatibleTextRenderingDefault(false);
14 | Application.Run(new FrmMain());
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Plugins/PluginBase.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Impostor.Api.Plugins
4 | {
5 | public class PluginBase : IPlugin
6 | {
7 | public virtual ValueTask EnableAsync()
8 | {
9 | return default;
10 | }
11 |
12 | public virtual ValueTask DisableAsync()
13 | {
14 | return default;
15 | }
16 |
17 | public virtual ValueTask ReloadAsync()
18 | {
19 | return default;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/Impostor.Benchmarks/Impostor.Benchmarks.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net5.0
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Inner/IGameNet.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Inner.Objects;
2 |
3 | namespace Impostor.Api.Net.Inner
4 | {
5 | ///
6 | /// Holds all data that is serialized over the network through GameData packets.
7 | ///
8 | public interface IGameNet
9 | {
10 | IInnerLobbyBehaviour LobbyBehaviour { get; }
11 |
12 | IInnerGameData GameData { get; }
13 |
14 | IInnerVoteBanSystem VoteBan { get; }
15 |
16 | IInnerShipStatus ShipStatus { get; }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc00PlayAnimation.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc00PlayAnimation
6 | {
7 | public static void Serialize(IMessageWriter writer, TaskTypes task)
8 | {
9 | writer.Write((byte)task);
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out TaskTypes task)
13 | {
14 | task = (TaskTypes)reader.ReadByte();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/State/ClientPlayer.Api.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Games;
2 | using Impostor.Api.Net;
3 | using Impostor.Api.Net.Inner.Objects;
4 |
5 | namespace Impostor.Server.Net.State
6 | {
7 | internal partial class ClientPlayer
8 | {
9 | ///
10 | IClient IClientPlayer.Client => Client;
11 |
12 | ///
13 | IGame IClientPlayer.Game => Game;
14 |
15 | ///
16 | IInnerPlayerControl? IClientPlayer.Character => Character;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/State/GameNet.Api.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Inner;
2 | using Impostor.Api.Net.Inner.Objects;
3 |
4 | namespace Impostor.Server.Net.State
5 | {
6 | ///
7 | internal partial class GameNet : IGameNet
8 | {
9 | IInnerLobbyBehaviour IGameNet.LobbyBehaviour => LobbyBehaviour;
10 |
11 | IInnerGameData IGameNet.GameData => GameData;
12 |
13 | IInnerVoteBanSystem IGameNet.VoteBan => VoteBan;
14 |
15 | IInnerShipStatus IGameNet.ShipStatus => ShipStatus;
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/State/GameNet.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Server.Net.Inner.Objects;
2 | using Impostor.Server.Net.Inner.Objects.Components;
3 |
4 | namespace Impostor.Server.Net.State
5 | {
6 | internal partial class GameNet
7 | {
8 | public InnerLobbyBehaviour LobbyBehaviour { get; internal set; }
9 |
10 | public InnerGameData GameData { get; internal set; }
11 |
12 | public InnerVoteBanSystem VoteBan { get; internal set; }
13 |
14 | public InnerShipStatus ShipStatus { get; internal set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc08SetColor.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth.Customization;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc08SetColor
6 | {
7 | public static void Serialize(IMessageWriter writer, ColorType color)
8 | {
9 | writer.Write((byte)color);
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out ColorType color)
13 | {
14 | color = (ColorType)reader.ReadByte();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc09SetHat.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth.Customization;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc09SetHat
6 | {
7 | public static void Serialize(IMessageWriter writer, HatType hat)
8 | {
9 | writer.WritePacked((uint)hat);
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out HatType hat)
13 | {
14 | hat = (HatType)reader.ReadPackedUInt32();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc17SetPet.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth.Customization;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc17SetPet
6 | {
7 | public static void Serialize(IMessageWriter writer, PetType pet)
8 | {
9 | writer.WritePacked((uint)pet);
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out PetType pet)
13 | {
14 | pet = (PetType)reader.ReadPackedUInt32();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Redirector/NodeLocatorNoOp.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 | using System.Threading.Tasks;
3 |
4 | namespace Impostor.Server.Net.Redirector
5 | {
6 | public class NodeLocatorNoOp : INodeLocator
7 | {
8 | public ValueTask FindAsync(string gameCode) => ValueTask.FromResult(default(IPEndPoint));
9 |
10 | public ValueTask SaveAsync(string gameCode, IPEndPoint endPoint) => ValueTask.CompletedTask;
11 |
12 | public ValueTask RemoveAsync(string gameCode) => ValueTask.CompletedTask;
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc07CheckColor.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth.Customization;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc07CheckColor
6 | {
7 | public static void Serialize(IMessageWriter writer, ColorType color)
8 | {
9 | writer.Write((byte)color);
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out ColorType color)
13 | {
14 | color = (ColorType)reader.ReadByte();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc10SetSkin.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth.Customization;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc10SetSkin
6 | {
7 | public static void Serialize(IMessageWriter writer, SkinType skin)
8 | {
9 | writer.WritePacked((uint)skin);
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out SkinType skin)
13 | {
14 | skin = (SkinType)reader.ReadPackedUInt32();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Game/GamePlayerJoinedEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events;
2 | using Impostor.Api.Games;
3 | using Impostor.Api.Net;
4 |
5 | namespace Impostor.Server.Events
6 | {
7 | public class GamePlayerJoinedEvent : IGamePlayerJoinedEvent
8 | {
9 | public GamePlayerJoinedEvent(IGame game, IClientPlayer player)
10 | {
11 | Game = game;
12 | Player = player;
13 | }
14 |
15 | public IGame Game { get; }
16 |
17 | public IClientPlayer Player { get; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/C2S/Message04RemovePlayerC2S.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.C2S
2 | {
3 | public class Message04RemovePlayerC2S
4 | {
5 | public static void Serialize(IMessageWriter writer)
6 | {
7 | throw new System.NotImplementedException();
8 | }
9 |
10 | public static void Deserialize(IMessageReader reader, out int playerId, out byte reason)
11 | {
12 | playerId = reader.ReadPackedInt32();
13 | reason = reader.ReadByte();
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/C2S/Message11KickPlayerC2S.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.C2S
2 | {
3 | public class Message11KickPlayerC2S
4 | {
5 | public static void Serialize(IMessageWriter writer)
6 | {
7 | throw new System.NotImplementedException();
8 | }
9 |
10 | public static void Deserialize(IMessageReader reader, out int playerId, out bool isBan)
11 | {
12 | playerId = reader.ReadPackedInt32();
13 | isBan = reader.ReadBoolean();
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc03SetInfected.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc03SetInfected
6 | {
7 | public static void Serialize(IMessageWriter writer, byte[] infectedIds)
8 | {
9 | writer.WriteBytesAndSize(infectedIds);
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out ReadOnlyMemory infectedIds)
13 | {
14 | infectedIds = reader.ReadBytesAndSize();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Game/Player/IPlayerVentEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Events.Player
4 | {
5 | public interface IPlayerVentEvent : IPlayerEvent
6 | {
7 | ///
8 | /// Gets get the id of the used vent.
9 | ///
10 | public VentLocation VentId { get; }
11 |
12 | ///
13 | /// Gets a value indicating whether the vent was entered or exited.
14 | ///
15 | public bool VentEnter { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Innersloth/Customization/SkinType.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Innersloth.Customization
2 | {
3 | public enum SkinType : uint
4 | {
5 | None = 0,
6 | Astro = 1,
7 | Capt = 2,
8 | Mech = 3,
9 | Military = 4,
10 | Police = 5,
11 | Science = 6,
12 | SuitB = 7,
13 | SuitW = 8,
14 | Wall = 9,
15 | Hazmat = 10,
16 | Security = 11,
17 | Tarmac = 12,
18 | Miner = 13,
19 | Winter = 14,
20 | Archae = 15,
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc30UpdateGameData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Impostor.Api.Net.Inner.Objects;
3 |
4 | namespace Impostor.Api.Net.Messages.Rpcs
5 | {
6 | public static class Rpc30UpdateGameData
7 | {
8 | public static void Serialize(IMessageWriter writer)
9 | {
10 | throw new NotImplementedException();
11 | }
12 |
13 | public static void Deserialize(IMessageReader reader, IInnerGameData gameData)
14 | {
15 | throw new NotImplementedException();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Game/GameEndedEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events;
2 | using Impostor.Api.Games;
3 | using Impostor.Api.Innersloth;
4 |
5 | namespace Impostor.Server.Events
6 | {
7 | public class GameEndedEvent : IGameEndedEvent
8 | {
9 | public GameEndedEvent(IGame game, GameOverReason gameOverReason)
10 | {
11 | Game = game;
12 | GameOverReason = gameOverReason;
13 | }
14 |
15 | public IGame Game { get; }
16 |
17 | public GameOverReason GameOverReason { get; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc27CloseDoorsOfType.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc27CloseDoorsOfType
6 | {
7 | public static void Serialize(IMessageWriter writer, SystemTypes systemType)
8 | {
9 | writer.Write((byte)systemType);
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out SystemTypes systemType)
13 | {
14 | systemType = (SystemTypes)reader.ReadByte();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Reactor/Mod.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Reactor
2 | {
3 | public readonly struct Mod
4 | {
5 | public readonly string Id;
6 | public readonly string Version;
7 | public readonly PluginSide Side;
8 |
9 | public Mod(string id, string version, PluginSide side)
10 | {
11 | Id = id;
12 | Version = version;
13 | Side = side;
14 | }
15 |
16 | public override string ToString()
17 | {
18 | return $"{Id} ({Version})";
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc02SyncSettings.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc02SyncSettings
6 | {
7 | public static void Serialize(IMessageWriter writer, GameOptionsData gameOptionsData)
8 | {
9 | gameOptionsData.Serialize(writer);
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, GameOptionsData gameOptionsData)
13 | {
14 | gameOptionsData.Deserialize(reader.ReadBytesAndSize());
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc15SetScanner.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc15SetScanner
4 | {
5 | public static void Serialize(IMessageWriter writer, bool on, byte scannerCount)
6 | {
7 | writer.Write(on);
8 | writer.Write(scannerCount);
9 | }
10 |
11 | public static void Deserialize(IMessageReader reader, out bool on, out byte scannerCount)
12 | {
13 | on = reader.ReadBoolean();
14 | scannerCount = reader.ReadByte();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Game/Meeting/MeetingEndedEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events.Meeting;
2 | using Impostor.Api.Games;
3 | using Impostor.Api.Net.Inner.Objects;
4 |
5 | namespace Impostor.Server.Events.Meeting
6 | {
7 | public class MeetingEndedEvent : IMeetingEndedEvent
8 | {
9 | public MeetingEndedEvent(IGame game, IInnerMeetingHud meetingHud)
10 | {
11 | Game = game;
12 | MeetingHud = meetingHud;
13 | }
14 |
15 | public IGame Game { get; }
16 |
17 | public IInnerMeetingHud MeetingHud { get; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Recorder/PacketSerializationContextPooledObjectPolicy.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.ObjectPool;
2 |
3 | namespace Impostor.Server.Recorder
4 | {
5 | public class PacketSerializationContextPooledObjectPolicy : IPooledObjectPolicy
6 | {
7 | public PacketSerializationContext Create()
8 | {
9 | return new PacketSerializationContext();
10 | }
11 |
12 | public bool Return(PacketSerializationContext obj)
13 | {
14 | obj.Reset();
15 | return true;
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Game/Meeting/MeetingStartedEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events.Meeting;
2 | using Impostor.Api.Games;
3 | using Impostor.Api.Net.Inner.Objects;
4 |
5 | namespace Impostor.Server.Events.Meeting
6 | {
7 | public class MeetingStartedEvent : IMeetingStartedEvent
8 | {
9 | public MeetingStartedEvent(IGame game, IInnerMeetingHud meetingHud)
10 | {
11 | Game = game;
12 | MeetingHud = meetingHud;
13 | }
14 |
15 | public IGame Game { get; }
16 |
17 | public IInnerMeetingHud MeetingHud { get; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/C2S/Message08EndGameC2S.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Net.Messages.C2S
4 | {
5 | public class Message08EndGameC2S
6 | {
7 | public static void Serialize(IMessageWriter writer)
8 | {
9 | throw new System.NotImplementedException();
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out GameOverReason gameOverReason)
13 | {
14 | gameOverReason = (GameOverReason)reader.ReadByte();
15 | reader.ReadBoolean(); // showAd
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Impostor.Tools.Proxy/Impostor.Tools.Proxy.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net5.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Impostor.Server.csproj.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
3 | True
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/C2S/Message16GetGameListC2S.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Net.Messages.C2S
4 | {
5 | public class Message16GetGameListC2S
6 | {
7 | public static void Serialize(IMessageWriter writer)
8 | {
9 | throw new System.NotImplementedException();
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out GameOptionsData options)
13 | {
14 | reader.ReadPackedInt32(); // Hardcoded 0.
15 | options = GameOptionsData.DeserializeCreate(reader);
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc26AddVote.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc26AddVote
4 | {
5 | public static void Serialize(IMessageWriter writer, int clientId, int targetClientId)
6 | {
7 | writer.Write(clientId);
8 | writer.Write(targetClientId);
9 | }
10 |
11 | public static void Deserialize(IMessageReader reader, out int clientId, out int targetClientId)
12 | {
13 | clientId = reader.ReadInt32();
14 | targetClientId = reader.ReadInt32();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Announcements/MessageHello.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Net.Messages.Announcements
4 | {
5 | public class MessageHello
6 | {
7 | public static void Deserialize(IMessageReader reader, out int announcementVersion, out int id, out Language language)
8 | {
9 | reader.ReadByte(); // SendOption header, probably added by accident
10 | announcementVersion = reader.ReadPackedInt32();
11 | id = reader.ReadPackedInt32();
12 | language = (Language)reader.ReadPackedInt32();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc12MurderPlayer.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Games;
2 | using Impostor.Api.Net.Inner.Objects;
3 |
4 | namespace Impostor.Api.Net.Messages.Rpcs
5 | {
6 | public static class Rpc12MurderPlayer
7 | {
8 | public static void Serialize(IMessageWriter writer, IInnerPlayerControl target)
9 | {
10 | writer.Write(target);
11 | }
12 |
13 | public static void Deserialize(IMessageReader reader, IGame game, out IInnerPlayerControl? target)
14 | {
15 | target = reader.ReadNetObject(game);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc24CastVote.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc24CastVote
4 | {
5 | public static void Serialize(IMessageWriter writer, byte playerId, sbyte suspectPlayerId)
6 | {
7 | writer.Write(playerId);
8 | writer.Write(suspectPlayerId);
9 | }
10 |
11 | public static void Deserialize(IMessageReader reader, out byte playerId, out sbyte suspectPlayerId)
12 | {
13 | playerId = reader.ReadByte();
14 | suspectPlayerId = reader.ReadSByte();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/Game/GamePlayerLeftEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events;
2 | using Impostor.Api.Games;
3 | using Impostor.Api.Net;
4 |
5 | namespace Impostor.Server.Events
6 | {
7 | public class GamePlayerLeftEvent : IGamePlayerLeftEvent
8 | {
9 | public GamePlayerLeftEvent(IGame game, IClientPlayer player, bool isBan)
10 | {
11 | Game = game;
12 | Player = player;
13 | IsBan = isBan;
14 | }
15 |
16 | public IGame Game { get; }
17 |
18 | public IClientPlayer Player { get; }
19 |
20 | public bool IsBan { get; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc21SnapTo.cs:
--------------------------------------------------------------------------------
1 | using System.Numerics;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc21SnapTo
6 | {
7 | public static void Serialize(IMessageWriter writer, Vector2 position, ushort minSid)
8 | {
9 | writer.Write(position);
10 | writer.Write(minSid);
11 | }
12 |
13 | public static void Deserialize(IMessageReader reader, out Vector2 position, out ushort minSid)
14 | {
15 | position = reader.ReadVector2();
16 | minSid = reader.ReadUInt16();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Utils/DotnetUtils.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace Impostor.Server.Utils
4 | {
5 | internal static class DotnetUtils
6 | {
7 | private const string DefaultUnknownBuild = "UNKNOWN";
8 |
9 | public static string GetVersion()
10 | {
11 | var attribute = typeof(DotnetUtils).Assembly.GetCustomAttribute();
12 | if (attribute != null)
13 | {
14 | return attribute.InformationalVersion;
15 | }
16 |
17 | return DefaultUnknownBuild;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/S2C/Message00HostGameS2C.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Impostor.Api.Innersloth;
3 |
4 | namespace Impostor.Api.Net.Messages.S2C
5 | {
6 | public static class Message00HostGameS2C
7 | {
8 | public static void Serialize(IMessageWriter writer, int gameCode)
9 | {
10 | writer.StartMessage(MessageFlags.HostGame);
11 | writer.Write(gameCode);
12 | writer.EndMessage();
13 | }
14 |
15 | public static GameOptionsData Deserialize(IMessageReader reader)
16 | {
17 | throw new NotImplementedException();
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Reactor/PluginSide.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Reactor
2 | {
3 | ///
4 | /// Plugin side used in modded handshake
5 | ///
6 | public enum PluginSide : byte
7 | {
8 | ///
9 | /// Required by both sides, reject connection if missing on the other side
10 | ///
11 | Both,
12 |
13 | ///
14 | /// Required only by client
15 | ///
16 | ClientOnly,
17 |
18 | ///
19 | /// Required only by server
20 | ///
21 | ServerOnly,
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Impostor.Api/CheatContext.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Server.Net.Inner;
2 |
3 | namespace Impostor.Api
4 | {
5 | public class CheatContext
6 | {
7 | public CheatContext(string name)
8 | {
9 | Name = name;
10 | }
11 |
12 | public static CheatContext Deserialize { get; } = new CheatContext(nameof(Deserialize));
13 |
14 | public static CheatContext Serialize { get; } = new CheatContext(nameof(Serialize));
15 |
16 | public string Name { get; }
17 |
18 | public static implicit operator CheatContext(RpcCalls rpcCalls) => new CheatContext(rpcCalls.ToString());
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc18SetStartCounter.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Rpcs
2 | {
3 | public static class Rpc18SetStartCounter
4 | {
5 | public static void Serialize(IMessageWriter writer, int sequenceId, sbyte startCounter)
6 | {
7 | writer.Write(sequenceId);
8 | writer.Write(startCounter);
9 | }
10 |
11 | public static void Deserialize(IMessageReader reader, out int sequenceId, out sbyte startCounter)
12 | {
13 | sequenceId = reader.ReadPackedInt32();
14 | startCounter = reader.ReadSByte();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Impostor.Plugins.Example/Handlers/MeetingEventListener.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Impostor.Api.Events;
3 | using Impostor.Api.Events.Meeting;
4 |
5 | namespace Impostor.Plugins.Example.Handlers
6 | {
7 | public class MeetingEventListener : IEventListener
8 | {
9 | [EventListener]
10 | public void OnMeetingStarted(IMeetingStartedEvent e)
11 | {
12 | Console.WriteLine("Meeting > started");
13 | }
14 |
15 | [EventListener]
16 | public void OnMeetingEnded(IMeetingEndedEvent e)
17 | {
18 | Console.WriteLine("Meeting > ended");
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/1--bug-reporting.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 1. Bug reporting
3 | about: Bugs within Impostor
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | # Bug Report
11 |
12 | ## Base Information
13 | - Operating System
14 | - Impostor Version
15 | - Among Us Version
16 |
17 | ## I confirm:
18 | - [ ] that I have searched for an existing bug report for this issue.
19 |
20 |
21 | ## Symptoms
22 |
23 |
26 |
27 | Enter Symptoms on this line.
28 |
29 | ## Reproduction
30 |
31 |
34 |
35 | Enter reproductions steps here.
36 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 |
6 | jobs:
7 | build:
8 | runs-on: ubuntu-20.04
9 |
10 | steps:
11 | - uses: actions/checkout@v2
12 | with:
13 | submodules: true
14 |
15 | - name: Setup .NET
16 | uses: actions/setup-dotnet@v1
17 | with:
18 | dotnet-version: 5.0.102
19 |
20 | - name: Cake Action
21 | run: |
22 | dotnet tool restore
23 | dotnet cake build.cake --bootstrap
24 | dotnet cake build.cake --pack
25 |
26 | - uses: actions/upload-artifact@v2
27 | with:
28 | path: ./build/*.zip
29 |
--------------------------------------------------------------------------------
/src/Impostor.Benchmarks/Data/Span/MessageReaderOwner.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Benchmarks.Data.Span
4 | {
5 | public class MessageReaderOwner
6 | {
7 | private readonly Memory _data;
8 |
9 | public MessageReaderOwner(Memory data)
10 | {
11 | _data = data;
12 | }
13 |
14 | public int Position { get; internal set; }
15 | public int Length => _data.Length;
16 |
17 | public MessageReader_Span CreateReader()
18 | {
19 | return new MessageReader_Span(this, byte.MaxValue, _data.Span.Slice(Position));
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/SecurityCameraSystemType.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Messages;
2 |
3 | namespace Impostor.Server.Net.Inner.Objects.Systems.ShipStatus
4 | {
5 | public class SecurityCameraSystemType : ISystemType
6 | {
7 | public byte InUse { get; internal set; }
8 |
9 | public void Serialize(IMessageWriter writer, bool initialState)
10 | {
11 | throw new System.NotImplementedException();
12 | }
13 |
14 | public void Deserialize(IMessageReader reader, bool initialState)
15 | {
16 | InUse = reader.ReadByte();
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Events/Announcements/IAnnouncementRequestEvent.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Events.Announcements
4 | {
5 | public interface IAnnouncementRequestEvent : IEvent
6 | {
7 | public interface IResponse
8 | {
9 | public FreeWeekendState FreeWeekendState { get; set; }
10 |
11 | public bool UseCached { get; set; }
12 |
13 | public Announcement? Announcement { get; set; }
14 | }
15 |
16 | public int Id { get; }
17 |
18 | public Language Language { get; }
19 |
20 | public IResponse Response { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/C2S/Message01JoinGameC2S.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Api.Net.Messages.C2S
4 | {
5 | public static class Message01JoinGameC2S
6 | {
7 | public static void Serialize(IMessageWriter writer)
8 | {
9 | throw new System.NotImplementedException();
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out int gameCode, out byte unknown)
13 | {
14 | var slice = reader.ReadBytes(sizeof(Int32) + sizeof(byte)).Span;
15 |
16 | gameCode = slice.ReadInt32();
17 | unknown = slice.ReadByte();
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/C2S/Message00HostGameC2S.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Net.Messages.C2S
4 | {
5 | public static class Message00HostGameC2S
6 | {
7 | public static void Serialize(IMessageWriter writer, GameOptionsData gameOptionsData)
8 | {
9 | writer.StartMessage(MessageFlags.HostGame);
10 | gameOptionsData.Serialize(writer);
11 | writer.EndMessage();
12 | }
13 |
14 | public static GameOptionsData Deserialize(IMessageReader reader)
15 | {
16 | return GameOptionsData.DeserializeCreate(reader);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Config/AnnouncementsServerConfig.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Server.Utils;
2 |
3 | namespace Impostor.Server.Config
4 | {
5 | internal class AnnouncementsServerConfig
6 | {
7 | private string? _resolvedListenIp;
8 |
9 | public const string Section = "AnnouncementsServer";
10 |
11 | public bool Enabled { get; set; } = true;
12 |
13 | public string ListenIp { get; set; } = "0.0.0.0";
14 |
15 | public ushort ListenPort { get; set; } = 22024;
16 |
17 | public string ResolveListenIp()
18 | {
19 | return _resolvedListenIp ??= IpUtils.ResolveIp(ListenIp);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/Objects/Systems/ShipStatus/HudOverrideSystemType.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Net.Messages;
2 |
3 | namespace Impostor.Server.Net.Inner.Objects.Systems.ShipStatus
4 | {
5 | public class HudOverrideSystemType : ISystemType, IActivatable
6 | {
7 | public bool IsActive { get; private set; }
8 |
9 | public void Serialize(IMessageWriter writer, bool initialState)
10 | {
11 | throw new System.NotImplementedException();
12 | }
13 |
14 | public void Deserialize(IMessageReader reader, bool initialState)
15 | {
16 | IsActive = reader.ReadBoolean();
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc29SetTasks.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc29SetTasks
6 | {
7 | public static void Serialize(IMessageWriter writer, byte playerId, ReadOnlyMemory taskTypeIds)
8 | {
9 | writer.Write(playerId);
10 | writer.Write(taskTypeIds);
11 | }
12 |
13 | public static void Deserialize(IMessageReader reader, out byte playerId, out ReadOnlyMemory taskTypeIds)
14 | {
15 | playerId = reader.ReadByte();
16 | taskTypeIds = reader.ReadBytesAndSize();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Exceptions/ImpostorException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace Impostor.Api
5 | {
6 | public class ImpostorException : Exception
7 | {
8 | public ImpostorException()
9 | {
10 | }
11 |
12 | protected ImpostorException(SerializationInfo info, StreamingContext context) : base(info, context)
13 | {
14 | }
15 |
16 | public ImpostorException(string? message) : base(message)
17 | {
18 | }
19 |
20 | public ImpostorException(string? message, Exception? innerException) : base(message, innerException)
21 | {
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Impostor.Hazel/Impostor.Hazel.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 | net5.0
6 | HAZEL_BAG
7 | 1.0.0
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Config/ServerRedirectorConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Impostor.Server.Config
4 | {
5 | public class ServerRedirectorConfig
6 | {
7 | public const string Section = "ServerRedirector";
8 |
9 | public bool Enabled { get; set; }
10 |
11 | public bool Master { get; set; }
12 |
13 | public NodeLocator Locator { get; set; }
14 |
15 | public List Nodes { get; set; }
16 |
17 | public class NodeLocator
18 | {
19 | public string Redis { get; set; }
20 |
21 | public string UdpMasterEndpoint { get; set; }
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Plugins/ImpostorPluginAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Impostor.Api.Plugins
4 | {
5 | [AttributeUsage(AttributeTargets.Class)]
6 | public class ImpostorPluginAttribute : Attribute
7 | {
8 | public ImpostorPluginAttribute(string package, string name, string author, string version)
9 | {
10 | Package = package;
11 | Name = name;
12 | Author = author;
13 | Version = version;
14 | }
15 |
16 | public string Package { get; }
17 |
18 | public string Name { get; }
19 |
20 | public string Author { get; }
21 |
22 | public string Version { get; }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/C2S/Message10AlterGameC2S.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Net.Messages.C2S
4 | {
5 | public class Message10AlterGameC2S
6 | {
7 | public static void Serialize(IMessageWriter writer)
8 | {
9 | throw new System.NotImplementedException();
10 | }
11 |
12 | public static void Deserialize(IMessageReader reader, out AlterGameTags gameTag, out bool isPublic)
13 | {
14 | var slice = reader.ReadBytes(sizeof(byte) + sizeof(byte)).Span;
15 |
16 | gameTag = (AlterGameTags)slice.ReadByte();
17 | isPublic = slice.ReadBoolean();
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Rpcs/Rpc16SendChatNote.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Net.Messages.Rpcs
4 | {
5 | public static class Rpc16SendChatNote
6 | {
7 | public static void Serialize(IMessageWriter writer, byte playerId, ChatNoteType chatNoteType)
8 | {
9 | writer.Write(playerId);
10 | writer.Write((byte)chatNoteType);
11 | }
12 |
13 | public static void Deserialize(IMessageReader reader, out byte playerId, out ChatNoteType chatNoteType)
14 | {
15 | playerId = reader.ReadByte();
16 | chatNoteType = (ChatNoteType)reader.ReadByte();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Announcements/Message02SetFreeWeekend.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Innersloth;
2 |
3 | namespace Impostor.Api.Net.Messages.Announcements
4 | {
5 | public static class Message02SetFreeWeekend
6 | {
7 | public static void Serialize(IMessageWriter writer, FreeWeekendState state)
8 | {
9 | writer.StartMessage(AnnouncementsMessageFlags.SetFreeWeekend);
10 | writer.Write((byte)state);
11 | writer.EndMessage();
12 | }
13 |
14 | public static void Deserialize(IMessageReader reader, out FreeWeekendState state)
15 | {
16 | state = (FreeWeekendState)reader.ReadByte();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Net/Messages/Announcements/Message01Update.cs:
--------------------------------------------------------------------------------
1 | namespace Impostor.Api.Net.Messages.Announcements
2 | {
3 | public static class Message01Update
4 | {
5 | public static void Serialize(IMessageWriter writer, int id, string message)
6 | {
7 | writer.StartMessage(AnnouncementsMessageFlags.SetUpdate);
8 | writer.WritePacked(id);
9 | writer.Write(message);
10 | writer.EndMessage();
11 | }
12 |
13 | public static void Deserialize(IMessageReader reader, out int id, out string message)
14 | {
15 | id = reader.ReadPackedInt32();
16 | message = reader.ReadString();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Impostor.Api/Exceptions/ImpostorConfigException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace Impostor.Api
5 | {
6 | public class ImpostorConfigException : ImpostorException
7 | {
8 | public ImpostorConfigException()
9 | {
10 | }
11 |
12 | protected ImpostorConfigException(SerializationInfo info, StreamingContext context) : base(info, context)
13 | {
14 | }
15 |
16 | public ImpostorConfigException(string? message) : base(message)
17 | {
18 | }
19 |
20 | public ImpostorConfigException(string? message, Exception? innerException) : base(message, innerException)
21 | {
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Events/EventHandler.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events;
2 | using Impostor.Server.Events.Register;
3 |
4 | namespace Impostor.Server.Events
5 | {
6 | internal readonly struct EventHandler
7 | {
8 | public EventHandler(IEventListener o, IRegisteredEventListener listener)
9 | {
10 | Object = o;
11 | Listener = listener;
12 | }
13 |
14 | public IEventListener Object { get; }
15 |
16 | public IRegisteredEventListener Listener { get; }
17 |
18 | public void Deconstruct(out IEventListener o, out IRegisteredEventListener listener)
19 | {
20 | o = Object;
21 | listener = Listener;
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Reactor/ModdedHandshakeC2S.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Impostor.Api.Net.Messages;
3 |
4 | namespace Impostor.Api.Reactor
5 | {
6 | public static class ModdedHandshakeC2S
7 | {
8 | public static void Deserialize(IMessageReader reader, out int clientVersion, out string name, out ISet? mods)
9 | {
10 | clientVersion = reader.ReadInt32();
11 | name = reader.ReadString();
12 |
13 | if (reader.Length > reader.Position)
14 | {
15 | ModList.Deserialize(reader, out mods);
16 | }
17 | else
18 | {
19 | mods = null;
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Plugins/LoadedAssemblyInformation.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.Loader;
3 |
4 | namespace Impostor.Server.Plugins
5 | {
6 | public class LoadedAssemblyInformation : IAssemblyInformation
7 | {
8 | private readonly Assembly _assembly;
9 |
10 | public LoadedAssemblyInformation(Assembly assembly)
11 | {
12 | AssemblyName = assembly.GetName();
13 | _assembly = assembly;
14 | }
15 |
16 | public AssemblyName AssemblyName { get; }
17 |
18 | public bool IsPlugin => false;
19 |
20 | public Assembly Load(AssemblyLoadContext context)
21 | {
22 | return _assembly;
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/Impostor.Api/Exceptions/ImpostorProtocolException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace Impostor.Api
5 | {
6 | public class ImpostorProtocolException : ImpostorException
7 | {
8 | public ImpostorProtocolException()
9 | {
10 | }
11 |
12 | protected ImpostorProtocolException(SerializationInfo info, StreamingContext context) : base(info, context)
13 | {
14 | }
15 |
16 | public ImpostorProtocolException(string? message) : base(message)
17 | {
18 | }
19 |
20 | public ImpostorProtocolException(string? message, Exception? innerException) : base(message, innerException)
21 | {
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Plugins/PluginLoaderException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using Impostor.Api;
4 |
5 | namespace Impostor.Server.Plugins
6 | {
7 | public class PluginLoaderException : ImpostorException
8 | {
9 | public PluginLoaderException()
10 | {
11 | }
12 |
13 | protected PluginLoaderException(SerializationInfo info, StreamingContext context) : base(info, context)
14 | {
15 | }
16 |
17 | public PluginLoaderException(string? message) : base(message)
18 | {
19 | }
20 |
21 | public PluginLoaderException(string? message, Exception? innerException) : base(message, innerException)
22 | {
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/src/Impostor.Plugins.Example/Handlers/AnnouncementsListener.cs:
--------------------------------------------------------------------------------
1 | using Impostor.Api.Events;
2 | using Impostor.Api.Events.Announcements;
3 | using Impostor.Api.Innersloth;
4 |
5 | namespace Impostor.Plugins.Example.Handlers
6 | {
7 | public class AnnouncementsListener : IEventListener
8 | {
9 | private const int Id = 50;
10 |
11 | [EventListener]
12 | public void OnAnnouncementRequestEvent(IAnnouncementRequestEvent e)
13 | {
14 | if (e.Id == Id)
15 | {
16 | e.Response.UseCached = true;
17 | }
18 | else
19 | {
20 | e.Response.Announcement = new Announcement(Id, "Hello!");
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Impostor.Server/Net/Inner/GameObject.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Impostor.Server.Net.Inner
4 | {
5 | internal class GameObject
6 | {
7 | public GameObject()
8 | {
9 | Components = new List