Updated to 4.4
This commit is contained in:
parent
eaa26d1361
commit
1aff15069a
151 changed files with 593 additions and 100 deletions
|
|
@ -7,11 +7,11 @@ func create_enet_server(port: int) -> void:
|
|||
peer.create_server(port, 1)
|
||||
multiplayer.multiplayer_peer = peer
|
||||
|
||||
|
||||
func close_enet_server() -> void:
|
||||
if multiplayer.multiplayer_peer is ENetMultiplayerPeer:
|
||||
multiplayer.multiplayer_peer.close()
|
||||
|
||||
|
||||
func disconnect_all() -> void:
|
||||
#close_enet_server()
|
||||
close_enet_client()
|
||||
|
|
|
|||
1
Networking/Networking.gd.uid
Normal file
1
Networking/Networking.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bpsu0nnl8sel3
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://cigm5ol2f8b4b"]
|
||||
|
||||
[ext_resource type="Script" path="res://Networking/Networking.gd" id="1_y8syy"]
|
||||
[ext_resource type="Script" uid="uid://bpsu0nnl8sel3" path="res://Networking/Networking.gd" id="1_y8syy"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfxg65sfuvegd" path="res://Networking/ws_client.tscn" id="2_0nqq0"]
|
||||
|
||||
[node name="Networking" type="Node"]
|
||||
|
|
|
|||
1
Networking/WSClient/multiplayer_client.gd.uid
Normal file
1
Networking/WSClient/multiplayer_client.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dh778mxhwy2k2
|
||||
|
|
@ -50,13 +50,14 @@ func _process(delta):
|
|||
|
||||
func _parse_msg():
|
||||
var parsed = JSON.parse_string(ws.get_packet().get_string_from_utf8())
|
||||
print(parsed)
|
||||
if typeof(parsed) != TYPE_DICTIONARY or not parsed.has("type") or not parsed.has("id") or \
|
||||
typeof(parsed.get("data")) != TYPE_STRING:
|
||||
return false
|
||||
|
||||
var msg := parsed as Dictionary
|
||||
if not str(msg.type).is_valid_int() or not str(msg.id).is_valid_int():
|
||||
return false
|
||||
#if not str(msg.type).is_valid_int() or not str(msg.id).is_valid_int():
|
||||
#return false
|
||||
|
||||
var type := str(msg.type).to_int()
|
||||
var src_id := str(msg.id).to_int()
|
||||
|
|
|
|||
1
Networking/WSClient/ws_webrtc_client.gd.uid
Normal file
1
Networking/WSClient/ws_webrtc_client.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://d1w1mgnqtbt7c
|
||||
Loading…
Add table
Add a link
Reference in a new issue