add contribute file

This commit is contained in:
Romain Beaumont 2015-08-27 02:06:29 +02:00
parent 757b049c15
commit 0022f59d8c
2 changed files with 37 additions and 1 deletions

View file

@ -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! Documentation for how to operate and how to customize your server are coming soon!
## Dev Documentation ## 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 ## Contributors

36
doc/contribute.md Normal file
View file

@ -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
}
```