diff --git a/README.md b/README.md index 588bd6d..e05c684 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Before running or building it is recommended that you configure the server in co Documentation for how to operate and how to customize your server are coming soon! ## Dev Documentation -For development see [api.md](doc/api.md) +For development see [api.md](doc/api.md) and [contribute.md](doc/contribute.md) ## Contributors diff --git a/doc/contribute.md b/doc/contribute.md new file mode 100644 index 0000000..2cdb8d3 --- /dev/null +++ b/doc/contribute.md @@ -0,0 +1,36 @@ +# Contribute + +## Architecture of the project + +Directory architecture : + +* app.js : specific settings and actually start the server +* index.js : contain the generic server implementation +* lib/ : contain the classes and functions used in the plugins + * serverPlugins/ : server plugins that do things general to the server, + properties and method are added to the server object in them + * playerPlugins/ : player plugins that do things for each player, + properties and method are added to the player object in them + +Structure of a server plugin : + +```js +module.exports=inject; + +function inject(serv) +{ + // add methods and properties to serv +} +``` + +Structure of a player plugin : + +```js +module.exports=inject; + +function inject(serv,player) +{ + // add methods and properties to player + // you can use serv, but you shouldn't add things to it here +} +``` \ No newline at end of file