Updated the engine.

This commit is contained in:
Relintai 2022-08-24 16:09:27 +02:00
parent 366ba436a9
commit 284e83ad8f
10 changed files with 49 additions and 33 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": {"3.2": "64a9e86c5c20bd4bd5833f0563457d0126617489", "3.x": "9b512dd510207d32911064a1bbe15b80c91b006b"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "3536f01bacf5f54cefb32b768cd020a1f94d0ade"}, "ui_extensions": {"master": "80a3b96fc56991a0f88a1d441ed1e3cebaf3307a"}, "texture_packer": {"master": "ae4d222fbaade063ed6f0bc9f3aaa53df68a7fed"}, "fastnoise": {"master": "46bb1f610bfb7171613b5c708d312bcf94e89356"}, "thread_pool": {"master": "0917511d04bb1aa308385b63ec88d3c182990628"}, "mesh_data_resource": {"master": "a062d871d49d954c5466b9de54b4075cb61cbef4"}, "mesh_utils": {"master": "b52a261c31f04fad624e5cfbcdcc4a45d61136da"}, "props": {"master": "2afd6eff45f9a921bdf4090ff3029def86df5cb5"}, "terraman_2d": {"master": "60a7e84a5dc2fc252b0c582dd8f877685d28d74a"}, "broken_seals_module": {"master": "52c5a81350db1c29d375c63d95010260911ec034"}, "rtile_map": {"master": "389070cfef387b69902e23e6c4ac53997b69e42e"}, "props_2d": {"master": "a45822b63519d7f9fb391ab6b1dced468c6f399d"}, "pandemonium_engine": {"master": "cdbcabc96b7571e16c5c16bf2021474cda7af3f9"}} {"engine": {"3.2": "64a9e86c5c20bd4bd5833f0563457d0126617489", "3.x": "9b512dd510207d32911064a1bbe15b80c91b006b"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "3536f01bacf5f54cefb32b768cd020a1f94d0ade"}, "ui_extensions": {"master": "80a3b96fc56991a0f88a1d441ed1e3cebaf3307a"}, "texture_packer": {"master": "ae4d222fbaade063ed6f0bc9f3aaa53df68a7fed"}, "fastnoise": {"master": "46bb1f610bfb7171613b5c708d312bcf94e89356"}, "thread_pool": {"master": "0917511d04bb1aa308385b63ec88d3c182990628"}, "mesh_data_resource": {"master": "a062d871d49d954c5466b9de54b4075cb61cbef4"}, "mesh_utils": {"master": "b52a261c31f04fad624e5cfbcdcc4a45d61136da"}, "props": {"master": "2afd6eff45f9a921bdf4090ff3029def86df5cb5"}, "terraman_2d": {"master": "60a7e84a5dc2fc252b0c582dd8f877685d28d74a"}, "broken_seals_module": {"master": "52c5a81350db1c29d375c63d95010260911ec034"}, "rtile_map": {"master": "389070cfef387b69902e23e6c4ac53997b69e42e"}, "props_2d": {"master": "a45822b63519d7f9fb391ab6b1dced468c6f399d"}, "pandemonium_engine": {"master": "f4b7a3b37820f8df9864ff92f258712a08bc59d1"}}

View File

