Extra tools/ru: Difference between revisions

From DDraceNetwork
(Created page with "uuid ''имя''")
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
<languages/>
'''''Дополнительные утилиты''''' предназначены для некоторых задач, не связанных с игровым процессом, по типу оптимизации карт для мапперов, или отладки и тестирования для разработчиков. Эти утилиты должны запускаться из command-line интерфейса (вроде Командной строки в Windows или Терминала в системах на базе ядра Linux) either by adding their containing directory to the PATH variable or by running directly from the containing directory.
'''''Дополнительные утилиты''''' предназначены для некоторых задач, не связанных с игровым процессом, по типу оптимизации карт для мапперов, или отладки и тестирования для разработчиков. Эти утилиты должны запускаться из command-line интерфейса (вроде Командной строки в Windows или Терминала в системах на базе ядра Linux) either by adding their containing directory to the PATH variable or by running directly from the containing directory.


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 12: Line 11:
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.
</div>
</div>


<span id="List_of_extra_tools"></span>
<span id="List_of_extra_tools"></span>
Line 18: Line 16:


Смотрите ниже список и описание инструментов.
Смотрите ниже список и описание инструментов.


=== config_retrieve ===
=== config_retrieve ===


  config_retrieve ''Имя_карты''
config_retrieve ''Имя_карты''


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 29: Line 26:


''Доступно с версии: DDNet 9.0''
''Доступно с версии: DDNet 9.0''


=== config_store ===
=== config_store ===


  config_store ''Имя_Карты''
config_store ''Имя_Карты''


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 44: Line 40:


''Доступно с версии: DDNet 9.0''
''Доступно с версии: DDNet 9.0''


=== crapnet ===
=== crapnet ===


  crapnet
crapnet


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 57: Line 52:
=== dilate ===
=== dilate ===


  dilate ''Файл_изображения1'' [''Файл_изображения2'' ... ]
dilate ''Файл_изображения1'' [''Файл_изображения2'' ... ]


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 66: Line 61:
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.
</div>
</div>


=== dummy_map ===
=== dummy_map ===
Line 75: Line 69:
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.
</div>
</div>


=== fake_server ===
=== fake_server ===


  fake_server
fake_server


Создает фальшивый(фейковый) сервер для тестирования.
Создает фальшивый(фейковый) сервер для тестирования.


=== map_convert_07 ===
=== map_convert_07 ===


  map_convert_07 ''путь_к_файлу_карты'' ''место_назначение_файла_карты''
map_convert_07 ''путь_к_файлу_карты'' ''место_назначение_файла_карты''


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 102: Line 94:


''Доступно с версии: DDNet 12.9''
''Доступно с версии: DDNet 12.9''


=== map_diff ===
=== map_diff ===


  map_diff ''файл_карты1'' ''файл_карты2''
map_diff ''файл_карты1'' ''файл_карты2''


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 119: Line 110:
If there is no difference between maps, returns 0; otherwise, returns 1.
If there is no difference between maps, returns 0; otherwise, returns 1.
</div>
</div>


=== map_extract ===
=== map_extract ===


  map_extract ''файл_Карты'' [''директория'']
map_extract ''файл_Карты'' [''директория'']


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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.
</div>
</div>


=== map_optimize ===
=== map_optimize ===


  map_optimize ''Исходный_путь_к_файлу_карты'' [''место_назначение_файла_карты'']
map_optimize ''Исходный_путь_к_файлу_карты'' [''место_назначение_файла_карты'']


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 147: Line 136:


''Доступно с версии: DDNet 15.5.4''
''Доступно с версии: DDNet 15.5.4''


=== map_replace_image ===
=== map_replace_image ===


  map_replace_image ''файл_карты1'' ''файл_карты2'' ''имя_изображения'' ''файл_изображения''
map_replace_image ''файл_карты1'' ''файл_карты2'' ''имя_изображения'' ''файл_изображения''


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 162: Line 150:
* New image filepath can be absolute, or relative to the current directory
* New image filepath can be absolute, or relative to the current directory
</div>
</div>


=== map_resave ===
=== map_resave ===


  map_resave ''файл_карты'' ''файл_изображения''
map_resave ''файл_карты'' ''файл_изображения''


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 175: Line 162:
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.
</div>
</div>


=== packetgen ===
=== packetgen ===


  packetgen
packetgen


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
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.
</div>
</div>


=== unicode_confusables ===
=== unicode_confusables ===


  unicode_confusables ''строка1'' ''строка2''
unicode_confusables ''строка1'' ''строка2''


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">
Line 203: Line 188:
''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''.
</div>
</div>


=== uuid ===
=== uuid ===


  uuid ''имя''
uuid ''имя''


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">

Revision as of 16:47, 13 March 2023

Дополнительные утилиты предназначены для некоторых задач, не связанных с игровым процессом, по типу оптимизации карт для мапперов, или отладки и тестирования для разработчиков. Эти утилиты должны запускаться из command-line интерфейса (вроде Командной строки в Windows или Терминала в системах на базе ядра Linux) either by adding their containing directory to the PATH variable or by running directly from the containing directory.

Getting the extra tools

Эти утилиты не поставляются в комплекте с бинарными файлами DDNet со загрузки. Having that said, extra tools mapping-related can be download for different platforms in the Downloads page, under the name "Graphics Tools".

These and other extra tools (listed below) can be found on the DDNet source code under src/tools directory.

Список дополнительных утилит

Смотрите ниже список и описание инструментов.

config_retrieve

config_retrieve Имя_карты

Retrieves configuration embedded in a DDNet map file map_file and stores it in a DDNet map configuration file with same filename (e.g. "Kobra 4.map" returns "Kobra 4.cfg")

Доступно с версии: DDNet 9.0

config_store

config_store Имя_Карты

Stores configuration from a map's configuration file into the map_file. Both configuration and map files must have the same filename in the same directory, otherwise the operation will fail.

If there is no difference between the configuration to stored and the configuration embedded in the map, then operation will be canceled with message configs coincide, not updating map.

Доступно с версии: DDNet 9.0

crapnet

crapnet

Tests connection by setting a client–server connection locally and running ping between them. Reports dropped packets with message dropped packet and successes with cfg = number, where number varies from 0 to 2.


dilate

dilate Файл_изображения1 [Файл_изображения2 ... ]

It is a graphics tool, mainly useful for mappers. It takes care of transparent areas to prevent black/white outlines around your images ingame, therefore avoiding blending and mipmap issues. See Edge padding for more info.

Note this works only in RGBA image files (e.g. PNG files). So, it will fail in e.g. JPEG files.

dummy_map

 dummy_map

Creates a dummy, small empty map to be used to start a server. See [1] for more info.

fake_server

fake_server

Создает фальшивый(фейковый) сервер для тестирования.

map_convert_07

map_convert_07 путь_к_файлу_карты место_назначение_файла_карты

Makes dest_map_file compatible with Teeworlds version 7.x that otherwise it would be compatible only with Teeworlds version 6.x. If successfully, it creates a valid 07-compatible destination map; otherwise, it returns one of the following:

  • an usage message if incorrect arguments are provided
  • failed to open source map if an error happens when opening the source map
  • failed to open destination map if an error happens when opening the destination map
  • error loading storage if failed to open storage for some reason
  • failed to open image file if error happens on opening PNG image
  • invalid image format if incorrectly formatted PNG.

Доступно с версии: DDNet 12.9

map_diff

map_diff файл_карты1 файл_карты2

Compares two map files, reporting one of the follow:

  • no diff output, meaning the maps are the same
  • different layer numbers, if one map has more layers than another
  • different tile layers, if the number of layers is the same, but at least one layer is different
  • lastly, the index and flags positions that differ.

If there is no difference between maps, returns 0; otherwise, returns 1.

map_extract

map_extract файл_Карты [директория]

Extracts contents from map_file into the directory. If optional argument directory is not provided, extracts to the current directory.

map_optimize

map_optimize Исходный_путь_к_файлу_карты [место_назначение_файла_карты]

Optimizes the map file in the source_map_filepath given (see how it works) and stores the output in the given dest_map_filepath; if dest_map_filepath is unset, output path defaults to out/source_map_filename.map, stripping the path and the extension of the source file.

Note the name of the embedded images optimized is changed from originalname to originalname_cut_newSHA256 (where newSHA256 is the new sha256 of the embedded optimized image). It is renamed is to make clear it was optimized because this tool will make changes in the mapres used by the map file.

If failed to open source or target file, returns -1.

Доступно с версии: DDNet 15.5.4

map_replace_image

map_replace_image файл_карты1 файл_карты2 имя_изображения файл_изображения

Replaces the image imagename currently inside the map filename map_file1 with the image filepath image_file, and save into the map filename map_file2.map.

Please note:

  • Both map filenames must be relative to user default DDNet folder
  • New image filepath can be absolute, or relative to the current directory

map_resave

map_resave файл_карты файл_изображения

Updates the map file map_file.map with the provided file image_file.

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

packetgen

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

unicode_confusables строка1 строка2

Compares string1 with string2 and report if they are "confusable", i.e. if the characters are "equal" and could cause confusion. For this to work, the characters with accents or other things around them are considered the "confusable" with the base character. Therefore, aa and are confusable (á was considered as a), while aa and ab are not.

If they are confusable, it returns not_confusable=0, otherwise, returns not_confusable=1.

Доступно с версии: DDNet 10.3.5

New in DDNet version 12.9: Unicode 12.0 support and the tool name was renamed from confusables to unicode_confusables.

uuid

uuid имя

Prints uuid for the provided name.

The uuid system was implemented to be easily extended by independent authors without collisions, something that the old system – with increasing integers – did not allow. This works for engine and game messages, snapshot items and events.

Exits with error status 255 if name is not provided.

Доступно с версии: DDNet 10.6.1