OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-godot4-test commits / 19cd7a7

we try multiplayer haheha
19cd7a7708710d951f20330a87d1cd25fa20569d
by Dresk Spidflisk <dreskspidflisk@gmail.com> · 2022-04-18T18:08:32.000Z

Changed files (13) +112 -97

assets/models/tumble/animation/sprint.res +0 -0
(no content changes — binary or rename)
game/map_decorations/teleport.scn +0 -0
(no content changes — binary or rename)
game/map_decorations/teleporter.gd +2 -3
……@@ -35,7 +35,7 @@ func tryMapChange(mapChangeName : String, sendGossip : bool, playerNode):
3535 playerNode.playerWantsNewWorldEnvironment = true
3636
3737 if(sendGossip):
38 var data : Dictionary = {
38 var _data : Dictionary = {
3939 "map": {
4040 "name": mapChangeName
4141 }
……@@ -46,7 +46,6 @@ func tryMapChange(mapChangeName : String, sendGossip : bool, playerNode):
4646func _on_CollisionShape_gameplay_entered():
4747 pass # Replace with function body.
4848
49
50func _on_Hitbox_body_shape_entered(body_rid, body, body_shape_index, local_shape_index):
49func _on_hitbox_body_entered(body):
5150 if(body is CharacterBody3D):
5251 tryMapChange(teleportation_destination, true, body)
game/player/grappling_hook/gh_visual_point_1.tscn +10 -11
……@@ -1,15 +1,14 @@
1[gd_scene load_steps=2 format=2]
1[gd_scene load_steps=2 format=3 uid="uid://bdo2nek3n4knj"]
22
3[sub_resource type="SpatialMaterial" id=1]
4flags_unshaded = true
5flags_no_depth_test = true
6flags_fixed_size = true
7flags_do_not_receive_shadows = true
8flags_disable_ambient_light = true
9albedo_color = Color( 0.407843, 0, 0, 1 )
3[sub_resource type="StandardMaterial3D" id="1"]
4no_depth_test = true
5shading_mode = 0
6disable_ambient_light = true
7albedo_color = Color(0.407843, 0, 0, 1)
8disable_receive_shadows = true
109
11[node name="CSGSphere" type="CSGSphere"]
12radius = 0.025
10[node name="CSGSphere" type="CSGSphere3D"]
11radius = 0.282
1312radial_segments = 22
1413rings = 22
15material = SubResource( 1 )
14material = SubResource( "1" )
game/player/player_animation_tree.tres +1 -1
……@@ -187,4 +187,4 @@ nodes/walk_scale/node = SubResource( "AnimationNodeTimeScale_bvg56" )
187187nodes/walk_scale/position = Vector2(-640, 360)
188188nodes/wall_run/node = SubResource( "AnimationNodeTransition_ur2dc" )
189189nodes/wall_run/position = Vector2(720, -60)
190node_connections = [&"output", 0, &"wall_run", &"roll", 0, &"air_transition", &"roll", 1, &"roll_scale", &"air_transition", 0, &"air_blend", &"air_transition", 1, &"aim_transition", &"landing_scale", 0, &"Animation 3", &"walk_scale", 0, &"Animation 4", &"Blend2 2", 0, &"Animation 12", &"Blend2 2", 1, &"Animation 10", &"jump_scale", 0, &"Animation 6", &"Blend2", 0, &"Animation 8", &"Blend2", 1, &"Animation 9", &"run_scale", 0, &"Animation 5", &"TimeScale 3", 0, &"strafe", &"aim_transition", 0, &"TimeScale 3", &"aim_transition", 1, &"iwr_blend", &"iwr_blend", 0, &"Animation 2", &"iwr_blend", 1, &"walk_scale", &"iwr_blend", 2, &"run_scale", &"roll_scale", 0, &"Animation", &"air_blend", 0, &"jump_scale", &"air_blend", 1, &"falling_scale", &"air_blend", 2, &"landing_scale", &"falling_scale", 0, &"Animation 7", &"wall_run", 0, &"Blend2", &"wall_run", 1, &"Blend2 2", &"wall_run", 2, &"roll"]
190node_connections = [&"output", 0, &"wall_run", &"roll", 0, &"air_transition", &"roll", 1, &"roll_scale", &"Blend2 2", 0, &"Animation 12", &"Blend2 2", 1, &"Animation 10", &"air_blend", 0, &"jump_scale", &"air_blend", 1, &"falling_scale", &"air_blend", 2, &"landing_scale", &"falling_scale", 0, &"Animation 7", &"TimeScale 3", 0, &"strafe", &"run_scale", 0, &"Animation 5", &"aim_transition", 0, &"TimeScale 3", &"aim_transition", 1, &"iwr_blend", &"roll_scale", 0, &"Animation", &"iwr_blend", 0, &"Animation 2", &"iwr_blend", 1, &"walk_scale", &"iwr_blend", 2, &"run_scale", &"jump_scale", 0, &"Animation 6", &"air_transition", 0, &"air_blend", &"air_transition", 1, &"aim_transition", &"Blend2", 0, &"Animation 8", &"Blend2", 1, &"Animation 9", &"walk_scale", 0, &"Animation 4", &"wall_run", 0, &"Blend2", &"wall_run", 1, &"Blend2 2", &"wall_run", 2, &"roll", &"landing_scale", 0, &"Animation 3"]
game/player/player_core.gd +17 -17
……@@ -122,7 +122,7 @@ func grapplingHook_Process():
122122 grapplingHook_UpdateVisualLine(length)
123123 # TODO : BIG Hack to prevent running on remote players
124124 var _name = self.name
125 if(self.name == "PlayerLocal"):
125 if(self.name == "PlayerCoreLocal"):
126126 grapplingHook_UpdateVisualPoint()
127127
128128func grapplingHook_CheckActivation():
……@@ -148,7 +148,7 @@ func grapplingHook_CheckActivation():
148148func grapplingHook_UpdateVisualPoint():
149149 if grappleHookCast.is_colliding():
150150 grappleVisualPoint.visible = true
151 grappleVisualPoint.translation = grappleHookCast.get_collision_point()
151 grappleVisualPoint.position = grappleHookCast.get_collision_point()
152152 else:
153153 grappleVisualPoint.visible = false
154154
……@@ -159,31 +159,31 @@ func grapplingHook_UpdateVisualLine(length : float):
159159 grappleVisualLine.position.z = length / -1.80
160160
161161func grapplingHook_UpdatePlayerVelocityAndReturnHookLength() -> float:
162 # var grapple_speed : float = 0.5
163 # var rest_length : float = 1
164 # var max_grapple_speed : float = 2.75
162 var grapple_speed : float = 0.5
163 var rest_length : float = 1
164 var max_grapple_speed : float = 2.75
165165
166 # var player2hook := grapplingHook_GrapplePosition - translation # vector from player to hook
167 # var length := player2hook.length()
168 # if(grapplingHook_IsHooked):
166 var player2hook := grapplingHook_GrapplePosition - position # vector from player to hook
167 var length := player2hook.length()
168 if(grapplingHook_IsHooked):
169169 # if we more than 4 away from line, don't dampen speed as much
170 # if(length > 4):
171 # kinematicVelocity *= .999
170 if(length > 4):
171 velocity *= .999
172172 # Otherwise dampen speed more
173 #else:
174 # kinematicVelocity *= .9
173 else:
174 velocity *= .9
175175
176176 # Hook's law equation
177 # var force := grapple_speed * (length - rest_length)
177 var force := grapple_speed * (length - rest_length)
178178
179179 # Clamp force to be less than max_grapple_speed
180 # if abs(force) > max_grapple_speed:
181 # force = max_grapple_speed
180 if abs(force) > max_grapple_speed:
181 force = max_grapple_speed
182182
183183 # Preserve direction, but scale by force
184 # kinematicVelocity += player2hook.normalized() * force
184 velocity += player2hook.normalized() * force
185185
186 return 0.0 # length
186 return length
187187
188188func grapplingHook_DisappearHand():
189189 meshSkeletonHiddenHand.visible = false
game/player/player_core_local.tscn +47 -46
……@@ -3,7 +3,7 @@
33[ext_resource type="PackedScene" uid="uid://th4ivyj7adfg" path="res://game/player/player_core.tscn" id="1"]
44[ext_resource type="Script" path="res://game/player/player_core_local_input.gd" id="2"]
55[ext_resource type="Script" path="res://game/player/player_core_local_input_special.gd" id="3"]
6[ext_resource type="PackedScene" path="res://game/player/grappling_hook/gh_visual_point_1.tscn" id="4"]
6[ext_resource type="PackedScene" uid="uid://bdo2nek3n4knj" path="res://game/player/grappling_hook/gh_visual_point_1.tscn" id="4"]
77[ext_resource type="PackedScene" uid="uid://cq34ge5fyxan8" path="res://game/player/player_core_local_debugui.tscn" id="5"]
88[ext_resource type="AudioStream" uid="uid://cs26rjexov20r" path="res://assets/sounds/player/fire_grapplinghook1.mp3" id="9"]
99
……@@ -11,25 +11,25 @@
1111
1212[node name="Skeleton3D" parent="Model/Armature" index="0"]
1313bones/0/position = Vector3(0, 0.235168, 0)
14bones/1/position = Vector3(-0.0240179, 0.0238949, 0.747739)
15bones/1/rotation = Quaternion(0.00109371, 0.537324, 0.843354, 0.00607089)
16bones/2/rotation = Quaternion(0.114988, 3.43713e-05, -0.000373492, 0.993367)
17bones/3/rotation = Quaternion(0.00134837, 0.99984, -0.015718, -0.00843674)
14bones/1/position = Vector3(0.0117447, 0.0255968, 0.732043)
15bones/1/rotation = Quaternion(8.23238e-05, 0.526573, 0.850102, 0.00693073)
16bones/2/rotation = Quaternion(0.115696, 3.90989e-05, -0.000424333, 0.993285)
17bones/3/rotation = Quaternion(0.000389739, 0.99995, 0.00908603, -0.00414327)
1818bones/3/scale = Vector3(1, 1, 1)
19bones/4/rotation = Quaternion(0.155856, 0.00857555, -0.000912705, 0.987742)
20bones/5/rotation = Quaternion(-0.000882708, 0.995072, 0.0989637, 0.00616626)
21bones/6/rotation = Quaternion(0.0931299, 0.000157758, 1.62897e-05, 0.995654)
22bones/7/rotation = Quaternion(0.000822052, 0.989781, 0.142467, 0.00608377)
23bones/8/position = Vector3(0.021036, 0.14111, 0.0955364)
19bones/4/rotation = Quaternion(0.167795, 0.00399943, -0.000936797, 0.985813)
20bones/5/rotation = Quaternion(-3.17e-05, 0.994443, 0.105266, 0.00123067)
21bones/6/rotation = Quaternion(0.0924468, 0.000220146, 2.27558e-05, 0.995718)
22bones/7/rotation = Quaternion(-0.000131001, 0.989569, 0.144059, 0.00110956)
23bones/8/position = Vector3(0.0210361, 0.138876, 0.0967471)
2424bones/8/rotation = Quaternion(-0.574533, -0.380402, -0.372139, 0.621867)
25bones/9/rotation = Quaternion(-0.0072548, 0.739461, -0.640532, 0.207034)
26bones/9/scale = Vector3(1.00563, 0.988357, 1.00563)
27bones/10/rotation = Quaternion(1.36131e-07, -0.17504, -1.6109e-08, 0.984561)
28bones/11/rotation = Quaternion(0.396497, -0.159018, 0.0682248, 0.901581)
29bones/11/scale = Vector3(0.999515, 0.989686, 1.01004)
30bones/12/rotation = Quaternion(9.79363e-07, 0.130257, -4.69733e-07, 0.99148)
31bones/13/rotation = Quaternion(0.0736509, 0.139994, -0.0819888, 0.984)
32bones/13/scale = Vector3(0.993985, 1.00997, 0.996089)
25bones/9/rotation = Quaternion(-0.135501, 0.740622, -0.634822, 0.173549)
26bones/9/scale = Vector3(1.00463, 0.989662, 1.00463)
27bones/10/rotation = Quaternion(1.18432e-07, -0.176781, -3.36775e-08, 0.98425)
28bones/11/rotation = Quaternion(0.321431, -0.174466, 0.0600226, 0.928785)
29bones/11/scale = Vector3(0.999515, 0.992039, 1.00768)
30bones/12/rotation = Quaternion(9.60543e-07, 0.178808, -4.56622e-07, 0.983884)
31bones/13/rotation = Quaternion(0.0948042, 0.18416, -0.0438809, 0.977329)
32bones/13/scale = Vector3(0.994725, 1.0098, 0.994647)
3333bones/15/rotation = Quaternion(0.152495, 0.0320204, -0.0648276, 0.985656)
3434bones/16/rotation = Quaternion(-0.00581883, 0.00169818, -0.00528004, 0.999968)
3535bones/17/rotation = Quaternion(0.00656525, -0.00667401, 0.0208093, 0.99974)
……@@ -46,16 +46,16 @@ bones/28/rotation = Quaternion(0.000326481, -0.00915114, 0.0211574, 0.999734)
4646bones/30/rotation = Quaternion(0.119319, -0.0143616, 0.0193321, 0.992564)
4747bones/31/rotation = Quaternion(-0.014934, 0.0107446, -0.0181569, 0.999666)
4848bones/32/rotation = Quaternion(0.0224839, -0.00492407, 0.00846133, 0.999699)
49bones/33/position = Vector3(-0.0210362, 0.14111, 0.0955362)
49bones/33/position = Vector3(-0.0210363, 0.138876, 0.096747)
5050bones/33/rotation = Quaternion(-0.574533, 0.380402, 0.372139, 0.621867)
51bones/34/rotation = Quaternion(0.0871951, 0.74376, -0.635559, -0.187838)
52bones/34/scale = Vector3(1.00372, 0.991867, 1.00372)
53bones/35/rotation = Quaternion(2.2563e-07, 0.123919, 6.7336e-07, 0.992292)
54bones/36/rotation = Quaternion(0.265666, 0.121616, -0.0333382, 0.955782)
55bones/36/scale = Vector3(0.999974, 0.99751, 1.00274)
56bones/37/rotation = Quaternion(-3.65474e-07, -0.124538, -1.96684e-07, 0.992215)
57bones/38/rotation = Quaternion(-0.243179, -0.1246, 0.262713, 0.925376)
58bones/38/scale = Vector3(0.998802, 1.00289, 0.997614)
51bones/34/rotation = Quaternion(0.013987, 0.75324, -0.621938, -0.213607)
52bones/34/scale = Vector3(1.00438, 0.993717, 1.00438)
53bones/35/rotation = Quaternion(2.30571e-07, 0.112536, 6.4212e-07, 0.993648)
54bones/36/rotation = Quaternion(0.365253, 0.104518, -0.0408451, 0.92412)
55bones/36/scale = Vector3(0.999974, 0.992469, 1.00808)
56bones/37/rotation = Quaternion(-3.60379e-07, -0.0890528, -2.09748e-07, 0.996027)
57bones/38/rotation = Quaternion(-0.179731, -0.0898426, 0.262409, 0.943804)
58bones/38/scale = Vector3(0.997287, 1.00517, 0.99607)
5959bones/40/rotation = Quaternion(0.152494, -0.0320192, 0.0648276, 0.985656)
6060bones/41/rotation = Quaternion(-0.00581815, -0.00169901, 0.00528053, 0.999968)
6161bones/42/rotation = Quaternion(0.00656406, 0.00667601, -0.0208095, 0.99974)
……@@ -71,28 +71,28 @@ bones/53/rotation = Quaternion(0.000341446, 0.00913473, -0.0211586, 0.999734)
7171bones/55/rotation = Quaternion(0.119319, 0.0143618, -0.0193322, 0.992564)
7272bones/56/rotation = Quaternion(-0.0149347, -0.0107439, 0.0181572, 0.999666)
7373bones/57/rotation = Quaternion(0.0224819, 0.00492589, -0.00846129, 0.999699)
74bones/58/position = Vector3(0.177163, -0.0838025, -0.0453228)
74bones/58/position = Vector3(0.177163, -0.0860369, -0.0441121)
7575bones/58/rotation = Quaternion(-3.44743e-07, 0.696936, 0.717133, 3.13916e-07)
76bones/59/position = Vector3(-0.177162, -0.0838027, -0.0453232)
76bones/59/position = Vector3(-0.177162, -0.0860369, -0.0441124)
7777bones/59/rotation = Quaternion(-3.44744e-07, 0.696936, 0.717133, 3.13916e-07)
78bones/60/position = Vector3(2.93092e-07, -0.131534, -0.2984)
78bones/60/position = Vector3(2.97545e-07, -0.133768, -0.297189)
7979bones/60/rotation = Quaternion(0.014281, -4.94438e-07, 7.06192e-09, 0.999898)
80bones/63/rotation = Quaternion(0.00165767, -0.476234, 0.879221, 0.0129778)
81bones/63/scale = Vector3(1.0134, 0.972529, 1.01341)
82bones/64/rotation = Quaternion(9.20876e-11, 1.02774e-05, 2.22219e-11, 1)
83bones/65/rotation = Quaternion(0.77436, 0.00181613, -0.00275689, 0.632737)
84bones/65/scale = Vector3(1.00117, 0.969058, 1.03082)
85bones/66/rotation = Quaternion(6.7734e-11, 1.95539e-05, -4.007e-10, 1)
86bones/67/rotation = Quaternion(0.0801868, 0.0047146, 0.0121173, 0.996695)
87bones/67/scale = Vector3(0.984979, 1.02477, 0.9911)
88bones/69/rotation = Quaternion(0.0175319, -0.676899, 0.72957, 0.0960612)
89bones/69/scale = Vector3(1.01054, 0.980018, 1.01054)
90bones/70/rotation = Quaternion(-2.78949e-08, 0.0269004, 4.27779e-09, 0.999638)
91bones/71/rotation = Quaternion(0.59989, 0.0262679, -0.0199426, 0.799402)
92bones/71/scale = Vector3(1.00085, 0.968931, 1.03119)
93bones/72/rotation = Quaternion(1.61887e-08, 0.00796514, -2.61327e-08, 0.999968)
94bones/73/rotation = Quaternion(-0.307288, 0.0074952, 0.142502, 0.940857)
95bones/73/scale = Vector3(0.990784, 1.00615, 1.00327)
80bones/63/rotation = Quaternion(-0.00523926, -0.784474, 0.619559, -0.0268252)
81bones/63/scale = Vector3(1.01117, 0.975321, 1.01117)
82bones/64/rotation = Quaternion(1.98474e-08, -0.00877625, 5.51736e-09, 0.999961)
83bones/65/rotation = Quaternion(0.728941, -0.0120004, 0.0124615, 0.684357)
84bones/65/scale = Vector3(1.0019, 0.964, 1.0356)
85bones/66/rotation = Quaternion(1.30329e-08, -0.0204358, -9.02991e-08, 0.999791)
86bones/67/rotation = Quaternion(0.0979542, -0.019729, -0.041884, 0.994113)
87bones/67/scale = Vector3(0.986079, 1.02709, 0.987631)
88bones/69/rotation = Quaternion(0.0160165, -0.459682, 0.883662, 0.0870521)
89bones/69/scale = Vector3(1.01261, 0.975021, 1.01261)
90bones/70/rotation = Quaternion(7.69128e-10, 0.018437, -1.78052e-09, 0.99983)
91bones/71/rotation = Quaternion(0.682171, 0.019828, -0.0190324, 0.730676)
92bones/71/scale = Vector3(1.00085, 0.965509, 1.03486)
93bones/72/rotation = Quaternion(1.54556e-08, 0.00625633, -2.0455e-08, 0.99998)
94bones/73/rotation = Quaternion(-0.623361, 0.00998981, 0.111784, 0.773838)
95bones/73/scale = Vector3(0.987693, 0.988215, 1.02489)
9696
9797[node name="Sound_Jump" parent="Model" index="2"]
9898transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
……@@ -117,6 +117,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 1.5, 0)
117117
118118[node name="GrappleHookCast" type="RayCast3D" parent="CameraHead/CameraPivot" index="0"]
119119transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.740826, 0.0206239)
120target_position = Vector3(0, 0, -400)
120121collision_mask = 2
121122debug_shape_custom_color = Color(1, 0, 0, 1)
122123debug_shape_thickness = 5
game/player/player_core_remote.tscn +5 -0
……@@ -0,0 +1,5 @@
1[gd_scene load_steps=2 format=3 uid="uid://cqgsa6ffgsmdm"]
2
3[ext_resource type="PackedScene" uid="uid://th4ivyj7adfg" path="res://game/player/player_core.tscn" id="1"]
4
5[node name="PlayerCoreRemote" instance=ExtResource( "1" )]
hypergodot/hyper_gateway/hyper_gateway.gd +3 -2
……@@ -106,7 +106,8 @@ func setupGateway():
106106 print("Starting gateway from ",path, " with args ", args)
107107
108108 # Start the hyper-gateway in a process
109 processPID = OS.execute(path, args)
109 # processPID = OS.execute(path, args)
110 processPID = OS.create_process(path, args)
110111
111112 # Sleep for a bit while the gateway loads
112113 # TODO: Find a better indicator like polling the HTTP server socket
……@@ -213,7 +214,7 @@ func downloadLatest(assets, version):
213214 for asset in assets:
214215 if asset.name != executibleName: continue
215216 toDownload = asset
216 if !toDownload:
217 if toDownload.size() < 1:
217218 printerr("Unable to find valid executible in latest release")
218219 return
219220
hypergodot/hyper_godot_core.gd +10 -10
……@@ -33,7 +33,7 @@ func _process(_delta):
3333func _perform_setup():
3434 hyperGossip.start_listening()
3535
36func _on_HyperGateway_started_gateway(_pid : int):
36func _on_hyper_gateway_started_gateway(_pid : int):
3737 if !hyperGateway:
3838 hyperGateway = get_tree().get_current_scene().get_node("HyperGodot").get_node("HyperGateway")
3939 if !hyperGossip:
……@@ -44,7 +44,7 @@ func _on_HyperGateway_started_gateway(_pid : int):
4444 hyperDebugUI.updateGatewayStatus()
4545 _perform_setup()
4646
47func _on_HyperGateway_stopped_gateway():
47func _on_hyper_gateway_stopped_gateway():
4848 if(hyperDebugUI):
4949 hyperDebugUI.updateGatewayStatus()
5050
……@@ -61,12 +61,12 @@ func _on_LocalSnapshotTimer_timeout():
6161
6262 hyperGossip.broadcast_event(EVENT_PLAYER_SNAPSHOT, snapShotData)
6363
64func _on_HyperGossip_listening(_extension_name):
64func _on_hyper_gossip_listening(_extension_name):
6565 var snapShotData : Dictionary = getPlayerLocalSnapshotData()
6666 hyperGossip.broadcast_event(EVENT_PLAYER_SNAPSHOT, snapShotData)
6767
6868# TODO : Get these out of here and into player_core or player_core_remote
69func _on_HyperGossip_event(type, data, from):
69func _on_hyper_gossip_event(type, data, from):
7070 if type == EVENT_PLAYER_SNAPSHOT:
7171 updatePlayerWithSnapshot(data, from)
7272 elif type == EVENT_PLAYER_WANTSTOJUMP:
……@@ -158,17 +158,17 @@ func updatePlayer_direction(data, id):
158158 remotePlayer.playerCoreNetworkDataUpdate(data)
159159
160160func getPlayerLocalSnapshotData() -> Dictionary:
161 var snapshotPlayer : KinematicBody = get_tree().get_current_scene().get_node("Players").get_node("PlayerLocal")
162 var translation : Vector3 = snapshotPlayer.translation
161 var snapshotPlayer : CharacterBody3D = get_tree().get_current_scene().get_node("Players").get_node("PlayerCoreLocal")
162 var position : Vector3 = snapshotPlayer.position
163163 var meshDirection : Vector3 = Vector3(0, snapshotPlayer.meshNode.rotation.y, 0)
164164 var lookingDirection : Vector3 = snapshotPlayer.currentDirection
165165
166166 var data : Dictionary = {
167167 #"profile": profile,
168 "translation": {
169 "x": translation.x,
170 "y": translation.y,
171 "z": translation.z
168 "position": {
169 "x": position.x,
170 "y": position.y,
171 "z": position.z
172172 },
173173 "meshDirection": {
174174 "x": meshDirection.x,
hypergodot/hyper_gossip/hyper_gossip.gd +7 -4
……@@ -93,12 +93,12 @@ func broadcast_event(type: String, data):
9393 if(hyperGateway != null):
9494 if( hyperGateway.getIsGatewayRunning() ):
9595 var reqURL = _get_extension_url()
96 var body = JSON.print(_generateEvent(type, data))
96 var body = jsonInstance.stringify(_generateEvent(type, data))
9797 _enqueue_broadcast_request(reqURL, body)
9898
9999func send_to_peer(peer, type, data):
100100 var reqURL = _get_extension_url_to_peer(peer)
101 var body = JSON.print(_generateEvent(type, data))
101 var body = jsonInstance.stringify(_generateEvent(type, data))
102102 _enqueue_broadcast_request(reqURL, body)
103103
104104func load_peers():
……@@ -151,13 +151,16 @@ func _on_peer_list(_result, response_code, _headers, body):
151151 printerr('Error listing peers ', response_code, " ", text)
152152 return
153153
154 # var parsed = jsonInstance.parse(text)
155 # json.parse now returns a generic Error, no longer JSONParseResult object.
154156 var parsed = jsonInstance.parse(text)
155157
156 if parsed.error != OK:
158 # if parsed.error != OK:
159 if parsed != OK:
157160 printerr("Unable to parse Peer List" + String(parsed.error_line))
158161 return
159162
160 var _peers = parsed.result
163 var _peers = jsonInstance.get_data()
161164
162165 emit_signal("peers", _peers)
163166
hypergodot/utils/lru.gd +2 -2
……@@ -14,7 +14,7 @@ func has(value):
1414 return value in values
1515
1616func track(value):
17 var time = OS.get_system_time_msecs()
17 var time = Time.get_ticks_msec()
1818
1919 values[value] = time
2020
……@@ -29,7 +29,7 @@ func clear_oldest():
2929 values.erase(oldest)
3030
3131func get_oldest():
32 var oldestTime = OS.get_system_time_msecs()
32 var oldestTime = Time.get_ticks_msec()
3333 var oldestValue = null
3434 for value in values.keys():
3535 var valueTime = values[value]
main.tscn +8 -1
……@@ -1,8 +1,9 @@
1[gd_scene load_steps=6 format=3 uid="uid://bktxghmjd4nc"]
1[gd_scene load_steps=7 format=3 uid="uid://bktxghmjd4nc"]
22
33[ext_resource type="PackedScene" uid="uid://njxw8k8p0stp" path="res://game/maps/map_test/map_test.tscn" id="1_0op02"]
44[ext_resource type="PackedScene" uid="uid://ds36d5iqtsvuh" path="res://game/player/player_core_local.tscn" id="2_yvl7a"]
55[ext_resource type="Script" path="res://hypergodot/hyper_gossip/hyper_gossip.gd" id="3_g8xkj"]
6[ext_resource type="Script" path="res://hypergodot/hyper_godot_core.gd" id="3_hnq10"]
67[ext_resource type="Script" path="res://hypergodot/hyper_gateway/hyper_gateway.gd" id="4_djf6c"]
78[ext_resource type="PackedScene" uid="uid://wlhlq38cvryl" path="res://hypergodot/hyper_debugui/hyper_debugui.tscn" id="5_7ejif"]
89
……@@ -18,6 +19,7 @@
1819transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.22427, -3.67598, -8.14551)
1920
2021[node name="HyperGodot" type="Node" parent="."]
22script = ExtResource( "3_hnq10" )
2123
2224[node name="HyperGateway" type="Node" parent="HyperGodot"]
2325script = ExtResource( "4_djf6c" )
……@@ -26,3 +28,8 @@ script = ExtResource( "4_djf6c" )
2628script = ExtResource( "3_g8xkj" )
2729
2830[node name="HyperDebugUI" parent="HyperGodot" instance=ExtResource( "5_7ejif" )]
31
32[connection signal="started_gateway" from="HyperGodot/HyperGateway" to="HyperGodot" method="_on_hyper_gateway_started_gateway"]
33[connection signal="stopped_gateway" from="HyperGodot/HyperGateway" to="HyperGodot" method="_on_hyper_gateway_stopped_gateway"]
34[connection signal="event" from="HyperGodot/HyperGossip" to="HyperGodot" method="_on_hyper_gossip_event"]
35[connection signal="listening" from="HyperGodot/HyperGossip" to="HyperGodot" method="_on_hyper_gossip_listening"]