@ -49,6 +49,12 @@ func _ready() -> void:
get_tree().connect("connection_failed", self, "_connection_failed") get_tree().connect("connection_failed", self, "_connection_failed")
get_tree().connect("server_disconnected", self, "_server_disconnected") get_tree().connect("server_disconnected", self, "_server_disconnected")
rpc_config("cset_seed", MultiplayerAPI.RPC_MODE_REMOTE)
rpc_config("crequest_select_class", MultiplayerAPI.RPC_MODE_REMOTE)
rpc_config("cspawn_player", MultiplayerAPI.RPC_MODE_REMOTESYNC)
rpc_config("sreceive_upload_character", MultiplayerAPI.RPC_MODE_MASTER)
rpc_config("", MultiplayerAPI.RPC_MODE_REMOTE)
func start_hosting(p_port : int = 0) -> int: func start_hosting(p_port : int = 0) -> int:
if p_port == 0: if p_port == 0:
@ -154,7 +160,7 @@ func sset_seed(pseed):
if multiplayer.has_network_peer() and multiplayer.is_network_server(): if multiplayer.has_network_peer() and multiplayer.is_network_server():
rpc("cset_seed", _sseed) rpc("cset_seed", _sseed)
remote func cset_seed(pseed): func cset_seed(pseed):
_cseed = pseed _cseed = pseed
@ -169,7 +175,7 @@ func set_class():
else: else:
crequest_select_class(local_player_master.my_info) crequest_select_class(local_player_master.my_info)
remote func crequest_select_class(info : Dictionary) -> void: func crequest_select_class(info : Dictionary) -> void:
# PLogger.log_trace("NetworkManager crequest_select_class") # PLogger.log_trace("NetworkManager crequest_select_class")
if get_tree().is_network_server(): if get_tree().is_network_server():
@ -181,7 +187,7 @@ remote func crequest_select_class(info : Dictionary) -> void:
rpc("cspawn_player", info, sid, Vector3(10, 10, 10)) rpc("cspawn_player", info, sid, Vector3(10, 10, 10))
remotesync func cspawn_player(info : Dictionary, sid : int, pos : Vector3): func cspawn_player(info : Dictionary, sid : int, pos : Vector3):
# PLogger.log_trace("NetworkManager cspawn_player") # PLogger.log_trace("NetworkManager cspawn_player")
if sid == get_tree().get_network_unique_id(): if sid == get_tree().get_network_unique_id():
@ -208,7 +214,7 @@ remotesync func cspawn_player(info : Dictionary, sid : int, pos : Vector3):
func upload_character(data : String) -> void: func upload_character(data : String) -> void:
rpc_id(1, "sreceive_upload_character", data) rpc_id(1, "sreceive_upload_character", data)
master func sreceive_upload_character(data: String) -> void: func sreceive_upload_character(data: String) -> void:
ESS.get_ess_entity_spawner().spawn_networked_player_from_data(data, Vector3(0, 10, 0), multiplayer.get_rpc_sender_id()) ESS.get_ess_entity_spawner().spawn_networked_player_from_data(data, Vector3(0, 10, 0), multiplayer.get_rpc_sender_id())
func set_terrarin_player(): func set_terrarin_player():

View File

@ -87,6 +87,10 @@ var visibility_update_timer : float = 0
var _nameplate : Node = null var _nameplate : Node = null
func _ready():
rpc_config("sset_position", MultiplayerAPI.RPC_MODE_REMOTE)
rpc_config("cset_position", MultiplayerAPI.RPC_MODE_REMOTE)
func _enter_tree() -> void: func _enter_tree() -> void:
world = get_node(world_path) as Node2D world = get_node(world_path) as Node2D
camera = get_node_or_null("Camera") as Camera2D camera = get_node_or_null("Camera") as Camera2D
@ -536,14 +540,14 @@ func on_diesd(entity):
#set_physics_process(false) #set_physics_process(false)
remote func sset_position(pposition : Vector2) -> void: func sset_position(pposition : Vector2) -> void:
if multiplayer.network_peer and multiplayer.is_network_server(): if multiplayer.network_peer and multiplayer.is_network_server():
entity.vrpc("cset_position", position) entity.vrpc("cset_position", position)
if _controlled: if _controlled:
cset_position(position) cset_position(position)
remote func cset_position(pposition : Vector2) -> void: func cset_position(pposition : Vector2) -> void:
pposition = pposition pposition = pposition

View File

