Extra tools: Difference between revisions

Undo revision 13070 by Zwelf (talk) (spacing was needed...)
Tag: Undo
m better spacing (now checked that only unnecessary spaces are deleted)
 
Line 3: Line 3:
<!--T:1-->
<!--T:1-->
'''''Extra tools''''' are available for running some non-gaming-related tasks, like map optimization by mappers, or debugging and testing by developers. These tools must be run from command-line interface (e.g. Command Prompt on Windows or Terminal on Linux) either by adding their containing directory to the PATH variable or by running directly from the containing directory.
'''''Extra tools''''' are available for running some non-gaming-related tasks, like map optimization by mappers, or debugging and testing by developers. These tools must be run from command-line interface (e.g. Command Prompt on Windows or Terminal on Linux) either by adding their containing directory to the PATH variable or by running directly from the containing directory.


== Getting the extra tools == <!--T:2-->
== Getting the extra tools == <!--T:2-->
Line 12: Line 11:
<!--T:4-->
<!--T:4-->
These and other extra tools (listed below) can be found on the [https://github.com/ddnet/ddnet DDNet source code] under [https://github.com/ddnet/ddnet/tree/master/src/tools src/tools] directory.
These and other extra tools (listed below) can be found on the [https://github.com/ddnet/ddnet DDNet source code] under [https://github.com/ddnet/ddnet/tree/master/src/tools src/tools] directory.


== List of extra tools == <!--T:5-->
== List of extra tools == <!--T:5-->
Line 18: Line 16:
<!--T:6-->
<!--T:6-->
See below the list and description of the tools.
See below the list and description of the tools.


=== config_retrieve === <!--T:7-->
=== config_retrieve === <!--T:7-->


  <!--T:8-->
<!--T:8-->
config_retrieve ''map_file''
config_retrieve ''map_file''


Line 30: Line 27:
<!--T:10-->
<!--T:10-->
''Available since: DDNet 9.0''
''Available since: DDNet 9.0''


=== config_store === <!--T:11-->
=== config_store === <!--T:11-->


  <!--T:12-->
<!--T:12-->
config_store ''map_file''
config_store ''map_file''


Line 45: Line 41:
<!--T:15-->
<!--T:15-->
''Available since: DDNet 9.0''
''Available since: DDNet 9.0''


=== crapnet === <!--T:16-->
=== crapnet === <!--T:16-->


  <!--T:17-->
<!--T:17-->
crapnet
crapnet


Line 58: Line 53:
=== dilate === <!--T:19-->
=== dilate === <!--T:19-->


  <!--T:20-->
<!--T:20-->
dilate ''image_file1'' [''image_file2'' ... ]
dilate ''image_file1'' [''image_file2'' ... ]


Line 66: Line 61:
<!--T:22-->
<!--T:22-->
Note this works only in RGBA image files (e.g. PNG files). So, it will fail in e.g. JPEG files.
Note this works only in RGBA image files (e.g. PNG files). So, it will fail in e.g. JPEG files.


=== dummy_map === <!--T:23-->
=== dummy_map === <!--T:23-->
Line 75: Line 69:
<!--T:25-->
<!--T:25-->
Creates a dummy, small empty map to be used to start a server. See [https://github.com/ddnet/ddnet/blob/a66379918832e5ad93332bbe0475394b156b5c24/src/engine/shared/network_server.cpp#L371] for more info.
Creates a dummy, small empty map to be used to start a server. See [https://github.com/ddnet/ddnet/blob/a66379918832e5ad93332bbe0475394b156b5c24/src/engine/shared/network_server.cpp#L371] for more info.


=== fake_server === <!--T:26-->
=== fake_server === <!--T:26-->


  <!--T:27-->
<!--T:27-->
fake_server
fake_server


<!--T:28-->
<!--T:28-->
Creates a fake server for testing.
Creates a fake server for testing.


=== map_convert_07 === <!--T:29-->
=== map_convert_07 === <!--T:29-->


  <!--T:30-->
<!--T:30-->
map_convert_07 ''src_map_file'' ''dest_map_file''
map_convert_07 ''src_map_file'' ''dest_map_file''


Line 104: Line 96:
<!--T:33-->
<!--T:33-->
''Available since: DDNet 12.9''
''Available since: DDNet 12.9''


=== map_diff === <!--T:34-->
=== map_diff === <!--T:34-->


  <!--T:35-->
<!--T:35-->
map_diff ''map_file1'' ''map_file2''
map_diff ''map_file1'' ''map_file2''


Line 120: Line 111:
<!--T:37-->
<!--T:37-->
If there is no difference between maps, returns 0; otherwise, returns 1.
If there is no difference between maps, returns 0; otherwise, returns 1.


=== map_extract === <!--T:38-->
=== map_extract === <!--T:38-->


  <!--T:39-->
<!--T:39-->
map_extract ''map_file'' [''directory'']
map_extract ''map_file'' [''directory'']


<!--T:40-->
<!--T:40-->
Extracts contents from ''map_file'' into the ''directory''. If optional argument ''directory'' is not provided, extracts to the current directory.
Extracts contents from ''map_file'' into the ''directory''. If optional argument ''directory'' is not provided, extracts to the current directory.


=== map_optimize === <!--T:41-->
=== map_optimize === <!--T:41-->


  <!--T:42-->
<!--T:42-->
map_optimize ''source_map_filepath'' [''dest_map_filepath'']
map_optimize ''source_map_filepath'' [''dest_map_filepath'']


Line 147: Line 136:
<!--T:46-->
<!--T:46-->
''Available since:'' DDNet 15.5.4
''Available since:'' DDNet 15.5.4


=== map_replace_image === <!--T:47-->
=== map_replace_image === <!--T:47-->


  <!--T:48-->
<!--T:48-->
map_replace_image ''map_file1'' ''map_file2'' ''imagename'' ''image_file''
map_replace_image ''map_file1'' ''map_file2'' ''imagename'' ''image_file''


Line 161: Line 149:
* Both map filenames must be relative to user default DDNet folder
* Both map filenames must be relative to user default DDNet folder
* New image filepath can be absolute, or relative to the current directory
* New image filepath can be absolute, or relative to the current directory


=== map_resave === <!--T:51-->
=== map_resave === <!--T:51-->


  <!--T:52-->
<!--T:52-->
map_resave ''map_file'' ''image_file''
map_resave ''map_file'' ''image_file''


Line 173: Line 160:
<!--T:54-->
<!--T:54-->
The error status 255 is returned if 1) a number of arguments different from 2 is provided, 2) if the ''map_file.map'' is not valid, or 3) if ''image_file'' is not a valid image file (e.g. it is a text file); otherwise, return 0.
The error status 255 is returned if 1) a number of arguments different from 2 is provided, 2) if the ''map_file.map'' is not valid, or 3) if ''image_file'' is not a valid image file (e.g. it is a text file); otherwise, return 0.


=== packetgen === <!--T:55-->
=== packetgen === <!--T:55-->


  <!--T:56-->
<!--T:56-->
packetgen
packetgen


<!--T:57-->
<!--T:57-->
Generates and sends network packets to 127.0.0.1:8303 (localhost, in default server port) to test communication with a local server instance.
Generates and sends network packets to 127.0.0.1:8303 (localhost, in default server port) to test communication with a local server instance.


=== unicode_confusables === <!--T:58-->
=== unicode_confusables === <!--T:58-->


  <!--T:59-->
<!--T:59-->
unicode_confusables ''string1'' ''string2''
unicode_confusables ''string1'' ''string2''


Line 200: Line 185:
<!--T:63-->
<!--T:63-->
''New in DDNet version 12.9:'' Unicode 12.0 support and the tool name was renamed from ''confusables'' to ''unicode_confusables''.
''New in DDNet version 12.9:'' Unicode 12.0 support and the tool name was renamed from ''confusables'' to ''unicode_confusables''.


=== uuid === <!--T:64-->
=== uuid === <!--T:64-->


  <!--T:65-->
<!--T:65-->
uuid ''name''
uuid ''name''