Extract raw Slippi data directly from the console or from a Slippi relay
Details
With NPM
npm install @vinceau/slp-wii-connect
With Yarn
yarn add @vinceau/slp-wii-connect
const { ConsoleConnection } = require("@vinceau/slp-wii-connect");
const connection = new ConsoleConnection();
connection.connect("133.221.123.111", 1667);
connection.on("data", (data) => {
// Received data from console
console.log(data);
});
connection.on("statusChange", (status) => {
console.log(`status changed: ${status}`);
});
Attempt connection to a Wii or Slippi relay.
The IP address to connect to.
- Required:
true
- Type:
string
The port to connect through.
- Required:
true
- Type:
number
The milliseconds to wait before a connection attempt fails.
- Required:
false
- Type:
number
Terminates the existing connection.
Returns ConnectionStatus
.
Returns ConnectionSettings
.
Returns ConnectionDetails
.
You can subscribe to the following events using the connection.on()
method. For example:
connection.on("data", (data) => {
console.log(`Got the following data: ${data}`);
});
(data: Uint8Array) => void
Emitted when game data is received.
(details: ConnectionDetails) => void
Emitted for all handshake messages.
(status: ConnectionStatus) => void
Emitted whenever the connection status changes.
Key | Type |
---|---|
ipAddress |
string |
port |
number |
Key | Type |
---|---|
consoleNickname |
string |
gameDataCursor |
Uint8Array |
version |
string |
clientToken |
number |
A number representing the current connection status. Possible values are as follows:
Value | Status |
---|---|
0 | Disconnected |
1 | Connecting |
2 | Connected |
3 | Reconnecting |
To build the library from source:
yarn run build
To start the development server:
yarn run watch
This library is largely taken from code available in the slippi-desktop-app
. Credits to Jas Laferriere and the rest of the Project Slippi team.
This software is released under the terms of LGPL-3.0 license.