7 Days To Die Websocket Integration
Introduction
This is a mod for 7 Days To Die. It allows you to connect to the websocket server and receive updates about the game.
IMPORTANT
You as a user are responsible for your own actions. This mod is not intended for revenue generation, and if used in such way, will have no support provided. This mod is provided as is, and as a user of the mod, you must follow all End User License Agreements, and Terms of Service policies provided by The Fun Pimps Entertainment LLC. In no way shape or form is this mod associated with The Fun Pimps Entertainment LLC, or Streamer.bot, and any liabilities for any parties involved shall only be handled between yourself, and The Fun Pimps Entertainment LLC.
In the instance of this mod violating terms and conditions, file a removal request as an issue on the GitHub repository
Setup
To install you need to either download a release, or build the mod yourself.
Download
-
Download the latest release from GitHub
-
Extract the zip file
-
Copy the folder to your 7 Days To Die mods folder
-
Depending on if you want to run single player, or multiplayer, the next step will be different.
- Single Player
- When running the game, disable EAC (Easy Anti-Cheat)
- Multiplayer
- When running the game, enable EAC (Easy Anti-Cheat)
- Single Player
-
Restart the game
Build
-
Clone the repository
-
Run the update local references script
-
Windows
- Right click the script at
./scripts/updateLocalRefs.ps1
- Click
Run with PowerShell
- The script will ask for the path to the 7 Days To Die install directory
- Debugging
- If you get a file not found error, you may need to give the script the full path to the 7 Days To Die install directory
./scripts/updateLocalRefs.ps1 -path /path/to/7dtd
- If you get a file not found error, you may need to give the script the full path to the 7 Days To Die install directory
- Right click the script at
-
Linux or bash compatible shell
./scripts/updateLocalRefs.sh "<path to 7 Days To Die install directory>"
- As 7D2D contains spaces in the path, you need to wrap the path in quotes
- Debugging
- If you get a permission denied error, you may need to give the script execute permissions
chmod +x ./scripts/updateLocalRefs.sh
- If you get a file not found error, you may need to give the script the full path to the 7 Days To Die install directory
./scripts/updateLocalRefs.sh /path/to/7dtd
- If you get a permission denied error, you may need to give the script execute permissions
-
-
Inside visual studio, open
/src
as the project -
Build the project
-
The resulting dll will be in
/src/bin/Debug/
as7DTDWebsockets.dll
-
Make a new folder in your mods folder called
7DTDWebsockets
-
Copy the dll to the new folder
-
Copy
ModInfo.xml
to the new folder -
Copy
Config.xml
to the new folder -
Copy
websocket-sharp.dll
to the new folder -
Copy
UnityEngine.dll
to the new folder -
Copy
UnityEngine.CoreModule.dll
to the new folder -
Copy
0Harmony.dll
to the new folder -
Restart the game
Config.xml
- Host: The hostname of the websocket server
- Port: The port of the websocket server
Usage
Connect to the websocket server; the server will send updates about the game.
Events
- ChatMessage:
ChatMessage {"player": {"name":"PlayerName"}, "message":"Message"}
- PlayerDeath:
PlayerDeath {"player": {"name":"PlayerName"}}
- PlayerKillZombie:
PlayerKillZombie {"player": {"name":"PlayerName"}, "entity":"EntityName"}
- PlayerKillAnimal:
PlayerKillAnimal {"player": {"name":"PlayerName"}, "entity":"EntityName"}
- PlayerJoin:
PlayerJoin {"player": {"name":"PlayerName"}}
- PlayerLeave:
PlayerLeave {"player": {"name":"PlayerName"}}
- PlayerSpawnIn:
PlayerSpawnIn {"player": {"name":"PlayerName"}, "type":"TypeOfSpawn"}
- PlayerDamage:
PlayerDamage {"player": {"name":"PlayerName"}, "damage": "DamageAmount", "cause": "DamageCause"}
- PlayerKillEntity:
PlayerKillEntity {"player": {"name":"PlayerName"}, "entity":"EntityName", "animal":bool, "zombie":bool, "headshot":bool, "weaponType": "WeaponType"}
HTTP API
The HTTP API is not yet fully implemented.
Using:
- Send POST/GET to host:port/api/endpoint
Get
- This is currently not implemented.
Post
/command
: Send a command to the server. The command to send is in the body of the request. The response will be the result of the command.
curl -X POST http://localhost:9000/api/command
-H "Authentication: abc123"
-d 'gettime'
→
Day 3, 06:23
Streamerbot Actions (v1.0.2)
7D2D Websockets.sb (6.6 KB)
- Custom triggers
- Support for all events