@ -38,6 +38,8 @@ func _ready():
set_physics_process(true) set_physics_process(true)
rpc_config("set_position_remote", MultiplayerAPI.RPC_MODE_REMOTE)
func _physics_process(delta): func _physics_process(delta):
# if (multiplayer.has_network_peer() and multiplayer.is_network_server()) or not multiplayer.has_network_peer(): # if (multiplayer.has_network_peer() and multiplayer.is_network_server()) or not multiplayer.has_network_peer():
if multiplayer.has_network_peer() and multiplayer.is_network_server(): if multiplayer.has_network_peer() and multiplayer.is_network_server():
@ -67,8 +69,8 @@ func update_visibility() -> void:
#warning-ignore:unassigned_variable #warning-ignore:unassigned_variable
var used_to_see : Array = Array() var used_to_see : Array = Array()
for i in range(sees_gets_count()): for i in range(sees_get_count()):
var ent : Entity = sees_gets(i) var ent : Entity = sees_get(i)
used_to_see.append(ent) used_to_see.append(ent)
@ -90,7 +92,7 @@ func update_visibility() -> void:
if self.get_network_master() != 1: if self.get_network_master() != 1:
ESS.entity_spawner.despawn_for(self, ent) ESS.entity_spawner.despawn_for(self, ent)
sees_removes(ent) sees_remove(ent)
for e in currenty_sees_filtered: for e in currenty_sees_filtered:
var ent : Entity = e as Entity var ent : Entity = e as Entity
@ -98,10 +100,10 @@ func update_visibility() -> void:
if self.get_network_master() != 1: if self.get_network_master() != 1:
ESS.entity_spawner.spawn_for(self, ent) ESS.entity_spawner.spawn_for(self, ent)
sees_adds(ent) sees_add(ent)
remote func set_position_remote(pos : Vector2) -> void: func set_position_remote(pos : Vector2) -> void:
if get_tree().is_network_server(): if get_tree().is_network_server():
rpc("set_position_remote", pos) rpc("set_position_remote", pos)
#print(position) #print(position)

View File

@ -45,7 +45,10 @@ func _ready():
# get_tree().connect("connected_to_server", self, "_connected_ok") # get_tree().connect("connected_to_server", self, "_connected_ok")
# get_tree().connect("connection_failed", self, "_connected_fail") # get_tree().connect("connection_failed", self, "_connected_fail")
# get_tree().connect("server_disconnected", self, "_server_disconnected") # get_tree().connect("server_disconnected", self, "_server_disconnected")
pass
rpc_config("creceive_spawn_for", MultiplayerAPI.RPC_MODE_REMOTE)
rpc_config("spawn_owned_player", MultiplayerAPI.RPC_MODE_PUPPET)
rpc_config("register_player", MultiplayerAPI.RPC_MODE_REMOTE)
func on_network_peer_packet(id : int, packet : PoolByteArray) ->void: func on_network_peer_packet(id : int, packet : PoolByteArray) ->void:
#todo #todo
@ -59,7 +62,7 @@ func despawn_for(player : Entity, target: Entity) -> void:
print("despawnfor " + target.name) print("despawnfor " + target.name)
# rpc_id(player.get_network_master(), "creceive_despawn_for", target.get_path()) # rpc_id(player.get_network_master(), "creceive_despawn_for", target.get_path())
remote func creceive_spawn_for(data: String, global_name : String, position: Vector2) -> Entity: func creceive_spawn_for(data: String, global_name : String, position: Vector2) -> Entity:
var createinfo : EntityCreateInfo = EntityCreateInfo.new() var createinfo : EntityCreateInfo = EntityCreateInfo.new()
createinfo.player_name = global_name createinfo.player_name = global_name
@ -74,14 +77,14 @@ remote func creceive_spawn_for(data: String, global_name : String, position: Vec
return createinfo.created_entity return createinfo.created_entity
remote func creceive_despawn_for(path : NodePath) -> void: func creceive_despawn_for(path : NodePath) -> void:
# print("recdespawnfor " + path) # print("recdespawnfor " + path)
var ent = get_tree().root.get_node_or_null(path) var ent = get_tree().root.get_node_or_null(path)
if ent: if ent:
ent.queue_free() ent.queue_free()
puppet func spawn_owned_player(data : String, position : Vector2) -> Entity: func spawn_owned_player(data : String, position : Vector2) -> Entity:
var createinfo : EntityCreateInfo = EntityCreateInfo.new() var createinfo : EntityCreateInfo = EntityCreateInfo.new()
createinfo.guid = get_tree().multiplayer.get_network_unique_id() createinfo.guid = get_tree().multiplayer.get_network_unique_id()
@ -309,7 +312,7 @@ func _server_disconnected():
func _connected_fail(): func _connected_fail():
pass # Could not even connect to server; abort. pass # Could not even connect to server; abort.
remote func register_player(id, info): func register_player(id, info):
# Store the info # Store the info
# player_info[id] = info # player_info[id] = info
# If I'm the server, let the new guy know about existing players. # If I'm the server, let the new guy know about existing players.

View File

@ -191,22 +191,22 @@ _global_script_class_icons={
@"PlayerGD": "", @"PlayerGD": "",
@"WorldGeneratorSettings": "", @"WorldGeneratorSettings": "",
@"HumanoidCharacterBones2D": "", @"HumanoidCharacterBones2D": "",
@"SpellGD": "",
@"SpellEffectVisualBasic": "",
@"NetworkedPlayerGD": "",
@"ItemVisualEntry2D": "",
@"CharacterSkeleton2DGD": "", @"CharacterSkeleton2DGD": "",
@"Zone": "", @"ItemVisualEntry2D": "",
@"NetworkedPlayerGD": "",
@"SpellEffectVisualBasic": "",
@"SpellGD": "",
@"UIWindowModule": "", @"UIWindowModule": "",
@"WorldGenBaseResource": "", @"Zone": "",
@"UIGuiChildModule": "",
@"Menu": "",
@"ManaResource": "",
@"Main": "", @"Main": "",
@"SubZone": "", @"ManaResource": "",
@"ItemTemplateGD": "", @"Menu": "",
@"HealthResource": "", @"UIGuiChildModule": "",
@"WorldGenBaseResource": "",
@"DisplayPlayerGD": "", @"DisplayPlayerGD": "",
@"HealthResource": "",
@"ItemTemplateGD": "",
@"SubZone": "",
@"LayeredTextureMaker": "" @"LayeredTextureMaker": ""
} }
Node="input/actionbar_5_11" Node="input/actionbar_5_11"
@ -238,7 +238,6 @@ EntitySpawner="*res://player/bs_entity_spawner.tscn"
gdscript/completion/autocomplete_setters_and_getters=true gdscript/completion/autocomplete_setters_and_getters=true
gdscript/warnings/unused_argument=false gdscript/warnings/unused_argument=false
gdscript/warnings/unused_signal=false gdscript/warnings/unused_signal=false
gdscript/warnings/return_value_discarded=false
gdscript/warnings/integer_division=false gdscript/warnings/integer_division=false
[display] [display]

