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 Oct 12, 2024
2 parents 95c892d + 08ec4dd commit 55d8a0d
Show file tree
Hide file tree
Showing 37 changed files with 523 additions and 275 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@ set(EXPECTED_DATA
countryflags/AL.png
countryflags/AM.png
countryflags/AO.png
countryflags/AQ.png
countryflags/AR.png
countryflags/AS.png
countryflags/AT.png
Expand Down
Binary file added data/countryflags/AQ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/countryflags/AZ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/countryflags/BY.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/countryflags/HN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/countryflags/MR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/countryflags/SS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions data/countryflags/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ AO
AI
== 660

#AQ
#== 10
AQ
== 10

AG
== 28
Expand Down
7 changes: 5 additions & 2 deletions scripts/android/cmake_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ if [ -z ${1+x} ]; then
printf "${COLOR_RED}%s${COLOR_RESET}\n" "Did not pass Android build type"
else
ANDROID_BUILD=$1
if [[ "${ANDROID_BUILD}" == "x64" ]]; then
ANDROID_BUILD="x86_64"
fi
printf "${COLOR_YELLOW}%s${COLOR_RESET}\n" "Android build type: ${ANDROID_BUILD}"
fi

Expand Down Expand Up @@ -168,7 +171,7 @@ if [[ "${ANDROID_BUILD}" == "x86" || "${ANDROID_BUILD}" == "all" ]]; then
PID_BUILD_X86=$!
fi

if [[ "${ANDROID_BUILD}" == "x86_64" || "${ANDROID_BUILD}" == "x64" || "${ANDROID_BUILD}" == "all" ]]; then
if [[ "${ANDROID_BUILD}" == "x86_64" || "${ANDROID_BUILD}" == "all" ]]; then
build_for_type x86_64 x86_64 x86_64-linux-android &
PID_BUILD_X86_64=$!
fi
Expand Down Expand Up @@ -236,7 +239,7 @@ if [[ "${ANDROID_BUILD}" == "x86" || "${ANDROID_BUILD}" == "all" ]]; then
copy_libs x86 x86
fi

if [[ "${ANDROID_BUILD}" == "x86_64" || "${ANDROID_BUILD}" == "x64" || "${ANDROID_BUILD}" == "all" ]]; then
if [[ "${ANDROID_BUILD}" == "x86_64" || "${ANDROID_BUILD}" == "all" ]]; then
copy_libs x86_64 x86_64
fi

Expand Down
22 changes: 16 additions & 6 deletions src/engine/client/favorites.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,16 @@ void CFavorites::Add(const NETADDR *pAddrs, int NumAddrs)
// other favorite.
for(int i = 0; i < NumAddrs; i++)
{
CEntry *pEntry = Entry(pAddrs[i]);
NETADDR Addr = pAddrs[i];
Addr.type &= ~(NETTYPE_TW7);
CEntry *pEntry = Entry(Addr);
if(pEntry == nullptr)
{
continue;
}
for(int j = 0; j < pEntry->m_NumAddrs; j++)
{
if(pEntry->m_aAddrs[j] == pAddrs[i])
if(pEntry->m_aAddrs[j] == Addr)
{
pEntry->m_aAddrs[j] = pEntry->m_aAddrs[pEntry->m_NumAddrs - 1];
pEntry->m_NumAddrs -= 1;
Expand All @@ -162,8 +164,10 @@ void CFavorites::Add(const NETADDR *pAddrs, int NumAddrs)
NewEntry.m_NumAddrs = std::min(NumAddrs, (int)std::size(NewEntry.m_aAddrs));
for(int i = 0; i < NewEntry.m_NumAddrs; i++)
{
NewEntry.m_aAddrs[i] = pAddrs[i];
m_ByAddr[pAddrs[i]] = m_vEntries.size();
NETADDR Addr = pAddrs[i];
Addr.type &= ~(NETTYPE_TW7);
NewEntry.m_aAddrs[i] = Addr;
m_ByAddr[Addr] = m_vEntries.size();
}
NewEntry.m_AllowPing = false;
m_vEntries.push_back(NewEntry);
Expand Down Expand Up @@ -207,7 +211,10 @@ void CFavorites::AllEntries(const CEntry **ppEntries, int *pNumEntries)

CFavorites::CEntry *CFavorites::Entry(const NETADDR &Addr)
{
auto Entry = m_ByAddr.find(Addr);
NETADDR AddrAnyProtocol = Addr;
AddrAnyProtocol.type &= ~(NETTYPE_TW7);

auto Entry = m_ByAddr.find(AddrAnyProtocol);
if(Entry == m_ByAddr.end())
{
return nullptr;
Expand All @@ -217,7 +224,10 @@ CFavorites::CEntry *CFavorites::Entry(const NETADDR &Addr)

const CFavorites::CEntry *CFavorites::Entry(const NETADDR &Addr) const
{
auto Entry = m_ByAddr.find(Addr);
NETADDR AddrAnyProtocol = Addr;
AddrAnyProtocol.type &= ~(NETTYPE_TW7);

auto Entry = m_ByAddr.find(AddrAnyProtocol);
if(Entry == m_ByAddr.end())
{
return nullptr;
Expand Down
11 changes: 7 additions & 4 deletions src/engine/server/databases/mysql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,11 @@ bool CMysqlConnection::PrepareStatement(const char *pStmt, char *pError, int Err
unsigned NumParameters = mysql_stmt_param_count(m_pStmt.get());
m_vStmtParameters.resize(NumParameters);
m_vStmtParameterExtras.resize(NumParameters);
mem_zero(&m_vStmtParameters[0], sizeof(m_vStmtParameters[0]) * m_vStmtParameters.size());
mem_zero(&m_vStmtParameterExtras[0], sizeof(m_vStmtParameterExtras[0]) * m_vStmtParameterExtras.size());
if(NumParameters)
{
mem_zero(m_vStmtParameters.data(), sizeof(m_vStmtParameters[0]) * m_vStmtParameters.size());
mem_zero(m_vStmtParameterExtras.data(), sizeof(m_vStmtParameterExtras[0]) * m_vStmtParameterExtras.size());
}
return false;
}

Expand Down Expand Up @@ -443,7 +446,7 @@ bool CMysqlConnection::Step(bool *pEnd, char *pError, int ErrorSize)
if(m_NewQuery)
{
m_NewQuery = false;
if(mysql_stmt_bind_param(m_pStmt.get(), &m_vStmtParameters[0]))
if(mysql_stmt_bind_param(m_pStmt.get(), m_vStmtParameters.data()))
{
StoreErrorStmt("bind_param");
str_copy(pError, m_aErrorDetail, ErrorSize);
Expand Down Expand Up @@ -474,7 +477,7 @@ bool CMysqlConnection::ExecuteUpdate(int *pNumUpdated, char *pError, int ErrorSi
if(m_NewQuery)
{
m_NewQuery = false;
if(mysql_stmt_bind_param(m_pStmt.get(), &m_vStmtParameters[0]))
if(mysql_stmt_bind_param(m_pStmt.get(), m_vStmtParameters.data()))
{
StoreErrorStmt("bind_param");
str_copy(pError, m_aErrorDetail, ErrorSize);
Expand Down
23 changes: 9 additions & 14 deletions src/engine/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ CServer::CServer()
m_SameMapReload = false;
m_ReloadedWhenEmpty = false;
m_aCurrentMap[0] = '\0';
m_pCurrentMapName = m_aCurrentMap;

m_RconClientId = IServer::RCON_CID_SERV;
m_RconAuthLevel = AUTHED_ADMIN;
Expand Down Expand Up @@ -2541,14 +2542,7 @@ void CServer::PumpNetwork(bool PacketWaiting)

const char *CServer::GetMapName() const
{
// get the name of the map without his path
const char *pMapShortName = &Config()->m_SvMap[0];
for(int i = 0; i < str_length(Config()->m_SvMap) - 1; i++)
{
if(Config()->m_SvMap[i] == '/' || Config()->m_SvMap[i] == '\\')
pMapShortName = &Config()->m_SvMap[i + 1];
}
return pMapShortName;
return m_pCurrentMapName;
}

void CServer::ChangeMap(const char *pMap)
Expand Down Expand Up @@ -2587,6 +2581,7 @@ int CServer::LoadMap(const char *pMapName)
Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "server", aBufMsg);

str_copy(m_aCurrentMap, pMapName);
m_pCurrentMapName = fs_filename(m_aCurrentMap);

// load complete map into memory for download
{
Expand Down Expand Up @@ -3398,13 +3393,13 @@ void CServer::DemoRecorder_HandleAutoStart()
char aTimestamp[20];
str_timestamp(aTimestamp, sizeof(aTimestamp));
char aFilename[IO_MAX_PATH_LENGTH];
str_format(aFilename, sizeof(aFilename), "demos/auto/server/%s_%s.demo", m_aCurrentMap, aTimestamp);
str_format(aFilename, sizeof(aFilename), "demos/auto/server/%s_%s.demo", GetMapName(), aTimestamp);
m_aDemoRecorder[RECORDER_AUTO].Start(
Storage(),
m_pConsole,
aFilename,
GameServer()->NetVersion(),
m_aCurrentMap,
GetMapName(),
m_aCurrentMapSha256[MAP_TYPE_SIX],
m_aCurrentMapCrc[MAP_TYPE_SIX],
"server",
Expand All @@ -3428,7 +3423,7 @@ void CServer::SaveDemo(int ClientId, float Time)
if(IsRecording(ClientId))
{
char aNewFilename[IO_MAX_PATH_LENGTH];
str_format(aNewFilename, sizeof(aNewFilename), "demos/%s_%s_%05.2f.demo", m_aCurrentMap, m_aClients[ClientId].m_aName, Time);
str_format(aNewFilename, sizeof(aNewFilename), "demos/%s_%s_%05.2f.demo", GetMapName(), m_aClients[ClientId].m_aName, Time);
m_aDemoRecorder[ClientId].Stop(IDemoRecorder::EStopMode::KEEP_FILE, aNewFilename);
}
}
Expand All @@ -3438,13 +3433,13 @@ void CServer::StartRecord(int ClientId)
if(Config()->m_SvPlayerDemoRecord)
{
char aFilename[IO_MAX_PATH_LENGTH];
str_format(aFilename, sizeof(aFilename), "demos/%s_%d_%d_tmp.demo", m_aCurrentMap, m_NetServer.Address().port, ClientId);
str_format(aFilename, sizeof(aFilename), "demos/%s_%d_%d_tmp.demo", GetMapName(), m_NetServer.Address().port, ClientId);
m_aDemoRecorder[ClientId].Start(
Storage(),
Console(),
aFilename,
GameServer()->NetVersion(),
m_aCurrentMap,
GetMapName(),
m_aCurrentMapSha256[MAP_TYPE_SIX],
m_aCurrentMapCrc[MAP_TYPE_SIX],
"server",
Expand Down Expand Up @@ -3506,7 +3501,7 @@ void CServer::ConRecord(IConsole::IResult *pResult, void *pUser)
pServer->Console(),
aFilename,
pServer->GameServer()->NetVersion(),
pServer->m_aCurrentMap,
pServer->GetMapName(),
pServer->m_aCurrentMapSha256[MAP_TYPE_SIX],
pServer->m_aCurrentMapCrc[MAP_TYPE_SIX],
"server",
Expand Down
1 change: 1 addition & 0 deletions src/engine/server/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ class CServer : public IServer
};

char m_aCurrentMap[IO_MAX_PATH_LENGTH];
const char *m_pCurrentMapName;
SHA256_DIGEST m_aCurrentMapSha256[NUM_MAP_TYPES];
unsigned m_aCurrentMapCrc[NUM_MAP_TYPES];
unsigned char *m_apCurrentMapData[NUM_MAP_TYPES];
Expand Down
2 changes: 1 addition & 1 deletion src/engine/shared/config_variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ MACRO_CONFIG_INT(SvSpecFrequency, sv_pause_frequency, 1, 0, 9999, CFGFLAG_SERVER
MACRO_CONFIG_INT(SvInvite, sv_invite, 1, 0, 1, CFGFLAG_SERVER, "Whether players can invite other players to teams")
MACRO_CONFIG_INT(SvInviteFrequency, sv_invite_frequency, 1, 0, 9999, CFGFLAG_SERVER, "The minimum allowed delay between invites")
MACRO_CONFIG_INT(SvTeleOthersAuthLevel, sv_tele_others_auth_level, 1, 1, 3, CFGFLAG_SERVER, "The auth level you need to tele others")
MACRO_CONFIG_INT(SvRegionalRankings, sv_regional_rankings, 1, 0, 1, CFGFLAG_SERVER, "Display regional rankings in /rank and /top5")
MACRO_CONFIG_INT(SvRegionalRankings, sv_regional_rankings, 1, 0, 1, CFGFLAG_SERVER, "Display regional rankings in /rank, /top5 and /top5team")

MACRO_CONFIG_INT(SvEmotionalTees, sv_emotional_tees, 1, -1, 1, CFGFLAG_SERVER, "Whether eye change of tees is enabled with emoticons = 1, not = 0, -1 not at all")
MACRO_CONFIG_INT(SvEmoticonMsDelay, sv_emoticon_ms_delay, 3000, 20, 999999999, CFGFLAG_SERVER, "The time in ms a player has to wait before allowing the next over-head emoticons")
Expand Down
2 changes: 1 addition & 1 deletion src/engine/shared/netban.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class CNetBan
private:
enum
{
MAX_BANS = 1024,
MAX_BANS = 2048,
};

CBan<CDataType> *m_aapHashList[HashCount][256];
Expand Down
25 changes: 2 additions & 23 deletions src/game/client/components/ghost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,20 +388,8 @@ void CGhost::InitRenderInfos(CGhostItem *pGhost)
char aSkinName[MAX_SKIN_LENGTH];
IntsToStr(&pGhost->m_Skin.m_Skin0, 6, aSkinName, std::size(aSkinName));
CTeeRenderInfo *pRenderInfo = &pGhost->m_RenderInfo;

pRenderInfo->Apply(m_pClient->m_Skins.Find(aSkinName));
pRenderInfo->m_CustomColoredSkin = pGhost->m_Skin.m_UseCustomColor;
if(pGhost->m_Skin.m_UseCustomColor)
{
pRenderInfo->m_ColorBody = color_cast<ColorRGBA>(ColorHSLA(pGhost->m_Skin.m_ColorBody).UnclampLighting(ColorHSLA::DARKEST_LGT));
pRenderInfo->m_ColorFeet = color_cast<ColorRGBA>(ColorHSLA(pGhost->m_Skin.m_ColorFeet).UnclampLighting(ColorHSLA::DARKEST_LGT));
}
else
{
pRenderInfo->m_ColorBody = ColorRGBA(1, 1, 1);
pRenderInfo->m_ColorFeet = ColorRGBA(1, 1, 1);
}

pRenderInfo->ApplyColors(pGhost->m_Skin.m_UseCustomColor, pGhost->m_Skin.m_ColorBody, pGhost->m_Skin.m_ColorFeet);
pRenderInfo->m_Size = 64;
}

Expand Down Expand Up @@ -687,16 +675,7 @@ void CGhost::OnRefreshSkins()
return;
char aSkinName[MAX_SKIN_LENGTH];
IntsToStr(&Ghost.m_Skin.m_Skin0, 6, aSkinName, std::size(aSkinName));
CTeeRenderInfo *pRenderInfo = &Ghost.m_RenderInfo;
if(aSkinName[0] != '\0')
{
pRenderInfo->Apply(m_pClient->m_Skins.Find(aSkinName));
}
else
{
pRenderInfo->m_OriginalRenderSkin.Reset();
pRenderInfo->m_ColorableRenderSkin.Reset();
}
Ghost.m_RenderInfo.Apply(m_pClient->m_Skins.Find(aSkinName));
};

for(auto &Ghost : m_aActiveGhosts)
Expand Down
12 changes: 1 addition & 11 deletions src/game/client/components/menus_browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1846,17 +1846,7 @@ CTeeRenderInfo CMenus::GetTeeRenderInfo(vec2 Size, const char *pSkinName, bool C
{
CTeeRenderInfo TeeInfo;
TeeInfo.Apply(m_pClient->m_Skins.Find(pSkinName));
TeeInfo.m_CustomColoredSkin = CustomSkinColors;
if(CustomSkinColors)
{
TeeInfo.m_ColorBody = color_cast<ColorRGBA>(ColorHSLA(CustomSkinColorBody).UnclampLighting(ColorHSLA::DARKEST_LGT));
TeeInfo.m_ColorFeet = color_cast<ColorRGBA>(ColorHSLA(CustomSkinColorFeet).UnclampLighting(ColorHSLA::DARKEST_LGT));
}
else
{
TeeInfo.m_ColorBody = ColorRGBA(1.0f, 1.0f, 1.0f);
TeeInfo.m_ColorFeet = ColorRGBA(1.0f, 1.0f, 1.0f);
}
TeeInfo.ApplyColors(CustomSkinColors, CustomSkinColorBody, CustomSkinColorFeet);
TeeInfo.m_Size = minimum(Size.x, Size.y);
return TeeInfo;
}
Expand Down
Loading

0 comments on commit 55d8a0d

Please sign in to comment.