Natural Selection 2

Natural Selection 2

Ei tarpeeksi arvosteluja
[Shine] External Shuffle
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Modification: Tool
Compatibility: Must be run on Server
Tiedostokoko
Julkaistu
Päivitetty
4.137 KB
12.6.2018 klo 23.16
1.2.2019 klo 16.53
48 muutosilmoitusta ( näytä )

Tilaa ladataksesi
[Shine] External Shuffle

Kuvaus
This Shine plugin enables you to develop your own shuffle and ranking API externally, and to communicate to it via HTTP POST requests.

Requires Shine Administration and NS2+ to work.

modid: 541102EF

These are the two endpoints that your API must provide:

POST /player/scoreboard_data

POST Params:
ns2id: int
hiveskill: int

Example request:
ns2id: 37745947 hiveskill: 4000

Example response:
{ "ns2id": 37745947, "marine_skill": 3967, "alien_skill": 4611 }

This is only used to show the skill numbers in the scoreboard and the client side average calculation on top of it, nothing else. Using the provided player hiveskill param in your own API is optional.
Of course you can't expect to calculate skills with only those provided params, your API should use external data like NS2+/Wonitor.


POST /shuffle

POST Params:
ns2ids: string([ns2id_player1, ns2id_player2, ...])
hiveskills: string([hiveskill_player1, hiveskill_player2, ...])

Example request:

ns2ids: [1291449, 3869225, 34583831, 41727273, 44513487, 44618947, 54888603, 55422011, 57378783, 79089452, 81009203, 98383317, 139217532, 333858003, 356935348, 393094819] hiveskills: [11, 22, 310, 20, 50, 120, 30, 50, 70, 81, 88, 23, 24, 56, 78, 819]

Example response:
{ "team1": [ 1291449, 34583831, 41727273, 44618947, 79089452, 81009203, 98383317, 139217532 ], "team2": [ 3869225, 44513487, 54888603, 55422011, 57378783, 333858003, 356935348, 393094819 ], "diagnostics": { "RScore": "5.00", "Score": "167.79", "Time elapsed": "84.816483ms", "Version": "1.1" }, "success": true, "msg": "Shuffled successfully." }

All the JSON keys (team1, team2, diagnostics, success, msg) should always be returned by your API. The keys inside diagnostics are optional, you could add more or change the names of those, but always return a string as value. They show in the chat after a successful shuffle.

API examples
NS2SUD's per team hiveskills, calculated from hiveskill and trailing per team winrate
Python (deprecated): https://github.com/Tikzz/ns2-skill
Golang: https://github.com/Tikzz/ns2-skill-go

Plugin source code
https://github.com/Tikzz/external-shuffle

Art by Mahadon