View File

@ -21,5 +21,5 @@ extends Node
# SOFTWARE. # SOFTWARE.
func _ready(): func _ready():
VisualServer.set_default_clear_color(Color(0, 0, 0)) RenderingServer.set_default_clear_color(Color(0, 0, 0))

View File

@ -37,7 +37,7 @@ func _enter_tree():
if !Engine.editor_hint && generate_on_ready: if !Engine.editor_hint && generate_on_ready:
spawn(0, 0) spawn(0, 0)
VisualServer.canvas_item_set_sort_children_by_y(get_canvas_item(), true) RenderingServer.canvas_item_set_sort_children_by_y(get_canvas_item(), true)
func spawn(x : int, y : int): func spawn(x : int, y : int):
chunks_clear() chunks_clear()

View File

@ -52,7 +52,7 @@ func setup(pos : Vector2, color : Color, value : int, crit : bool) -> void:
world_position = pos world_position = pos
text = str(value) text = str(value)
add_color_override("font_color", color) add_theme_color_override("font_color", color)
if crit: if crit:
animation_player.play("crit") animation_player.play("crit")

View File

@ -28,4 +28,6 @@ addon_repositories = [
third_party_addon_repositories = [ third_party_addon_repositories = [
] ]
custom_module_folders = ''
slim_args = 'module_webm_enabled=no module_arkit_enabled=no module_visual_script_enabled=no module_gdnative_enabled=no module_mobile_vr_enabled=no module_theora_enabled=no module_xatlas_unwrap_enabled=no no_editor_splash=yes module_bullet_enabled=no module_camera_enabled=no module_csg_enabled=no module_denoise_enabled=no module_fbx_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_lightmapper_cpu_enabled=no module_raycast_enabled=no module_recast_enabled=no module_vhacd_enabled=no module_webxr_enabled=no' slim_args = 'module_webm_enabled=no module_arkit_enabled=no module_visual_script_enabled=no module_gdnative_enabled=no module_mobile_vr_enabled=no module_theora_enabled=no module_xatlas_unwrap_enabled=no no_editor_splash=yes module_bullet_enabled=no module_camera_enabled=no module_csg_enabled=no module_denoise_enabled=no module_fbx_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_lightmapper_cpu_enabled=no module_raycast_enabled=no module_recast_enabled=no module_vhacd_enabled=no module_webxr_enabled=no'