-
-
Notifications
You must be signed in to change notification settings - Fork 14
[EN] Song Overlay
JBSAN3 edited this page Feb 15, 2023
·
1 revision
Sends game information to compatible BS+ overlays :
- Game version
- Game status (menu, playing)
- Map info before playing a map
- Pause or resume events
- Score events (JSON format)
This module creates a WebSocket that can be used with BeatSaberPlus
To connect to the WebSocket, please use the following address: ws://localhost:2947/socket
The WebSocket sends the following information:
- Handshake info:
{
"_type": "handshake",
"protocolVersion": 1,
"gameVersion": "1.27.0_3631158313",
"playerName": "PLAYER",
"playerPlatformId": "PLATFORM_ID"
}
Name | Description |
---|---|
_type | Message type |
protocolVersion | Protocol version of the websocket system |
gameVersion | Current version of the game |
playerName | Current user name |
playerPlatformId | Current user ID (Steam/Occulus) |
- Game state events:
{
"_type": "event",
"_event": "gameState",
"gameStateChanged": "Menu"
}
Name | Description |
---|---|
_type | Message type |
_event | Event type |
gameStateChanged | State of the game (Menu, Playing) |
- Resume events:
{
"_type": "event",
"_event": "resume",
"resumeTime": 0.021484375
}
Name | Description |
---|---|
_type | Message type |
_event | Event type |
resumeTime | Time at resume in second |
- Pause events:
{
"_type": "event",
"_event": "pause",
"pauseTime": 0.021484375
}
Name | Description |
---|---|
_type | Message type |
_event | Event type |
pauseTime | Time at pause in second |
- Map info events:
{
"_type": "event",
"_event": "mapInfo",
"mapInfoChanged": {
"level_id": "BeThereForYou",
"name": "Be There For You",
"sub_name": "ft. Kinnie Lane",
"artist": "Sedliv",
"mapper": "",
"characteristic": "Standard",
"difficulty": "ExpertPlus",
"duration": 171904,
"BPM": 126.0,
"PP": 0.0,
"BSRKey": "",
"coverRaw": "",
"time": 0.021484375,
"timeMultiplier": 1.0
}
}
Name | Description |
---|---|
_type | Message type |
_event | Event type |
mapInfoChanged.level_id | Level ID |
mapInfoChanged.name | Song name |
mapInfoChanged.sub_name | Song sub-name |
mapInfoChanged.artist | Song artist |
mapInfoChanged.mapper | Map author |
mapInfoChanged.characteristic | Difficulty characteristic (Standard, OneSaber, NoArrows, 360Degree) |
mapInfoChanged.difficulty | Map difficulty |
mapInfoChanged.duration | Song duration in milliseconds |
mapInfoChanged.BPM | Song beats per minute |
mapInfoChanged.PP | Performance points |
mapInfoChanged.BSRKey | BeatSaver key |
mapInfoChanged.coverRaw | Raw cover image |
mapInfoChanged.time | Map time in second |
mapInfoChanged.timeMultiplier | Time multiplier |
- Score events:
{
"_type": "event",
"_event": "score",
"scoreEvent": {
"time": 0.021484375,
"score": 0,
"accuracy": 1.0,
"combo": 0,
"missCount": 0,
"currentHealth": 0.5
}
}
Name | Description |
---|---|
_type | Message type |
_event | Event type |
Score.time | Current time in second |
Score.score | Current score |
Score.accuracy | Current multiplied accuracy |
Score.combo | Current combo |
Score.missCount | Miss & bad cut count for the player |
Score.currentHealth | Current health |