|
@@ -85,7 +85,7 @@ Initializing as a server, listening on the given port, with a given maximum numb
|
|
|
|
|
|
var peer = NetworkedMultiplayerENet.new()
|
|
var peer = NetworkedMultiplayerENet.new()
|
|
peer.create_server(SERVER_PORT, MAX_PLAYERS)
|
|
peer.create_server(SERVER_PORT, MAX_PLAYERS)
|
|
- get_tree().set_network_peer(peer)
|
|
|
|
|
|
+ get_tree().network_peer = peer
|
|
|
|
|
|
Initializing as a client, connecting to a given IP and port:
|
|
Initializing as a client, connecting to a given IP and port:
|
|
|
|
|
|
@@ -93,7 +93,7 @@ Initializing as a client, connecting to a given IP and port:
|
|
|
|
|
|
var peer = NetworkedMultiplayerENet.new()
|
|
var peer = NetworkedMultiplayerENet.new()
|
|
peer.create_client(SERVER_IP, SERVER_PORT)
|
|
peer.create_client(SERVER_IP, SERVER_PORT)
|
|
- get_tree().set_network_peer(peer)
|
|
|
|
|
|
+ get_tree().network_peer = peer
|
|
|
|
|
|
Get the previously set network peer:
|
|
Get the previously set network peer:
|
|
|
|
|
|
@@ -111,7 +111,7 @@ Terminating the networking feature:
|
|
|
|
|
|
::
|
|
::
|
|
|
|
|
|
- get_tree().set_network_peer(null)
|
|
|
|
|
|
+ get_tree().network_peer = null
|
|
|
|
|
|
(Although it may make sense to send a message first to let the other peers know you're going away instead of letting the connection close or timeout, depending on your game.)
|
|
(Although it may make sense to send a message first to let the other peers know you're going away instead of letting the connection close or timeout, depending on your game.)
|
|
|
|
|