-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin system ideas / expections #43
Comments
We'll need to disable |
Simple and cool events based on attributes, i.e. [Plugin] // info about plugin should be gathered from assembly attributes :)
public class TestPlugin
{
public TestPlugin([Inject] EventManager eventManager) // Dependency injection on constructor and properties?
{
eventManager.Subscribe(this);
}
[EventHandler]
public void OnPlayerConnect(PlayerConnectEvent @event)
{
this.Logger.LogInfo(@event.Player.Name); // Microsoft.Extensions.Logging?
}
} I guess I just like reflection |
@GerardSmit I want to put the plugin API stuff in a separate library so it can just be disabled in there. I believe it is also possible to exclude stuff from trimming with annotations but I can't find where I read that anymore. |
I would like to see a way to get low level packet data for if something isn't implemented yet or you just need it. Also, I would like to see a way to cancel relaying the packet to the other players. |
I would like to have a simple enough API for high level things, like chat, maybe commands. IMO it would be nice if plugins could change properties of players and Games directly. A good example to use here is a plugin that would change the number of impostors or the current map, which should technically be possible AFAIK, but isn't in the game probably due to searching for public lobbies. IMO Enabling things that aren't possible with the client's UI is a good use of commands. |
+1, especially for changing the number of imposters. We have "house rules" for game types that require different numbers of imposters. Adding the ability to modify the min and max settings for the in game rules would be nice too. ie. Override the Kill Cooldown minimum to 1 second. Adding webhooks would be really nice too. Even for something as simple as the server running. |
This comment was marked as spam.
This comment was marked as spam.
In terms of the live data, i think it would be better suited to effectively just serve those as events. Connected players? Just log all players who connect with an event callback. States of them? In theory, I would want to have them as an object to manipulate, or at the very least for querying info about them, and having a "playerUpdate" callback that receives the new updated player object whenever something happens to them. |
This comment was marked as spam.
This comment was marked as spam.
Thats plugin territory |
This comment has been minimized.
This comment has been minimized.
1 Suggestion that I talked with AeonLucid about on discord, is a way to cancel events. |
Registering to all kind of events (movement, kill, vent usage, object usage) would be awesome, I'd like to create heatmaps like wot has. |
Currently working on a system for decoding packets to turn these into events. Current project is the settings change packet and I plan to hook that into an event. I also have a semi functional PlayerJoinGame event with cancellable status, however it doesn't cleanly kick the player so there needs to be further modifications to make that work |
maybe "On connect", "On join" and "On disconnect" if not already. "on connect" would be while joining. (possibly cancellation of kicking the player even if the max players is already greater than 10) |
If anyone actually is going to make plugins here, here's suggestions:
|
What about using another scripting language for extensions. Also are extensions server or client? |
The initial beta api is now out, please see https://github.com/Impostor/Impostor/blob/dev/docs/Writing-a-plugin.md and use the issues on the bottom for further discussion. |
The plan is to create a plugin system for Impostor, allowing you to create plugins such as:
You will need to create a C# project (.NET 5 library) and reference the Impostor library. The resulting
.dll
can be placed in aplugins
directory with optionally a directory for the plugin where configs or other data can be stored.Any ideas / wishes you might have regarding the plugin system can be posted in this issue.
The text was updated successfully, but these errors were encountered: