MCPcopy Create free account
hub / github.com/ddnet/ddnet / export_settings_commands_table

Function export_settings_commands_table

scripts/export_settings_commands_table.py:201–245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

199
200
201def export_settings_commands_table():
202 print("<!-- DO NOT EDIT MANUALLY! THIS FILE IS AUTOMATICALLY GENERATED BY https://github.com/ddnet/ddnet/blob/master/scripts/export_settings_commands_table.py -->")
203
204 settings = parse_settings(read_files("src/engine/shared/config_variables.h"))
205 commands = parse_commands(read_files("src/**/*.cpp"))
206
207 export_block(
208 "Map Settings",
209 export_settings([setting for setting in settings if "CFGFLAG_SERVER" in setting["flags"] and "CFGFLAG_GAME" in setting["flags"]]) + "\n" + export_commands([command for command in commands if "CFGFLAG_SERVER" in command["flags"] and "CFGFLAG_GAME" in command["flags"]]),
210 )
211
212 export_block(
213 "Server Settings",
214 export_settings([setting for setting in settings if "CFGFLAG_SERVER" in setting["flags"]]),
215 )
216
217 export_block(
218 "Econ Settings",
219 export_settings([setting for setting in settings if "CFGFLAG_ECON" in setting["flags"]]),
220 )
221
222 export_block(
223 "Server Commands",
224 export_commands([command for command in commands if "CFGFLAG_SERVER" in command["flags"] and "CFGFLAG_CHAT" not in command["flags"]]),
225 )
226
227 export_block(
228 "Chat Commands",
229 export_commands([command for command in commands if "CFGFLAG_SERVER" in command["flags"] and "CFGFLAG_CHAT" in command["flags"]]),
230 )
231
232 export_block(
233 "Client Settings",
234 export_settings([setting for setting in settings if "CFGFLAG_CLIENT" in setting["flags"]]),
235 )
236
237 export_block(
238 "Client Commands",
239 export_commands([command for command in commands if "CFGFLAG_CLIENT" in command["flags"]]),
240 )
241
242 export_block(
243 "Tunings",
244 export_tunings(parse_tunings(read_files("src/game/tuning.h"))),
245 )
246
247
248if __name__ == "__main__":

Calls 8

parse_settingsFunction · 0.85
read_filesFunction · 0.85
parse_commandsFunction · 0.85
export_blockFunction · 0.85
export_settingsFunction · 0.85
export_commandsFunction · 0.85
export_tuningsFunction · 0.85
parse_tuningsFunction · 0.85

Tested by

no test coverage detected