@@ -115,6 +115,8 @@ func _client_on_game_ui_space_loaded() -> void:
115115
116116## connect_to_server
117117func connect_to_server (server_addr : Variant , port : Variant ) -> bool :
118+ GameUI .loading_ui .populate_status ("Opening connection to server" )
119+ print ("Opening connection to server at " , Time .get_datetime_string_from_system ())
118120 if server_addr .is_empty ():
119121 return false
120122 client_peer = ENetMultiplayerPeer .new ()
@@ -162,7 +164,8 @@ func _client_on_connected_to_server() -> void:
162164 print ("----------------------------------------" )
163165 print ("ClientPeer: Connected to a server... waiting for server to grant access" )
164166 print ("----------------------------------------" )
165-
167+ GameUI .loading_ui .populate_status ("Client socked open" )
168+ print ("Client connection opened at " + Time .get_datetime_string_from_system ())
166169 Analytics .track_event_client (AnalyticsEvent .TYPE .SPACE_JOIN_ATTEMPT_SUCCESS , {"spaceId" : _queued_space_id })
167170 Zone .change_to_space_scene ()
168171 # TODO: Instead of true, determine if the player has creator permissions for the space.
@@ -175,18 +178,22 @@ func _client_on_connected_to_server() -> void:
175178 var jwt = Firebase .Auth .get_jwt ()
176179 var user_id = JWT .get_user_id_from_jwt (jwt , "test123" )
177180 var client_version : String = str (Util .get_version_string ())
181+ GameUI .loading_ui .populate_status ("Requesting client spawn..." )
182+ print ("Sending client init to server at " + Time .get_datetime_string_from_system ())
178183 Zone .send_data_to_server ([Packet .TYPE .CLIENT_INIT , jwt , client_version ])
179184 PlayerData .acknowledge_local_user_id (user_id )
180185
181186 # note: GDScript cannot understand Zone definition unless passed via a variable in the stack.
182187 var zone_autoload = Zone
188+ # TODO: gordon look here this is a bit fishy. Why start syncing things before all objects exist?
183189 TMSceneSync .start_sync (zone_autoload )
184190
185191 # wait for the space to be in a loaded enough condition to join.
186192 # play servers load all objects before finishing
187193 # wait for the first spawn to complete too
188194 while not is_space_loaded ():
189195 await get_tree ().create_timer (0.5 ).timeout
196+
190197 join_server_complete .emit ()
191198
192199
@@ -438,6 +445,8 @@ func start_join_localhost() -> void:
438445
439446
440447func start_join_zone_by_space_id (space_id : String ) -> void :
448+ print ("Join requested at " , Time .get_datetime_string_from_system ())
449+ GameUI .loading_ui .populate_status ("Joining space" )
441450 _is_joining_play_space = false
442451 join_server_start .emit ()
443452 if space_id == _LOCALHOST :
@@ -449,6 +458,7 @@ func start_join_zone_by_space_id(space_id: String) -> void:
449458
450459
451460func start_join_play_space_by_space_id (space_id : String ) -> void :
461+ GameUI .loading_ui .populate_status ("Joining space" )
452462 join_server_start .emit ()
453463 _disconnect_from_server_peer ()
454464 _is_joining_play_space = true # after disconnect so flag is not cleared
0 commit comments