Can't start WebSocket transport

[stdout] [Rivet] Starting WebSocket server: 127.0.0.1:7777
[stderr] ERROR: Condition "get_connection_status() != CONNECTION_DISCONNECTED" is true. Returning: ERR_ALREADY_IN_USE
[stderr] at: create_server (modules/websocket/websocket_multiplayer_peer.cpp:181)
[stderr] ERROR: Failed to create WebSocket server
[stderr] at: (core/core_bind.cpp:254)
[stdout] [Rivet] Starting WebSocket server: 127.0.0.1:7777
[stderr] ERROR: Condition "get_connection_status() != CONNECTION_DISCONNECTED" is true. Returning: ERR_ALREADY_IN_USE
[stderr] at: create_server (modules/websocket/websocket_multiplayer_peer.cpp:181)
[stderr] ERROR: Failed to create WebSocket server
[stderr] at: (core/core_bind.cpp:254)
I tested it in a separate bare project and it starts up fine.
const PORT = 7777
const HOST = "127.0.0.1"
var _server = WebSocketMultiplayerPeer.new()

func _ready():
var err = _server.create_server(PORT, HOST)
if err != OK:
print("Unable to start server")
set_process(false)
else:
print("Server started")
const PORT = 7777
const HOST = "127.0.0.1"
var _server = WebSocketMultiplayerPeer.new()

func _ready():
var err = _server.create_server(PORT, HOST)
if err != OK:
print("Unable to start server")
set_process(false)
else:
print("Server started")
I also tried changing the port and that didn't do anything.
No description
5 Replies
Xen
XenOP14mo ago
Oh okay. I found the problem. create_server is being called twice and it errors out on the second call. What's the best way to go about editing the auto-generated files from rivet_sdk?
ptato
ptato14mo ago
we have our plugin source code at https://github.com/rivet-gg/plugin-godot, if you'd like to tinker with that and build from source
Xen
XenOP14mo ago
I assume it's being generated by the rust plugin, with most of the code being from the toolchain repo?
ptato
ptato14mo ago
yeah it looks like rivet-plugin-godot (https://github.com/rivet-gg/plugin-godot/tree/main/rust/rivet-plugin-godot) provides bindings between the toolchain and godot
GitHub
plugin-godot/rust/rivet-plugin-godot at main · rivet-gg/plugin-godot
🔌 Plugin for Rivet + Godot 4. Contribute to rivet-gg/plugin-godot development by creating an account on GitHub.
ptato
ptato14mo ago
i think the code youre looking for is in this file https://github.com/rivet-gg/plugin-godot/blob/main/examples/lobbies_servers/addons/rivet_sdk/multiplayer_manager.gd, which says its autogenerated but i think thats just because it gets copied into the plugin thats likely the file to edit

Did you find this page helpful?