@@ -46,7 +46,7 @@ void GameThread::load_games() {
4646 auto sections = config_reader.Sections ();
4747 std::unordered_set<std::string> games_to_open;
4848 for (const auto §ion : sections) {
49- std::string folder_name = config_reader.GetString (section, " folder" , " " );
49+ std::string folder_name = config_reader.GetString (section, " folder" , section );
5050 int tickrate = config_reader.GetInteger (section, " tickrate" , 0 );
5151 if (tickrate < 16 ) {
5252 tickrate = 0 ;
@@ -674,7 +674,6 @@ void GameThread::remove_peer_from_lobby(GameData &game, LobbyData &lobby, std::s
674674 game.lobbies_updated .insert (lobby.id );
675675 if ((is_host && (lobby.disband_on_leave || game.disband_on_leave )) || lobby.peer_ids .empty ()) {
676676 game.lobbies .erase (lobby.id );
677- lobby.close ();
678677 }
679678}
680679
@@ -923,15 +922,8 @@ void GameThread::on_create_lobby(
923922 .create_time = now,
924923 .game_id = peer.game_id ,
925924 .sealed = decode_bool_or_default (data_val, " s" , game.seal ),
926- .tags = lobby_tags,
927- .lua = ScriptLua{.scripts_folder = game.lua .scripts_folder ,
928- .folder_name = game.lua .folder_name ,
929- .script_entrypoint = " main.lua" ,
930- .logs_folder = game.lua .logs_folder ,
931- .game_thread = this ,
932- .enabled = game.lua .enabled }});
925+ .tags = lobby_tags});
933926 auto &lobby = game.lobbies [small_uuid];
934- lobby.open ();
935927 game.lobby_listing_peers .erase (peer.id );
936928 // SCRIPTED CALL
937929 if (game.enabled_callbacks .find (" _can_create_lobby" ) != game.enabled_callbacks .end ()) {
@@ -942,7 +934,6 @@ void GameThread::on_create_lobby(
942934 if (has_error && std::holds_alternative<std::string>(func_result.value )) {
943935 // revert the changes
944936 peer.leave_lobby ();
945- lobby.close ();
946937 game.lobbies .erase (small_uuid);
947938 return on_error (game, command_id, peer.id , std::get<std::string>(func_result.value ),
948939 false , has_error);
@@ -1896,14 +1887,8 @@ AnyElement GameThread::scripted_function_call(std::string peer_id, std::string l
18961887 bool &has_error) {
18971888 if (game.lua .enabled ) {
18981889 AnyElement result;
1899- if (lobby_id != " " && game.lobbies .find (lobby_id) != game.lobbies .end ()) {
1900- // lobby function call
1901- auto &lobby = game.lobbies [lobby_id];
1902- result = lobby.lua .func_call (funcname, args, peer_id, lobby_id, game.id , has_error);
1903- } else {
1904- // game function call
1905- result = game.lua .func_call (funcname, args, peer_id, lobby_id, game.id , has_error);
1906- }
1890+ // game function call
1891+ result = game.lua .func_call (funcname, args, peer_id, lobby_id, game.id , has_error);
19071892 // if dictionary with error, put error
19081893 auto result_dict =
19091894 std::get_if<boost::container::flat_map<std::string, AnyElement>>(&result.value );
0 commit comments