Fix always connecting to localhost

main
copygirl 5 years ago
parent 1fa5ee9b63
commit 5b4890e136
  1. 14
      scene/EscapeMenu.tscn
  2. 4
      src/EscapeMenuMultiplayer.cs

@ -79,9 +79,9 @@ ColorSliderPath = NodePath("VBoxContainer/ContainerColor/Hue")
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer/TabContainer/Appearance"] [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer/TabContainer/Appearance"]
margin_left = 19.0 margin_left = 19.0
margin_top = 24.0 margin_top = 14.0
margin_right = 201.0 margin_right = 201.0
margin_bottom = 63.0 margin_bottom = 72.0
[node name="ContainerName" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer/TabContainer/Appearance/VBoxContainer"] [node name="ContainerName" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer/TabContainer/Appearance/VBoxContainer"]
margin_right = 182.0 margin_right = 182.0
@ -133,6 +133,16 @@ max_value = 1.0
step = 0.0 step = 0.0
scrollable = false scrollable = false
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/TabContainer/Appearance/VBoxContainer"]
margin_top = 42.0
margin_right = 182.0
margin_bottom = 57.0
rect_min_size = Vector2( 0, 15 )
custom_colors/font_color = Color( 0.6, 0.6, 0.6, 1 )
text = "(Close Menu to apply changes.)"
align = 1
valign = 1
[node name="Multiplayer" type="VBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer/TabContainer"] [node name="Multiplayer" type="VBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer/TabContainer"]
visible = false visible = false
anchor_right = 1.0 anchor_right = 1.0

@ -97,8 +97,8 @@ public class EscapeMenuMultiplayer : Container
var port = Network.DEFAULT_PORT; var port = Network.DEFAULT_PORT;
if (ClientAddress.Text.Length > 0) { if (ClientAddress.Text.Length > 0) {
// TODO: Verify input some more, support IPv6? // TODO: Verify input some more, support IPv6?
var split = address.Split(':'); var split = ClientAddress.Text.Split(':');
address = (split.Length > 1) ? split[0] : address; address = (split.Length > 1) ? split[0] : ClientAddress.Text;
port = (split.Length > 1) ? ushort.Parse(split[1]) : port; port = (split.Length > 1) ? ushort.Parse(split[1]) : port;
} }
Network.Instance.ConnectToServer(address, port); Network.Instance.ConnectToServer(address, port);

Loading…
Cancel
Save