Skip to content

Commit

Permalink
chore: add SERVER_HOSTNAME to default rivet config (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Sep 18, 2024
1 parent a8a4726 commit fee3b39
Show file tree
Hide file tree
Showing 16 changed files with 30,983 additions and 25,555 deletions.
17 changes: 13 additions & 4 deletions addons/rivet/resources/rivet.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@
"lobbies": {
"config": {
"lobbies": {
"regions": ["local"],
"regions": ["atl", "fra", "lax"],
"backend": {
"localDevelopment": {
"tags": { "test": "5" },
"server": {
"environment": {
"SERVER_HOSTNAME": "0.0.0.0"
},
"ports": {
"game": { "protocol": "udp", "port": 7777 }
"game": {
"protocol": "udp",
"internalPort": 7777
}
},
"resources": {
"cpu": 500,
"memory": 500
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions addons/rivet/ui/dock/dock.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,16 @@ unique_name_in_owner = true
visible = false
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 8

[node name="LinkingPending" parent="VBoxContainer/Control" instance=ExtResource("6_7pk2p")]
unique_name_in_owner = true
visible = false
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 8

[node name="Main" parent="VBoxContainer/Control" instance=ExtResource("5_3rpdd")]
unique_name_in_owner = true
layout_mode = 2
theme_override_constants/separation = 2

[connection signal="pressed" from="VBoxContainer/HBoxContainer2/DashboardLink" to="." method="_open_url" binds= ["https://hub.rivet.gg/"]]
[connection signal="pressed" from="VBoxContainer/HBoxContainer2/BugLink" to="." method="_open_url" binds= ["https://hub.rivet.gg/?modal=feedback&utm=godot"]]
Expand Down
8,056 changes: 4,408 additions & 3,648 deletions addons/rivet/ui/dock/screens/linking_pending.tscn

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions addons/rivet/ui/dock/screens/login.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[ext_resource type="Script" path="res://addons/rivet/ui/dock/screens/login.gd" id="1_hppol"]

[sub_resource type="Image" id="Image_w4wnv"]
[sub_resource type="Image" id="Image_rj76g"]
data = {
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 180, 224, 224, 224, 195, 231, 231, 231, 21, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 231, 231, 231, 21, 224, 224, 224, 195, 224, 224, 224, 178, 255, 255, 255, 0, 255, 255, 255, 0, 224, 224, 224, 195, 224, 224, 224, 255, 224, 224, 224, 210, 231, 231, 231, 21, 255, 255, 255, 0, 255, 255, 255, 0, 231, 231, 231, 21, 224, 224, 224, 211, 224, 224, 224, 255, 224, 224, 224, 194, 255, 255, 255, 0, 255, 255, 255, 0, 231, 231, 231, 21, 224, 224, 224, 210, 224, 224, 224, 255, 224, 224, 224, 210, 231, 231, 231, 21, 231, 231, 231, 21, 224, 224, 224, 211, 224, 224, 224, 255, 224, 224, 224, 210, 230, 230, 230, 20, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 231, 231, 231, 21, 224, 224, 224, 210, 224, 224, 224, 255, 224, 224, 224, 232, 224, 224, 224, 232, 224, 224, 224, 255, 224, 224, 224, 210, 230, 230, 230, 20, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 231, 231, 231, 21, 224, 224, 224, 210, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 210, 230, 230, 230, 20, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 231, 231, 231, 21, 224, 224, 224, 194, 224, 224, 224, 194, 230, 230, 230, 20, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
"format": "RGBA8",
Expand All @@ -11,8 +11,8 @@ data = {
"width": 12
}

[sub_resource type="ImageTexture" id="ImageTexture_jvnti"]
image = SubResource("Image_w4wnv")
[sub_resource type="ImageTexture" id="ImageTexture_cbygr"]
image = SubResource("Image_rj76g")

[node name="Login" type="VBoxContainer"]
theme_override_constants/separation = 8
Expand All @@ -28,7 +28,7 @@ text = "Sign in to Rivet"
unique_name_in_owner = true
layout_mode = 2
text = "Advanced options"
icon = SubResource("ImageTexture_jvnti")
icon = SubResource("ImageTexture_cbygr")
flat = true
alignment = 0
icon_alignment = 2
Expand Down
4 changes: 2 additions & 2 deletions addons/rivet/ui/dock/screens/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[ext_resource type="Texture2D" uid="uid://bdabu2ie8j4is" path="res://addons/rivet/images/font_awesome/puzzle.svg" id="6_de7yl"]
[ext_resource type="PackedScene" uid="uid://dpbt1rjht2tef" path="res://addons/rivet/ui/dock/tabs/modules_tab.tscn" id="11_oo0gp"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wru5u"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_3raom"]
content_margin_left = 4.0
content_margin_top = 4.0
content_margin_right = 4.0
Expand Down Expand Up @@ -96,7 +96,7 @@ flat = true
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_wru5u")
theme_override_styles/panel = SubResource("StyleBoxFlat_3raom")
current_tab = 0
tabs_visible = false

Expand Down
8,118 changes: 4,439 additions & 3,679 deletions addons/rivet/ui/dock/tabs/dev_tab.tscn

Large diffs are not rendered by default.

8,096 changes: 4,428 additions & 3,668 deletions addons/rivet/ui/dock/tabs/modules_tab.tscn

Large diffs are not rendered by default.

8,060 changes: 4,405 additions & 3,655 deletions addons/rivet/ui/dock/tabs/settings_tab.tscn

Large diffs are not rendered by default.

8,088 changes: 4,424 additions & 3,664 deletions addons/rivet/ui/dock/tabs/setup_tab.tscn

Large diffs are not rendered by default.

8,066 changes: 4,408 additions & 3,658 deletions addons/rivet/ui/elements/setup_step.tscn

Large diffs are not rendered by default.

7,920 changes: 4,380 additions & 3,540 deletions addons/rivet/ui/elements/task_logs.tscn

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions examples/lobbies_servers/addons/rivet_sdk/multiplayer_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,18 @@ func setup_multiplayer():

peer = ENetMultiplayerPeer.new()
peer.set_bind_ip(_server_hostname)
peer.create_server(_server_port)
# TODO: crash if create server fails
if peer.create_server(_server_port) != OK:
OS.crash("Failed to create ENet server")

multiplayer.set_multiplayer_peer(peer)
elif transport == Transport.WEB_SOCKET:
RivetLogger.log("Starting WebSocket server: %s:%s" % [_server_hostname, _server_port])

peer = WebSocketMultiplayerPeer.new()
peer.create_server(_server_port, _server_hostname)
# TODO: crash if create server fails
if peer.create_server(_server_port, _server_hostname) != OK:
OS.crash("Failed to create WebSocket server")

multiplayer.set_multiplayer_peer(peer)
else:
RivetLogger.error("Unsupported transport: %s" % transport)
Expand All @@ -150,8 +153,11 @@ func setup_multiplayer():
if response.is_ok():
RivetLogger.log("Lobby ready")
else:
RivetLogger.warning("Lobby ready failed failed: %s" % response.body)
RivetLogger.error("Lobby ready failed failed: %s" % response.body)

# Crash the server so Rivet stops waiting for the server to start
OS.crash("Lobby ready failed")

return

## Connect to a lobby returned from the backend.
Expand Down
49 changes: 49 additions & 0 deletions examples/lobbies_servers/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 9 additions & 24 deletions examples/lobbies_servers/rivet.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,24 @@
"lobbies": {
"config": {
"lobbies": {
"regions": [
"local"
],
"destroyOnEmptyAfter": 60000,
"unreadyExpireAfter": 300000,
"maxPlayers": 16,
"maxPlayersDirect": 16,
"enableCreate": false,
"enableDestroy": false,
"enableFind": true,
"enableFindOrCreate": true,
"enableJoin": true,
"enableList": true,
"regions": ["atl", "fra", "lax"],
"backend": {
"localDevelopment": {
"tags": {
"test": "5"
"server": {
"environment": {
"SERVER_HOSTNAME": "0.0.0.0"
},
"ports": {
"game": {
"protocol": "udp",
"port": 7777
"internalPort": 7777
}
},
"resources": {
"cpu": 500,
"memory": 500
}
}
}
},
"lobbyRules": [],
"players": {
"maxPerIp": 8,
"maxUnconnected": 128,
"unconnectedExpireAfter": 60000,
"autoDestroyAfter": 4147200000
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions rust/rivet-plugin-godot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ godot = { git = "https://github.com/godot-rust/gdext", branch = "master", featur
serde = "1.0"
serde_json = "1.0"
tokio = { version = "1.27", default-features = false, features = ["rt"] }
toolchain = { path = "../../../toolchain/packages/toolchain", package = "rivet-toolchain" }
# toolchain = { git = "https://github.com/rivet-gg/cli.git", rev = "a1fa32db748f3beaf624daffee36f86f6901bba1", package = "rivet-toolchain" }
# toolchain = { path = "../../../toolchain/packages/toolchain", package = "rivet-toolchain" }
toolchain = { git = "https://github.com/rivet-gg/cli.git", rev = "1d7138ab44dbf49523948233f50e019a8053ac57", package = "rivet-toolchain" }
lazy_static = "1.5"

2 changes: 2 additions & 0 deletions scripts/run_dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ const __dirname = dirname(fromFileUrl(Deno.mainModule));

async function findGodotExecutable(): Promise<string | null> {
const possiblePaths = [
"C:\\\Users\\micro\\Downloads\\Godot_v4.3-stable_mono_win64\\Godot_v4.3-stable_mono_win64\\Godot_v4.3-stable_mono_win64.exe",
"godot",
"/usr/bin/godot",
"/usr/local/bin/godot",
"/Applications/Godot.app/Contents/MacOS/Godot",
"/Applications/Godot_mono.app/Contents/MacOS/Godot",
"/Applications/Godot_mono.app/Contents/MacOS/Godot",
"C:\\Program Files\\Godot\\Godot.exe",
"C:\\Program Files (x86)\\Godot\\Godot.exe",
];
Expand Down

0 comments on commit fee3b39

Please sign in to comment.