2024-03-11 04:09:33 +00:00
|
|
|
[gd_scene load_steps=2 format=3 uid="uid://d25h11x5grlnn"]
|
2024-02-18 17:15:59 +00:00
|
|
|
|
2024-03-11 04:09:33 +00:00
|
|
|
[sub_resource type="GDScript" id="GDScript_nrktq"]
|
|
|
|
script/source = "extends Node
|
|
|
|
class_name NetworkController
|
|
|
|
|
|
|
|
|
|
|
|
@export var port = 12345
|
|
|
|
|
|
|
|
|
|
|
|
func start_server() -> ENetMultiplayerPeer:
|
|
|
|
var peer = ENetMultiplayerPeer.new()
|
|
|
|
peer.create_server(port, 32)
|
|
|
|
return peer
|
|
|
|
|
|
|
|
|
|
|
|
func start_client() -> ENetMultiplayerPeer:
|
|
|
|
var peer = ENetMultiplayerPeer.new()
|
|
|
|
peer.create_client(\"127.0.0.1\", port)
|
|
|
|
return peer
|
|
|
|
"
|
2024-02-18 17:15:59 +00:00
|
|
|
|
|
|
|
[node name="NetworkController" type="Node"]
|
2024-03-11 04:09:33 +00:00
|
|
|
script = SubResource("GDScript_nrktq")
|