Updated Plugins (markdown)
parent
85de904930
commit
4f33bc3aff
50
Plugins.md
50
Plugins.md
@ -58,52 +58,4 @@ The following options can be configured by modifying `ActionOnReport.js`
|
||||
|
||||
## Shared GUID Kicker [Script Plugin]
|
||||
- This plugin kicks users using a specific GUID
|
||||
- GUID `F4D2C30B712AC6E3` on IW4x was packed into a torrent version of the game.
|
||||
|
||||
## Extending Plugins
|
||||
|
||||
### NuGet Package
|
||||
The NuGet package for **IW4MAdmin's** "Shared Library" can be obtained from the [NuGet Gallery](https://www.nuget.org/packages/RaidMax.IW4MAdmin.SharedLibraryCore)
|
||||
Referencing this package will give you the ability to write plugins against **IW4MAdmin's** core library.
|
||||
### Code
|
||||
**IW4MAdmin's** functionality can be extended by writing additional plugins in C#.
|
||||
Each class library must implement the `IPlugin` interface.
|
||||
See the existing [plugins](https://github.com/RaidMax/IW4M-Admin/tree/master/Plugins) for examples.
|
||||
### JavaScript
|
||||
**IW4MAdmin** functionality can also be extended using JavaScript.
|
||||
The JavaScript parser supports [ECMA 5.1](https://ecma-international.org/ecma-262/5.1/) standards.
|
||||
### Plugin Object Template
|
||||
In order to be properly parsed by the JavaScript engine, every plugin must conform to the following template.
|
||||
```js
|
||||
var plugin = {
|
||||
author: 'YourHandle',
|
||||
version: 1.0,
|
||||
name: 'Sample JavaScript Plugin',
|
||||
|
||||
onEventAsync: function (gameEvent, server) {
|
||||
},
|
||||
|
||||
onLoadAsync: function (manager) {
|
||||
},
|
||||
|
||||
onUnloadAsync: function () {
|
||||
},
|
||||
|
||||
onTickAsync: function (server) {
|
||||
}
|
||||
};
|
||||
```
|
||||
### Required Properties
|
||||
- `author` — [string] Author of the plugin (usually your name or online name/alias)
|
||||
- `version` — [float] Version number of your plugin (useful if you release several different versions)
|
||||
- `name` — [string] Name of your plugin (be descriptive!)
|
||||
- `onEventAsync` — [function] Handler executed when an event occurs
|
||||
- `gameEvent` — [parameter object] Object containing event type, origin, target, and other info (see the GameEvent class declaration)
|
||||
- `server` — [parameter object] Object containing information and methods about the server the event occured on (see the Server class declaration)
|
||||
- `onLoadAsync` — [function] Handler executed when the plugin is loaded by code
|
||||
- `manager` — [parameter object] Object reference to the application manager (see the IManager interface definition)
|
||||
- `onUnloadAsync` — [function] Handler executed when the plugin is unloaded by code (see live reloading)
|
||||
- `onTickAsync` — [function] Handler executed approximately once per second by code *(unimplemented as of version 2.\*)*
|
||||
- `server` — [parameter object] Object containing information and methods about the server the event occured on (see the Server class declaration)
|
||||
### Live Reloading
|
||||
Thanks to JavaScript's flexibility and parsability, the plugin importer scans the plugins folder and reloads the JavaScript plugins on demand as they're modified. This allows faster development/testing/debugging.
|
||||
- GUID `F4D2C30B712AC6E3` on IW4x was packed into a torrent version of the game.
|
Loading…
Reference in New Issue
Block a user