Git Product home page Git Product logo

wot-battle-results-server's Introduction

WoT Battle Results Server

WoT mod which starts a WebSocket server on ws://localhost:15455 for serving battle results.

The server has a peer dependency on WoT Websocket Server, WoT Async Server, WoT Async, and WoT Hooking.

Demo Apps

Live WN8 (Source)

Live Win Rate (Source)

Origin Whitelisting

Origins need to be whitelisted to protect against malicious websites. All localhost origins are white listed for local testing.

Please open an issue if you want to deploy your app and need your origin to be included in the whitelist.

Protocol

The server uses a protocol which is based on JSON-RPC 2.0.

Guarantees:

  • Responses will be sent in the order in which the requests were sent.
  • Requests are processed atomically. This is also true for batch requests. I.e. while your request is being processed, no other request from any client is handled. Also, no notifications will be sent.
  • The individual responses of a batch response will have the same order as the individual requests of the corresponding batch request.
  • Notifications are not sent in batches.

subscribe

Subscribes this client to the feed of battle results.

Request

{
  "jsonrpc": "2.0",
  "method": "subscribe",
  "id": 42
}

Response

{
  "jsonrpc": "2.0",
  "result": null,
  "id": 42
}

unsubscribe

Unsubscribes this client from the feed of battle results.

Request

{
  "jsonrpc": "2.0",
  "method": "unsubscribe",
  "id": 42
}

Response

{
  "jsonrpc": "2.0",
  "result": null,
  "id": 42
}

get_battle_results

Sends all recorded battle results of the current gaming session to the client.

Params

  • after: optional timestamp to only replay battle results after the given timestamp. Can be omitted.

Request

{
  "jsonrpc": "2.0",
  "method": "get_battle_results",
  "params": {
    "after": 1587657932
  },
  "id": 42
}

Response

{
  "jsonrpc": "2.0",
  "result": {
    "start": 1587657932,
    "end": 1587659370,
    "battleResults": [ /* ... */ ]
  },
  "id": 42
}

subscription notification

Sent from the server when a new battle result has been received.

{
  "jsonrpc": "2.0",
  "method": "subscription",
  "params": {
    "timestamp": 1587657932,
    "battleResult": { /* ... */ }
  }
}

wot-battle-results-server's People

Contributors

lgfrbcsgo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.