Floatbot assets added, and nodetunnel being implemented.
This commit is contained in:
14
addons/nodetunnel/NodeTunnel.gdextension
Normal file
14
addons/nodetunnel/NodeTunnel.gdextension
Normal file
@@ -0,0 +1,14 @@
|
||||
[configuration]
|
||||
entry_symbol = "gdext_rust_init"
|
||||
compatibility_minimum = 4.1
|
||||
reloadable = false
|
||||
|
||||
[libraries]
|
||||
linux.debug.x86_64 = "bin/libnodetunnel.so"
|
||||
linux.release.x86_64 = "bin/libnodetunnel.so"
|
||||
windows.debug.x86_64 = "bin/nodetunnel.dll"
|
||||
windows.release.x86_64 = "bin/nodetunnel.dll"
|
||||
macos.debug = "bin/libnodetunnel.dylib"
|
||||
macos.release = "bin/libnodetunnel.dylib"
|
||||
macos.debug.arm64 = "bin/libnodetunnel.dylib"
|
||||
macos.release.arm64 = "bin/libnodetunnel.dylib"
|
||||
1
addons/nodetunnel/NodeTunnel.gdextension.uid
Normal file
1
addons/nodetunnel/NodeTunnel.gdextension.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bdmh2wm33k6po
|
||||
0
addons/nodetunnel/bin/.gitkeep
Normal file
0
addons/nodetunnel/bin/.gitkeep
Normal file
BIN
addons/nodetunnel/bin/libnodetunnel.dylib
Normal file
BIN
addons/nodetunnel/bin/libnodetunnel.dylib
Normal file
Binary file not shown.
BIN
addons/nodetunnel/bin/libnodetunnel.so
Normal file
BIN
addons/nodetunnel/bin/libnodetunnel.so
Normal file
Binary file not shown.
BIN
addons/nodetunnel/bin/nodetunnel.dll
Normal file
BIN
addons/nodetunnel/bin/nodetunnel.dll
Normal file
Binary file not shown.
BIN
addons/nodetunnel/bin/~nodetunnel.dll
Normal file
BIN
addons/nodetunnel/bin/~nodetunnel.dll
Normal file
Binary file not shown.
7
addons/nodetunnel/plugin.cfg
Normal file
7
addons/nodetunnel/plugin.cfg
Normal file
@@ -0,0 +1,7 @@
|
||||
[plugin]
|
||||
|
||||
name="NodeTunnel"
|
||||
description="Relay implementation for Godot's High-Level Multiplayer API"
|
||||
author="curtjs"
|
||||
version="1.1.0_beta"
|
||||
script="setup.gd"
|
||||
11
addons/nodetunnel/setup.gd
Normal file
11
addons/nodetunnel/setup.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
@tool
|
||||
extends EditorPlugin
|
||||
|
||||
var update_check = preload("updater/update_check.gd").new()
|
||||
|
||||
func _enter_tree():
|
||||
add_child(update_check)
|
||||
update_check.check_update(get_plugin_version())
|
||||
|
||||
func _exit_tree():
|
||||
update_check.queue_free()
|
||||
1
addons/nodetunnel/setup.gd.uid
Normal file
1
addons/nodetunnel/setup.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://db4cwcsqdpmym
|
||||
52
addons/nodetunnel/updater/update_check.gd
Normal file
52
addons/nodetunnel/updater/update_check.gd
Normal file
@@ -0,0 +1,52 @@
|
||||
extends Node
|
||||
|
||||
const RELEASE_URL = "https://api.github.com/repos/NodeTunnel/godot-plugin/releases/latest"
|
||||
|
||||
var http := HTTPRequest.new()
|
||||
var plugin_version: String
|
||||
|
||||
func _init() -> void:
|
||||
add_child(http)
|
||||
|
||||
func check_update(current: String) -> void:
|
||||
plugin_version = current
|
||||
var err = http.request(RELEASE_URL)
|
||||
if err != OK:
|
||||
return
|
||||
|
||||
http.request_completed.connect(_handle_res)
|
||||
|
||||
func _handle_res(result, response_code, headers, body: PackedByteArray):
|
||||
if response_code != 200:
|
||||
return
|
||||
|
||||
var json = JSON.parse_string(body.get_string_from_utf8())
|
||||
if json == null:
|
||||
return
|
||||
|
||||
var latest: String = json.get("tag_name", "")
|
||||
|
||||
if latest:
|
||||
var res = _compare(plugin_version, latest)
|
||||
|
||||
if res == -1:
|
||||
print(plugin_version)
|
||||
print("[NodeTunnel] v%s available! (Currently on: v)" % latest, plugin_version)
|
||||
|
||||
func _compare(v1: String, v2: String) -> int:
|
||||
v1 = v1.split("_", true, 1)[0]
|
||||
v2 = v2.split("_", true, 1)[0]
|
||||
|
||||
var versions_1 := v1.split(".")
|
||||
var versions_2 := v2.split(".")
|
||||
|
||||
for i in max(versions_1.size(), versions_2.size()):
|
||||
var v1v := int(versions_1[i]) if i < versions_1.size() else 0
|
||||
var v2v := int(versions_2[i]) if i < versions_2.size() else 0
|
||||
|
||||
if v1v > v2v:
|
||||
return 1
|
||||
elif v1v < v2v:
|
||||
return -1
|
||||
|
||||
return 0
|
||||
1
addons/nodetunnel/updater/update_check.gd.uid
Normal file
1
addons/nodetunnel/updater/update_check.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cx4apmy510a7i
|
||||
Reference in New Issue
Block a user