knockoutcity-sdk v1.19.0
KnockoutCity SDK
A developer friendly unofficial SDK for the private server build of KnockoutCity.
Note
This project is currently in alpha and is undergoing heavy development.
Features
- Authenticate with a private server (with some limitations)
- Listening to various Server Events (e.g. group joins, invites, ...)
- Sending various Commands to the Server (e.g. group invites, match making, ...)
Limitations
- Authentication is currently only possible to private servers. For authentication proxy servers (e.g. KOCity-Proxy) you can use the KnockoutCity Auth Client to get the credentials.
- Joining Gameserver is currently not possible but will hopefully become a feature when the
VNET0
Protocol has been reverse engineered.
Installation
Use your prefered package manager to install knockoutcity-sdk
.
# NPM
npm install knockoutcity-sdk
# Yarn
yarn knockoutcity-sdk
# PNPM
pnpm install knockoutcity-sdk
Usage
// Using required
const kocSDK = require('knockoutcity-sdk');
// Using import
import * as kocSDK from 'knockoutcity-sdk'
// or
import { ... } from 'knockoutcity-sdk'
Also make sure to check the examples
for detailed examples on the usage and possibilities of this sdk.
Connecting to a Server
import { authenticate, KOCWebsocketClient } from 'knockoutcity-sdk';
const BASE_URL = 'http://127.0.0.1:23600';
const kocWebsocketClient = new KOCWebsocketClient(BASE_URL);
const { token } = await authenticate(BASE_URL, 'USERNAME');
// ... register listeners
await kocWebsocketClient.connect(token);
// ... emit events
Listening to Events
kocWebsocketClient.on('EVENT NAME', (data) => {
// ...
});
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
10 days ago
12 days ago
13 days ago
18 days ago
18 days ago
18 days ago
21 days ago
23 days ago
23 days ago
23 days ago
30 days ago
30 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
11 months ago
11 months ago