summaryrefslogtreecommitdiff
path: root/Network
diff options
context:
space:
mode:
Diffstat (limited to 'Network')
-rw-r--r--Network/Lobby.gd6
-rw-r--r--Network/Network.gd5
-rw-r--r--Network/Remote.gd6
-rw-r--r--Network/Sync.gd6
4 files changed, 8 insertions, 15 deletions
diff --git a/Network/Lobby.gd b/Network/Lobby.gd
index b30bc1f..d192640 100644
--- a/Network/Lobby.gd
+++ b/Network/Lobby.gd
@@ -60,7 +60,11 @@ func _on_Host_pressed():
$Players.show()
$Connect/Error.text = ""
- $Players/IP.text = IP.get_local_addresses()[6]
+ for ip in IP.get_local_addresses():
+ if ip.begins_with("192.168"):
+ $Players/IP.text = ip
+ break
+
var player_name = $Connect/Name.text
Network.host_game(player_name)
self.refresh_lobby()
diff --git a/Network/Network.gd b/Network/Network.gd
index fbef800..d58de75 100644
--- a/Network/Network.gd
+++ b/Network/Network.gd
@@ -22,6 +22,7 @@ var player = {
name = "",
character = "Tux",
}
+var winning_player = player
# Dictionary { id = { idx: 1, name: "" } }
var players = {}
@@ -111,8 +112,8 @@ func _on_Global_game_won(winning_player):
sync func _end_game(winning_player):
- print("winning_player")
- emit_signal("game_ended", winning_player)
+ self.winning_player = winning_player
+ emit_signal("game_ended")
func _player_connected(_id):
diff --git a/Network/Remote.gd b/Network/Remote.gd
deleted file mode 100644
index 1b1de57..0000000
--- a/Network/Remote.gd
+++ /dev/null
@@ -1,6 +0,0 @@
-extends Node
-
-# rpc remote functions
-
-func _ready():
- pass
diff --git a/Network/Sync.gd b/Network/Sync.gd
deleted file mode 100644
index cb81ec8..0000000
--- a/Network/Sync.gd
+++ /dev/null
@@ -1,6 +0,0 @@
-extends Node
-
-# rpc sync functions
-
-func _ready():
- pass