mirror of
https://github.com/Empostor/Empostor.git
synced 2026-10-20 01:46:07 +00:00
Empostor renamed
This commit is contained in:
1 parent
06ee138799
commit
39da783fe0
598 files changed
+2115
-1950
No files matched your search
+36
-36
@@ -1,10 +1,10 @@
|
||||
# Writing a plugin
|
||||
|
||||
Impostor has support for plugins. This document will help you to setup a development environment for writing a plugin.
|
||||
Empostor has support for plugins. This document will help you to setup a development environment for writing a plugin.
|
||||
|
||||
- [1. Install .NET Core SDK](#1-install-net-core-sdk)
|
||||
- [2. Create a C# project](#2-create-a-c-project)
|
||||
- [3. Add the Impostor.Api library](#3-add-the-impostorapi-library)
|
||||
- [3. Add the Empostor.Api library](#3-add-the-empostorapi-library)
|
||||
- [Quick](#quick)
|
||||
- [Visual Studio](#visual-studio)
|
||||
- [4. The plugin class](#4-the-plugin-class)
|
||||
@@ -16,7 +16,7 @@ Impostor has support for plugins. This document will help you to setup a develop
|
||||
- [Dependency injection](#dependency-injection)
|
||||
- [Server configuration](#server-configuration)
|
||||
- [Using other libraries](#using-other-libraries)
|
||||
- [Impostor versions](#impostor-versions)
|
||||
- [Empostor versions](#empostor-versions)
|
||||
- [9. Missing/invalid data or want more functions?](#9-missinginvalid-data-or-want-more-functions)
|
||||
|
||||
## 1. Install .NET SDK
|
||||
@@ -41,13 +41,13 @@ When the project has been created, you should have `Class.cs` and `Project.cspro
|
||||
</Project>
|
||||
```
|
||||
|
||||
## 3. Add the Impostor.Api library
|
||||
## 3. Add the Empostor.Api library
|
||||
|
||||
You only have to follow the instructions of one below.
|
||||
|
||||
### Quick
|
||||
|
||||
Install the `Impostor.Api` NuGet package.
|
||||
Install the `Empostor.Api` NuGet package.
|
||||
Make sure to get a prerelease if you are writing a plugin for a dev release of the server.
|
||||
|
||||
### Visual Studio
|
||||
@@ -55,31 +55,31 @@ Make sure to get a prerelease if you are writing a plugin for a dev release of t
|
||||
1. Right click your project.
|
||||
2. Click `Manage NuGet Packages`.
|
||||
3. Click `Browse`.
|
||||
4. Search for `Impostor.Api`.
|
||||
5. Click the `Impostor.Api` result and press install on the right side.
|
||||
4. Search for `Empostor.Api`.
|
||||
5. Click the `Empostor.Api` result and press install on the right side.
|
||||
|
||||
### Dotnet CLI
|
||||
|
||||
1. Open your project folder in command prompt / bash.
|
||||
2. Run `dotnet add package Impostor.Api`.
|
||||
2. Run `dotnet add package Empostor.Api`.
|
||||
|
||||
## 4. The plugin class
|
||||
|
||||
Now the `Impostor.Api` is installed, you need to create a class for your plugin. A plugin **must** contain exactly one. See the code below for an example.
|
||||
Now the `Empostor.Api` is installed, you need to create a class for your plugin. A plugin **must** contain exactly one. See the code below for an example.
|
||||
|
||||
```csharp
|
||||
using System.Threading.Tasks;
|
||||
using Impostor.Api.Events.Managers;
|
||||
using Impostor.Api.Plugins;
|
||||
using Empostor.Api.Events.Managers;
|
||||
using Empostor.Api.Plugins;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Impostor.Plugins.Example
|
||||
namespace Empostor.Plugins.Example
|
||||
{
|
||||
/// <summary>
|
||||
/// The metadata information of your plugin, this is required.
|
||||
/// </summary>
|
||||
[ImpostorPlugin(
|
||||
package: "gg.impostor.example",
|
||||
[EmpostorPlugin(
|
||||
package: "gg.empostor.example",
|
||||
name: "Example",
|
||||
author: "AeonLucid",
|
||||
version: "1.0.0")]
|
||||
@@ -139,11 +139,11 @@ Currently you should have a plugin that loads and does nothing. In order to get
|
||||
Create a new class called `GameEventListener`. Example code:
|
||||
|
||||
```csharp
|
||||
using Impostor.Api.Events;
|
||||
using Impostor.Api.Events.Player;
|
||||
using Empostor.Api.Events;
|
||||
using Empostor.Api.Events.Player;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Impostor.Plugins.Example.Handlers
|
||||
namespace Empostor.Plugins.Example.Handlers
|
||||
{
|
||||
/// <summary>
|
||||
/// A class that listens for two events.
|
||||
@@ -209,15 +209,15 @@ The last step to get your plugin working is to register the event listener, so t
|
||||
```csharp
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Impostor.Api.Events.Managers;
|
||||
using Impostor.Api.Plugins;
|
||||
using Impostor.Plugins.Example.Handlers;
|
||||
using Empostor.Api.Events.Managers;
|
||||
using Empostor.Api.Plugins;
|
||||
using Empostor.Plugins.Example.Handlers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Impostor.Plugins.Example
|
||||
namespace Empostor.Plugins.Example
|
||||
{
|
||||
[ImpostorPlugin(
|
||||
package: "gg.impostor.example",
|
||||
[EmpostorPlugin(
|
||||
package: "gg.empostor.example",
|
||||
name: "Example",
|
||||
author: "AeonLucid",
|
||||
version: "1.0.0")]
|
||||
@@ -264,8 +264,8 @@ Now your plugin is ready to be tested.
|
||||
2. Right click your project and press `Open Folder in File Explorer`.
|
||||
3. Go to `bin/Debug/net8.0/`.
|
||||
4. In this directory, you should find your plugin named `Project.dll`.
|
||||
5. Copy the `Project.dll` to the `plugins` directory in your Impostor server directory.
|
||||
6. (Re)start your Impostor server.
|
||||
5. Copy the `Project.dll` to the `plugins` directory in your Empostor server directory.
|
||||
6. (Re)start your Empostor server.
|
||||
7. Open Among Us, create a game and send a chat message. In the console you should see your plugin being loaded and the messages from the example.
|
||||
|
||||
## 8. Extra
|
||||
@@ -289,7 +289,7 @@ Some extra information that might be useful for those developing plugins.
|
||||
|
||||
### Server configuration
|
||||
|
||||
Constantly copying the plugin dll to your server directory can be pretty annoying. Luckily we have a solution for that. In your Impostor server open the `config.json` and add the `PluginLoader` from the example below, replace the path with the build destination of your plugin.
|
||||
Constantly copying the plugin dll to your server directory can be pretty annoying. Luckily we have a solution for that. In your Empostor server open the `config.json` and add the `PluginLoader` from the example below, replace the path with the build destination of your plugin.
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -301,7 +301,7 @@ Constantly copying the plugin dll to your server directory can be pretty annoyin
|
||||
},
|
||||
"PluginLoader": {
|
||||
"Paths": [
|
||||
"D:\\Projects\\Impostor\\src\\Impostor.Plugins.Example\\bin\\Debug\\net8.0"
|
||||
"D:\\Projects\\Empostor\\src\\Empostor.Plugins.Example\\bin\\Debug\\net8.0"
|
||||
],
|
||||
"LibraryPaths": []
|
||||
}
|
||||
@@ -310,23 +310,23 @@ Constantly copying the plugin dll to your server directory can be pretty annoyin
|
||||
|
||||
### Using other libraries
|
||||
|
||||
Sometimes you need to use libraries that the original Impostor server does not provide. The dll files of these libraries must be placed in the `libraries` folder next to the server executable. You could also provide them by modifying the `PluginLoader.LibraryPaths` option in the `config.json`, similarly to the `PluginLoader.Paths` option.
|
||||
Sometimes you need to use libraries that the original Empostor server does not provide. The dll files of these libraries must be placed in the `libraries` folder next to the server executable. You could also provide them by modifying the `PluginLoader.LibraryPaths` option in the `config.json`, similarly to the `PluginLoader.Paths` option.
|
||||
|
||||
### Impostor versions
|
||||
### Empostor versions
|
||||
|
||||
It is important to use the correct versions when working with `Impostor.Api` prereleases and the `Impostor` dev builds to reduce the chances of mismatching assemblies.
|
||||
It is important to use the correct versions when working with `Empostor.Api` prereleases and the `Empostor` dev builds to reduce the chances of mismatching assemblies.
|
||||
|
||||
**Example**
|
||||
|
||||
The prerelease `Impostor.Api` package `1.2.0-ci.54` belongs to build `54` on AppVeyor, which can be found here https://ci.appveyor.com/project/Impostor/Impostor/build/54. Notice the `54` on the end of the url.
|
||||
The prerelease `Empostor.Api` package `1.2.0-ci.54` belongs to build `54` on AppVeyor, which can be found here https://ci.appveyor.com/project/Empostor/Empostor/build/54. Notice the `54` on the end of the url.
|
||||
|
||||
## 9. Missing/invalid data or want more functions?
|
||||
|
||||
The `Impostor.Api` is currently in beta. There are a lot of things still missing and we would like to hear from you what you need to develop a plugin.
|
||||
The `Empostor.Api` is currently in beta. There are a lot of things still missing and we would like to hear from you what you need to develop a plugin.
|
||||
|
||||
Create an issue:
|
||||
|
||||
- [Suggest a function](https://github.com/Impostor/Impostor/issues/new?template=3--api-suggestion.md)
|
||||
- [Data is invalid](https://github.com/Impostor/Impostor/issues/new?template=4--api-invalid.md)
|
||||
- [Data is unavailable](https://github.com/Impostor/Impostor/issues/new?template=5--api-missing.md)
|
||||
- [Other](https://github.com/Impostor/Impostor/issues/new?template=6--api-other.md)
|
||||
- [Suggest a function](https://github.com/Empostor/Empostor/issues/new?template=3--api-suggestion.md)
|
||||
- [Data is invalid](https://github.com/Empostor/Empostor/issues/new?template=4--api-invalid.md)
|
||||
- [Data is unavailable](https://github.com/Empostor/Empostor/issues/new?template=5--api-missing.md)
|
||||
- [Other](https://github.com/Empostor/Empostor/issues/new?template=6--api-other.md)
|
||||
Reference in new issue
Block a user