mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-18 05:51:12 +00:00
add basic example to examples/ and README.md to use flying-squid as a server lib
This commit is contained in:
parent
94926df8da
commit
489296f96b
2 changed files with 31 additions and 0 deletions
20
README.md
20
README.md
|
|
@ -36,6 +36,26 @@ Documentation for how to operate and how to customize your server are coming soo
|
|||
## Dev Documentation
|
||||
For development see [api.md](doc/api.md) and [contribute.md](doc/contribute.md)
|
||||
|
||||
## Using as a lib
|
||||
|
||||
Flying-squid is also a server lib. Here is a basic example of usage :
|
||||
|
||||
```js
|
||||
var mcServer=require("flying-squid");
|
||||
|
||||
mcServer.createMCServer({
|
||||
motd: "Basic craftyjs server",
|
||||
'max-players': 10,
|
||||
port: 25565,
|
||||
'online-mode': true,
|
||||
gameMode:0,
|
||||
commands: {},
|
||||
logging:false
|
||||
});
|
||||
```
|
||||
|
||||
You can add server plugins and player plugins in your package, following [contribute.md](doc/contribute.md).
|
||||
|
||||
## Contributors
|
||||
|
||||
- @roblabla for helping out with the protocols
|
||||
|
|
|
|||
11
examples/basic.js
Normal file
11
examples/basic.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
var mcServer=require("..");
|
||||
|
||||
mcServer.createMCServer({
|
||||
motd: "Basic craftyjs server",
|
||||
'max-players': 10,
|
||||
port: 25565,
|
||||
'online-mode': true,
|
||||
gameMode:0,
|
||||
commands: {},
|
||||
logging:false
|
||||
});
|
||||
Loading…
Reference in a new issue