Skip to content

Commit

Permalink
Merge branch 'ddnet' into chillerbot
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Dec 22, 2023
2 parents aa36a7e + e26ae3a commit 81cc588
Show file tree
Hide file tree
Showing 207 changed files with 8,857 additions and 2,373 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ Checks: >
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-named-parameter,
-readability-non-const-parameter,
-readability-simplify-boolean-expr,
Expand Down
24 changes: 16 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1917,6 +1917,7 @@ set_src(ENGINE_INTERFACE GLOB src/engine
keys.h
map.h
message.h
notifications.h
rust.h
server.h
serverbrowser.h
Expand Down Expand Up @@ -2190,6 +2191,7 @@ if(CLIENT)
updater.h
video.cpp
video.h
warning.cpp
)
set_src(GAME_CLIENT GLOB_RECURSE src/game/client
animstate.cpp
Expand Down Expand Up @@ -2366,13 +2368,22 @@ if(CLIENT)
component.h
editor.cpp
editor.h
editor_action.h
editor_actions.cpp
editor_actions.h
editor_history.cpp
editor_history.h
editor_object.cpp
editor_object.h
editor_props.cpp
editor_trackers.cpp
editor_trackers.h
explanations.cpp
map_grid.cpp
map_grid.h
map_view.cpp
map_view.h
mapitems.h
mapitems/envelope.cpp
mapitems/envelope.h
mapitems/image.cpp
Expand Down Expand Up @@ -3161,15 +3172,12 @@ if(NOT DEV)
if(ANTIBOT)
install(TARGETS ${TARGET_ANTIBOT} DESTINATION ${CMAKE_INSTALL_LIBDIR}/ddnet COMPONENT server)
endif()
install(TARGETS ${TARGETS_TOOLS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/chillerbot-ux COMPONENT tools)
install(TARGETS ${TARGETS_TOOLS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/ddnet COMPONENT tools)
install(FILES other/chillerbot-ux.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications COMPONENT client)
install(FILES other/chillerbot-ux.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo COMPONENT client)
if(NOT CURSES_CLIENT)
foreach(SIZE 16 32 48 256)
install(FILES other/icons/chillerbot-ux_${SIZE}x${SIZE}x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME chillerbot-ux.png COMPONENT client)
install(FILES other/icons/DDNet-Server_${SIZE}x${SIZE}x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME ddnet-server.png COMPONENT server)
endforeach()
endif()
foreach(SIZE 16 32 48 256)
install(FILES other/icons/chillerbot-ux_${SIZE}x${SIZE}x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME chillerbot-ux.png COMPONENT client)
install(FILES other/icons/DDNet-Server_${SIZE}x${SIZE}x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME ddnet-server.png COMPONENT server)
endforeach()
foreach(file ${VULKAN_SHADER_FILE_LIST})
install(FILES ${PROJECT_BINARY_DIR}/${file} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ddnet/data/shader/vulkan COMPONENT client)
endforeach()
Expand Down
37 changes: 19 additions & 18 deletions data/languages/brazilian_portuguese.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# Rafael Fontenelle 2023-07-07 12:11:00
# Rafael Fontenelle 2023-08-14 14:17:00
# Rafael Fontenelle 2023-09-25 14:23:00
# Rafael Fontenelle 2023-12-05 17:01:00
##### /authors #####

##### translated strings #####
Expand Down Expand Up @@ -1723,56 +1724,56 @@ Render cut to video
== Renderizar corte do vídeo

Error playing demo
==
== Erro ao reproduzir demo

Some map images could not be loaded. Check the local console for details.
==
== Algumas imagens de mapa não puderam ser carregadas. Verifique o console local para detalhes.

Some map sounds could not be loaded. Check the local console for details.
==
== Alguns sons de mapa não puderam ser carregadas. Verifique o console local para detalhes.

Loading menu themes
==
== Carregando temas de menu

Render complete
==
== Renderização concluída

Videos directory
==
== Diretório de vídeos

Video was saved to '%s'
==
== O vídeo foi salvo em "%s"

No demo selected
==
== Nenhuma demo selecionada

Created
==
== Criada

Netversion
==
== Netversion

[Demo details]
map not included
==
== mapa não incluído

Ghosts directory
==
== Diretório de fantasmas

Activate all
==
== Ativar tudo

Deactivate all
==
== Desativar tudo

Enable ghost
==
== Habilitar fantasma

Only save improvements
==
== Salvar somente melhorias

Regular background color
==
== Cor de fundo regular

Entities background color
==
== Cor de fundo de entidades
2 changes: 1 addition & 1 deletion data/shader/tile_border.frag
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ uniform sampler2DArray gTextureSampler;
uniform vec4 gVertColor;

#ifdef TW_TILE_TEXTURED
noperspective in vec3 TexCoord;
noperspective centroid in vec3 TexCoord;
#endif

out vec4 FragClr;
Expand Down
2 changes: 1 addition & 1 deletion data/shader/vulkan/tile_border.frag
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ layout(push_constant) uniform SVertexColorBO {
} gColorBO;

#ifdef TW_TILE_TEXTURED
layout (location = 0) noperspective in vec3 TexCoord;
layout (location = 0) noperspective centroid in vec3 TexCoord;
#endif

layout (location = 0) out vec4 FragClr;
Expand Down
1 change: 1 addition & 0 deletions datasrc/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def gen_network_source():
print("""\
#include "protocol.h"
#include <base/system.h>
#include <engine/shared/packer.h>
#include <engine/shared/protocol.h>
#include <engine/shared/uuid_manager.h>
Expand Down
16 changes: 11 additions & 5 deletions datasrc/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@
};
'''

RawSource = '''
#include "protocol.h"
'''

Enums = [
Enum("EMOTE", Emotes),
Enum("POWERUP", Powerups),
Expand Down Expand Up @@ -439,7 +435,7 @@
]),

NetMessage("Sv_VoteSet", [
NetIntRange("m_Timeout", 0, 60),
NetIntRange("m_Timeout", 0, 'max_int'),
NetStringStrict("m_pDescription"),
NetStringStrict("m_pReason"),
]),
Expand Down Expand Up @@ -566,4 +562,14 @@
NetBool("m_RecordPersonal"),
NetBool("m_RecordServer", default=False),
]),

NetMessageEx("Sv_CommandInfo", "commandinfo@netmsg.ddnet.org", [
NetStringStrict("m_pName"),
NetStringStrict("m_pArgsFormat"),
NetStringStrict("m_pHelpText")
]),

NetMessageEx("Sv_CommandInfoRemove", "commandinfo-remove@netmsg.ddnet.org", [
NetStringStrict("m_pName")
]),
]
1 change: 1 addition & 0 deletions datasrc/seven/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class CNetObjHandler
lines = []

lines += ['#include "protocol7.h"']
lines += ['#include <base/system.h>']
lines += ['#include <engine/shared/packer.h>']
lines += ['#include <engine/shared/protocol.h>']

Expand Down
4 changes: 0 additions & 4 deletions datasrc/seven/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@
};
'''

RawSource = '''
#include "protocol.h"
'''

Enums = [
Pickups,
Emotes,
Expand Down
14 changes: 4 additions & 10 deletions other/manifest/client.manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 and Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>

Expand Down
1 change: 0 additions & 1 deletion src/antibot/antibot_data.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef ANTIBOT_ANTIBOT_DATA_H
#define ANTIBOT_ANTIBOT_DATA_H

#include <base/system.h>
#include <base/vmath.h>

enum
Expand Down
8 changes: 8 additions & 0 deletions src/base/detect.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,12 @@
#define CONF_ARCH_STRING "unknown"
#endif

#if defined(CONF_ARCH_ENDIAN_LITTLE)
#define CONF_ARCH_ENDIAN_STRING "little endian"
#elif defined(CONF_ARCH_ENDIAN_BIG)
#define CONF_ARCH_ENDIAN_STRING "big endian"
#else
#error "Unsupported endianness"
#endif

#endif
1 change: 0 additions & 1 deletion src/base/hash_ctxt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define BASE_HASH_CTXT_H

#include "hash.h"
#include "system.h"
#include <cstdint>

#if defined(CONF_OPENSSL)
Expand Down
28 changes: 19 additions & 9 deletions src/base/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ bool dbg_assert_has_failed()
return dbg_assert_failing.load(std::memory_order_acquire);
}

void dbg_assert_imp(const char *filename, int line, int test, const char *msg)
void dbg_assert_imp(const char *filename, int line, bool test, const char *msg)
{
if(!test)
{
Expand Down Expand Up @@ -1470,7 +1470,7 @@ std::string windows_format_system_message(unsigned long error)

std::optional<std::string> message = windows_wide_to_utf8(wide_message);
LocalFree(wide_message);
return message.value_or("invalid error");
return message.value_or("(invalid UTF-16 in error message)");
}
#endif

Expand Down Expand Up @@ -1560,14 +1560,17 @@ NETSOCKET net_udp_create(NETADDR bindaddr)

/* set broadcast */
if(setsockopt(socket, SOL_SOCKET, SO_BROADCAST, (const char *)&broadcast, sizeof(broadcast)) != 0)
dbg_msg("socket", "Setting BROADCAST on ipv4 failed: %d", errno);
{
dbg_msg("socket", "Setting BROADCAST on ipv4 failed: %d", net_errno());
}

{
/* set DSCP/TOS */
int iptos = 0x10 /* IPTOS_LOWDELAY */;
//int iptos = 46; /* High Priority */
if(setsockopt(socket, IPPROTO_IP, IP_TOS, (char *)&iptos, sizeof(iptos)) != 0)
dbg_msg("socket", "Setting TOS on ipv4 failed: %d", errno);
{
dbg_msg("socket", "Setting TOS on ipv4 failed: %d", net_errno());
}
}
}
}
Expand Down Expand Up @@ -1605,15 +1608,21 @@ NETSOCKET net_udp_create(NETADDR bindaddr)

/* set broadcast */
if(setsockopt(socket, SOL_SOCKET, SO_BROADCAST, (const char *)&broadcast, sizeof(broadcast)) != 0)
dbg_msg("socket", "Setting BROADCAST on ipv6 failed: %d", errno);
{
dbg_msg("socket", "Setting BROADCAST on ipv6 failed: %d", net_errno());
}

// TODO: setting IP_TOS on ipv6 with setsockopt is not supported on Windows, see https://github.com/ddnet/ddnet/issues/7605
#if !defined(CONF_FAMILY_WINDOWS)
{
/* set DSCP/TOS */
int iptos = 0x10 /* IPTOS_LOWDELAY */;
//int iptos = 46; /* High Priority */
if(setsockopt(socket, IPPROTO_IP, IP_TOS, (char *)&iptos, sizeof(iptos)) != 0)
dbg_msg("socket", "Setting TOS on ipv6 failed: %d", errno);
{
dbg_msg("socket", "Setting TOS on ipv6 failed: %d", net_errno());
}
}
#endif
}
}

Expand Down Expand Up @@ -4439,7 +4448,8 @@ void os_locale_str(char *locale, size_t length)
dbg_assert(GetUserDefaultLocaleName(wide_buffer, std::size(wide_buffer)) > 0, "GetUserDefaultLocaleName failure");

const std::optional<std::string> buffer = windows_wide_to_utf8(wide_buffer);
str_copy(locale, buffer.value_or("en-US").c_str(), length);
dbg_assert(buffer.has_value(), "GetUserDefaultLocaleName returned invalid UTF-16");
str_copy(locale, buffer.value().c_str(), length);
#elif defined(CONF_PLATFORM_MACOS)
CFLocaleRef locale_ref = CFLocaleCopyCurrent();
CFStringRef locale_identifier_ref = static_cast<CFStringRef>(CFLocaleGetValue(locale_ref, kCFLocaleIdentifier));
Expand Down
Loading

0 comments on commit 81cc588

Please sign in to comment.