1.1.1 • Published 5 years ago

planetside-stream-api v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Planetside 2 Stream API Wrapper

License: MIT GitHub issues npm

An API wrapper to access events of the game Planetside2

Getting Started

First of all you have to create the Api object:

var PlanetsideWrapper = require("planetside-stream-api");
var constants = require("planetside-stream-api/lib/constants");

var api = new PlanetsideWrapper(constants.SERVERS.PC);

// Or if you have a service id: 
var api = new PlanetsideWrapper(constants.SERVERS.PC, "example");

Now you need to subscribe to some events:

api.on("open", () => {
    console.log("Connected to Census!");
    api.subscribe(["13"], ["FacilityControl"]);
});

And then you can access all events as part of nodes events module:

api.on("FacilityControl", data => {
    console.log(data);
});

If you want to unsubscribe again:

api.unsubscribe(["13"], ["FacilityControl"]);
// Or unsubscribe from everything
api.unsubscribeAll()

Installing

Im just going to assume you use npm to install this library

npm install planetside-stream-api

Running the tests

git clone https://github.com/Planetside-Community-Devs/planetside-stream-api.git
cd planetside-stream-api
npm install
npm test

For additional information of the library on runtime use the debug scope planetside-stream-api

And coding style tests

We are using ESLint to check the library code for style issues. To test run:

npm install
npm run lint

Built With

  • WS - Used to connect to the websocket api - MIT Licensed
  • debug - Used to debug the library - MIT Licensed

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

1.1.1

5 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago