Extra tools/pt-br: Difference between revisions

From DDraceNetwork
(Created page with "Cria um servidor falso para testes.")
(Created page with "=== map_convert_07 ===")
Line 59: Line 59:
Cria um servidor falso para testes.
Cria um servidor falso para testes.


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


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

Revision as of 16:45, 9 February 2024

Ferramentas extras estão disponíveis para executar algumas tarefas não relacionadas a jogar, como otimização de mapas por mapeadores ou depuração e testes por desenvolvedores. Essas ferramentas devem ser executadas a partir da interface de linha de comando (por exemplo, Prompt de Comando no Windows ou Terminal no Linux), adicionando o diretório que as contém à variável PATH ou executando diretamente a partir do diretório que as contém.

Obtendo as ferramentas extras

Essas ferramentas não são fornecidas no jogo binário do DDNet na página de downloads. Dito isto, ferramentas extras relacionadas ao mapeamento podem ser baixadas para diferentes plataformas na página de Downloads, sob o nome "Ferramentas Gráficas".

Essas e outras ferramentas extras (listadas abaixo) podem ser encontradas no código-fonte do DDNet em diretório de ferramentas src/tools.

Lista de ferramentas extras

Veja abaixo a lista e descrição das ferramentas.

config_retrieve

config_retrieve arquivo_mapa

Obtém a configuração incorporada em um arquivo de mapa arquivo_mapa do DDNet e a armazena em um arquivo de configuração de mapa do DDNet com o mesmo nome de arquivo (por exemplo, "Kobra 4.map" retorna "Kobra 4.cfg")

Disponível desde: DDNet 9.0

config_store

config_store arquivo_mapa

Armazena a configuração de um arquivo de configuração de mapa em arquivo_mapa. Os arquivos de configuração e de mapa devem ter o mesmo nome de arquivo no mesmo diretório, caso contrário a operação falhará.

Se não houver diferença entre a configuração armazenada e a configuração incorporada no mapa, a operação será cancelada com a mensagem configs coincide, not updating map.

Disponível desde: DDNet 9.0

crapnet

crapnet

Testa a conexão definindo uma conexão cliente-servidor localmente e executando ping entre eles. Relata pacotes descartados com a mensagem dropped packet (pacote descartado) e sucessos com cfg = número, onde número varia de 0 a 2.


dilate

dilate arquivo_imagem1 [arquivo_imagem2 ... ]

É uma ferramenta gráfica, útil principalmente para mapeadores. Ele cuida das áreas transparentes para evitar contornos em preto e branco ao redor das imagens no jogo, evitando problemas de mesclagem e mipmap. Consulte Edge padding (Preenchimento de borda, em tradução livre) para obter mais informações.

Observe que isso funciona apenas em arquivos de imagem RGBA (por exemplo, arquivos PNG). Então, ele irá falhar, p. ex., em arquivos JPEG.

dummy_map

 dummy_map

Cria um pequeno mapa vazio fictício para ser usado para iniciar um servidor. Consulte [1] para obter mais informações.

fake_server

fake_server

Cria um servidor falso para testes.

map_convert_07

map_convert_07 src_map_file dest_map_file

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.

Available since: DDNet 12.9

map_diff

map_diff map_file1 map_file2

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 map_file [directory]

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

map_optimize

map_optimize source_map_filepath [dest_map_filepath]

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.

Available since: DDNet 15.5.4

map_replace_image

map_replace_image map_file1 map_file2 imagename image_file

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 map_file image_file

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 string1 string2

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.

Available since: DDNet version 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 name

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.

Available since: DDNet 10.6.1