From 489296f96b0ff54f0cfb93d16cc87b2fada1b6c7 Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Sun, 30 Aug 2015 20:15:50 +0200 Subject: [PATCH] add basic example to examples/ and README.md to use flying-squid as a server lib --- README.md | 20 ++++++++++++++++++++ examples/basic.js | 11 +++++++++++ 2 files changed, 31 insertions(+) create mode 100644 examples/basic.js diff --git a/README.md b/README.md index f6cd031..570c63f 100644 --- a/README.md +++ b/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 diff --git a/examples/basic.js b/examples/basic.js new file mode 100644 index 0000000..14dbb97 --- /dev/null +++ b/examples/basic.js @@ -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 +}); \ No newline at end of file