From ee266f24de1b389990153d2f89154bd942d4fa63 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Fri, 20 Mar 2020 10:18:05 +0100 Subject: [PATCH 1/9] Do not spam team messages on solo runs --- src/game/server/teams.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/server/teams.cpp b/src/game/server/teams.cpp index d526cf71..b0f606a6 100644 --- a/src/game/server/teams.cpp +++ b/src/game/server/teams.cpp @@ -115,7 +115,7 @@ void CGameTeams::OnCharacterStart(int ClientID) } } - if(g_Config.m_SvTeam < 3 && g_Config.m_SvTeamMaxSize != 2 && g_Config.m_SvPauseable) + if(g_Config.m_SvTeam < 3 && g_Config.m_SvTeamMaxSize != 2 && g_Config.m_SvPauseable && m_MembersCount[m_Core.Team(ClientID)] > 1) { for(int i = 0; i < MAX_CLIENTS; ++i) { From a6f5861d9ab396aae0df40435a2bf120ba9f9c8f Mon Sep 17 00:00:00 2001 From: fokkonaut <35420825+fokkonaut@users.noreply.github.com> Date: Tue, 31 Mar 2020 03:07:38 +0200 Subject: [PATCH 2/9] fix compiling --- src/game/server/ddracecommands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/server/ddracecommands.cpp b/src/game/server/ddracecommands.cpp index 6eeffa17..c4081be4 100644 --- a/src/game/server/ddracecommands.cpp +++ b/src/game/server/ddracecommands.cpp @@ -381,7 +381,7 @@ void CGameContext::Mute(const NETADDR *pAddr, int Secs, const char *pDisplayName if (pReason[0]) str_format(aBuf, sizeof aBuf, "'%s' has been muted for %d seconds (%s)", pDisplayName, Secs, pReason); else - str_format(aBuf, sizeof aBuf, "'%s' has been muted for %d seconds", pDisplayName, Secs, pReason); + str_format(aBuf, sizeof aBuf, "'%s' has been muted for %d seconds", pDisplayName, Secs); SendChat(-1, CHAT_ALL, -1, aBuf); } From 15f589f2d3b907ebbd032d715a65831cfd2aa2cf Mon Sep 17 00:00:00 2001 From: trafilaw Date: Sat, 4 Apr 2020 15:02:31 +0200 Subject: [PATCH 3/9] Add rules --- src/engine/shared/config_variables.h | 15 ++++++++++++++ src/game/server/ddracechat.h | 1 + src/game/server/gamecontext.cpp | 31 ++++++++++++++++++++++++++++ src/game/server/gamecontext.h | 1 + 4 files changed, 48 insertions(+) diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 8addae2f..e83cca55 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -188,6 +188,21 @@ MACRO_CONFIG_INT(SvChatThreshold, sv_chat_threshold, 1000, 50, 10000, CFGFLAG_SE MACRO_CONFIG_INT(SvSpamMuteDuration, sv_spam_mute_duration, 60, 0, 3600, CFGFLAG_SERVER, "how many seconds to mute, if player triggers mute on spam. 0 = off") MACRO_CONFIG_INT(SvShutdownWhenEmpty, sv_shutdown_when_empty, 0, 0, 1, CFGFLAG_SERVER, "Shutdown server as soon as no one is on it anymore") +// rules + +MACRO_CONFIG_INT(SvDDRaceRules, sv_ddrace_rules, 1, 0, 1, CFGFLAG_SERVER, "Whether the default mod rules are displayed or not") +MACRO_CONFIG_STR(SvRulesLine1, sv_rules_line1, 128, "", CFGFLAG_SERVER, "Rules line 1") +MACRO_CONFIG_STR(SvRulesLine2, sv_rules_line2, 128, "", CFGFLAG_SERVER, "Rules line 2") +MACRO_CONFIG_STR(SvRulesLine3, sv_rules_line3, 128, "", CFGFLAG_SERVER, "Rules line 3") +MACRO_CONFIG_STR(SvRulesLine4, sv_rules_line4, 128, "", CFGFLAG_SERVER, "Rules line 4") +MACRO_CONFIG_STR(SvRulesLine5, sv_rules_line5, 128, "", CFGFLAG_SERVER, "Rules line 5") +MACRO_CONFIG_STR(SvRulesLine6, sv_rules_line6, 128, "", CFGFLAG_SERVER, "Rules line 6") +MACRO_CONFIG_STR(SvRulesLine7, sv_rules_line7, 128, "", CFGFLAG_SERVER, "Rules line 7") +MACRO_CONFIG_STR(SvRulesLine8, sv_rules_line8, 128, "", CFGFLAG_SERVER, "Rules line 8") +MACRO_CONFIG_STR(SvRulesLine9, sv_rules_line9, 128, "", CFGFLAG_SERVER, "Rules line 9") +MACRO_CONFIG_STR(SvRulesLine10, sv_rules_line10, 128, "", CFGFLAG_SERVER, "Rules line 10") + + // netlimit MACRO_CONFIG_INT(SvNetlimit, sv_netlimit, 0, 0, 10000, CFGFLAG_SERVER, "Netlimit: Maximum amount of traffic a client is allowed to use (in kb/s)") MACRO_CONFIG_INT(SvNetlimitAlpha, sv_netlimit_alpha, 50, 1, 100, CFGFLAG_SERVER, "Netlimit: Alpha of Exponention moving average") diff --git a/src/game/server/ddracechat.h b/src/game/server/ddracechat.h index 6a68a527..1cac5431 100644 --- a/src/game/server/ddracechat.h +++ b/src/game/server/ddracechat.h @@ -28,6 +28,7 @@ CHAT_COMMAND("top5team", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTeamTop5, this, " CHAT_COMMAND("top5", "?i[rank to start with]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTop5, this, "Shows five ranks of the ladder beginning with rank i (1 by default)") CHAT_COMMAND("points", "?r[player name]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConPoints, this, "Shows the global points of a player beginning with name r (your rank by default)") CHAT_COMMAND("top5points", "?i[number]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTopPoints, this, "Shows five points of the global point ladder beginning with rank i (1 by default)") +CHAT_COMMAND("rules", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConRules, this, "Shows the server rules") CHAT_COMMAND("team", "?i[id]", CFGFLAG_CHAT|CFGFLAG_SERVER, ConJoinTeam, this, "Lets you join team i (shows your team if left blank)") CHAT_COMMAND("lock", "?i['0'|'1']", CFGFLAG_CHAT|CFGFLAG_SERVER, ConLockTeam, this, "Lock team so no-one else can join it") diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index a3a9ea9d..401d4aef 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -2028,6 +2028,37 @@ void CGameContext::ConRemoveVote(IConsole::IResult *pResult, void *pUserData) pSelf->m_NumVoteOptions = NumVoteOptions; } +void CGameContext::ConRules(IConsole::IResult *pResult, void *pUserData) +{ + CGameContext *pSelf = (CGameContext *) pUserData; + bool Printed = false; + if (g_Config.m_SvDDRaceRules) + { + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules", + "Be nice."); + Printed = true; + } + #define _RL(n) g_Config.m_SvRulesLine ## n + char *pRuleLines[] = { + _RL(1), _RL(2), _RL(3), _RL(4), _RL(5), + _RL(6), _RL(7), _RL(8), _RL(9), _RL(10), + }; + for(unsigned i = 0; i < sizeof(pRuleLines) / sizeof(pRuleLines[0]); i++) + { + if(pRuleLines[i][0]) + { + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, + "rules", pRuleLines[i]); + Printed = true; + } + } + if (!Printed) + { + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "rules", + "No Rules Defined, Kill em all!!"); + } +} + void CGameContext::ConClearVotes(IConsole::IResult *pResult, void *pUserData) { CGameContext *pSelf = (CGameContext *)pUserData; diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h index 389c7c1a..b864ae4a 100644 --- a/src/game/server/gamecontext.h +++ b/src/game/server/gamecontext.h @@ -100,6 +100,7 @@ class CGameContext : public IGameServer static void ConchainGameinfoUpdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); static void NewCommandHook(const CCommandManager::CCommand *pCommand, void *pContext); static void RemoveCommandHook(const CCommandManager::CCommand *pCommand, void *pContext); + static void ConRules(IConsole::IResult *pResult, void *pUserData); static void LegacyCommandCallback(IConsole::IResult *pResult, void *pContext); void RegisterLegacyDDRaceCommands(); From b1dfc3f169954bea5d83e22d01b0bbc62ca2c27c Mon Sep 17 00:00:00 2001 From: trafilaw Date: Mon, 6 Apr 2020 23:55:41 +0200 Subject: [PATCH 4/9] Add vote mute --- src/game/ddracecommands.h | 3 + src/game/server/ddracecommands.cpp | 142 +++++++++++++++++++++++++++++ src/game/server/gamecontext.cpp | 14 +++ src/game/server/gamecontext.h | 6 ++ 4 files changed, 165 insertions(+) diff --git a/src/game/ddracecommands.h b/src/game/ddracecommands.h index 032dd7bc..e2af4700 100644 --- a/src/game/ddracecommands.h +++ b/src/game/ddracecommands.h @@ -41,6 +41,9 @@ CONSOLE_COMMAND("list", "?s[filter]", CFGFLAG_CHAT, ConList, this, "List connect CONSOLE_COMMAND("set_team_ddr", "v[id] ?i[team]", CFGFLAG_SERVER, ConSetDDRTeam, this, "Set ddrace team of a player") CONSOLE_COMMAND("uninvite", "v[id] ?i[team]", CFGFLAG_SERVER, ConUninvite, this, "Uninvite player from team") +CONSOLE_COMMAND("vote_mute", "v[id] i[seconds]", CFGFLAG_SERVER, ConVoteMute, this, "Remove v's right to vote for i seconds") +CONSOLE_COMMAND("vote_unmute", "v[id]", CFGFLAG_SERVER, ConVoteUnmute, this, "Give back v's right to vote.") +CONSOLE_COMMAND("vote_mutes", "", CFGFLAG_SERVER, ConVoteMutes, this, "List the current active vote mutes.") CONSOLE_COMMAND("mute", "", CFGFLAG_SERVER, ConMute, this, "") CONSOLE_COMMAND("muteid", "v[id] i[seconds] ?r[reason]", CFGFLAG_SERVER, ConMuteID, this, "") CONSOLE_COMMAND("muteip", "s[ip] i[seconds] ?r[reason]", CFGFLAG_SERVER, ConMuteIP, this, "") diff --git a/src/game/server/ddracecommands.cpp b/src/game/server/ddracecommands.cpp index c4081be4..9b5abd95 100644 --- a/src/game/server/ddracecommands.cpp +++ b/src/game/server/ddracecommands.cpp @@ -340,6 +340,148 @@ void CGameContext::ConForcePause(IConsole::IResult *pResult, void *pUserData) pPlayer->ForcePause(Seconds); } + +bool CGameContext::TryVoteMute(const NETADDR *pAddr, int Secs) +{ + // find a matching vote mute for this ip, update expiration time if found + for(int i = 0; i < m_NumVoteMutes; i++) + { + if(net_addr_comp_noport(&m_aVoteMutes[i].m_Addr, pAddr) == 0) + { + m_aVoteMutes[i].m_Expire = Server()->Tick() + + Secs * Server()->TickSpeed(); + return true; + } + } + + // nothing to update create new one + if(m_NumVoteMutes < MAX_VOTE_MUTES) + { + m_aVoteMutes[m_NumVoteMutes].m_Addr = *pAddr; + m_aVoteMutes[m_NumVoteMutes].m_Expire = Server()->Tick() + + Secs * Server()->TickSpeed(); + m_NumVoteMutes++; + return true; + } + // no free slot found + Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "votemute", "vote mute array is full"); + return false; +} + +bool CGameContext::VoteMute(const NETADDR *pAddr, int Secs, const char *pDisplayName, int AuthedID) +{ + if (!TryVoteMute(pAddr, Secs)) + return false; + + if(!pDisplayName) + return true; + + char aBuf[128]; + str_format(aBuf, sizeof aBuf, "'%s' banned '%s' for %d seconds from voting.", + Server()->ClientName(AuthedID), pDisplayName, Secs); + Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "votemute", aBuf); + return true; +} + +bool CGameContext::VoteUnmute(const NETADDR *pAddr, const char *pDisplayName, int AuthedID) +{ + for(int i = 0; i < m_NumVoteMutes; i++) + { + if(net_addr_comp_noport(&m_aVoteMutes[i].m_Addr, pAddr) == 0) + { + m_NumVoteMutes--; + m_aVoteMutes[i] = m_aVoteMutes[m_NumVoteMutes]; + if(pDisplayName) + { + char aBuf[128]; + str_format(aBuf, sizeof aBuf, "'%s' unbanned '%s' from voting.", + Server()->ClientName(AuthedID), pDisplayName); + Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "voteunmute", aBuf); + } + return true; + } + } + return false; +} + + +void CGameContext::ConVoteMute(IConsole::IResult *pResult, void *pUserData) +{ + CGameContext *pSelf = (CGameContext *)pUserData; + int Victim = pResult->GetVictim(); + + if(Victim < 0 || Victim > MAX_CLIENTS || !pSelf->m_apPlayers[Victim]) + { + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "votemute", "Client ID not found"); + return; + } + + NETADDR Addr; + pSelf->Server()->GetClientAddr(Victim, &Addr); + + int Seconds = clamp(pResult->GetInteger(1), 1, 86400); + bool Found = pSelf->VoteMute(&Addr, Seconds, pSelf->Server()->ClientName(Victim), pResult->m_ClientID); + + if(Found) + { + char aBuf[128]; + str_format(aBuf, sizeof aBuf, "'%s' banned '%s' for %d seconds from voting.", + pSelf->Server()->ClientName(pResult->m_ClientID), pSelf->Server()->ClientName(Victim), Seconds); + pSelf->SendChat(-1, CHAT_ALL, -1, aBuf); + } +} + +void CGameContext::ConVoteUnmute(IConsole::IResult *pResult, void *pUserData) +{ + CGameContext *pSelf = (CGameContext *)pUserData; + int Victim = pResult->GetVictim(); + + if(Victim < 0 || Victim > MAX_CLIENTS || !pSelf->m_apPlayers[Victim]) + { + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "voteunmute", "Client ID not found"); + return; + } + + NETADDR Addr; + pSelf->Server()->GetClientAddr(Victim, &Addr); + + bool Found = pSelf->VoteUnmute(&Addr, pSelf->Server()->ClientName(Victim), pResult->m_ClientID); + if(Found) + { + char aBuf[128]; + str_format(aBuf, sizeof aBuf, "'%s' unbanned '%s' from voting.", + pSelf->Server()->ClientName(pResult->m_ClientID), pSelf->Server()->ClientName(Victim)); + pSelf->SendChat(-1, CHAT_ALL, -1, aBuf); + } +} + +void CGameContext::ConVoteMutes(IConsole::IResult *pResult, void *pUserData) +{ + CGameContext *pSelf = (CGameContext *) pUserData; + + if (pSelf->m_NumVoteMutes <= 0) + { + // Just to make sure. + pSelf->m_NumVoteMutes = 0; + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "votemutes", + "There are no active vote mutes."); + return; + } + + char aIpBuf[64]; + char aBuf[128]; + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "votemutes", + "Active vote mutes:"); + for (int i = 0; i < pSelf->m_NumVoteMutes; i++) + { + net_addr_str(&pSelf->m_aVoteMutes[i].m_Addr, aIpBuf, sizeof(aIpBuf), false); + str_format(aBuf, sizeof aBuf, "%d: \"%s\", %d seconds left", i, + aIpBuf, (pSelf->m_aVoteMutes[i].m_Expire - pSelf->Server()->Tick()) / pSelf->Server()->TickSpeed()); + pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "votemutes", aBuf); + } +} + + bool CGameContext::TryMute(const NETADDR *pAddr, int Secs, const char *pReason) { // find a matching mute for this ip, update expiration time if found diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index a3a9ea9d..e92b8dad 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1225,6 +1225,20 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) pPlayer->m_LastVoteTry = Now; } + NETADDR Addr; + Server()->GetClientAddr(ClientID, &Addr); + int VoteMuted = 0; + for(int i = 0; i < m_NumVoteMutes && !VoteMuted; i++) + if(!net_addr_comp_noport(&Addr, &m_aVoteMutes[i].m_Addr)) + VoteMuted = (m_aVoteMutes[i].m_Expire - Server()->Tick()) / Server()->TickSpeed(); + if(VoteMuted > 0) + { + char aChatmsg[64]; + str_format(aChatmsg, sizeof(aChatmsg), "You are not permitted to vote for the next %d seconds.", VoteMuted); + SendChatTarget(ClientID, aChatmsg); + return; + } + char aChatmsg[512] = {0}; m_VoteType = VOTE_UNKNOWN; char aDesc[VOTE_DESC_LENGTH] = {0}; diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h index 389c7c1a..c9e02aee 100644 --- a/src/game/server/gamecontext.h +++ b/src/game/server/gamecontext.h @@ -348,6 +348,9 @@ class CGameContext : public IGameServer static void ConRescue(IConsole::IResult* pResult, void* pUserData); static void ConProtectedKill(IConsole::IResult* pResult, void* pUserData); + static void ConVoteMute(IConsole::IResult *pResult, void *pUserData); + static void ConVoteUnmute(IConsole::IResult *pResult, void *pUserData); + static void ConVoteMutes(IConsole::IResult *pResult, void *pUserData); static void ConMute(IConsole::IResult* pResult, void* pUserData); static void ConMuteID(IConsole::IResult* pResult, void* pUserData); static void ConMuteIP(IConsole::IResult* pResult, void* pUserData); @@ -384,6 +387,9 @@ class CGameContext : public IGameServer int m_NumVoteMutes; bool TryMute(const NETADDR *pAddr, int Secs, const char *pReason); void Mute(const NETADDR *pAddr, int Secs, const char *pDisplayName, const char *pReason = ""); + bool TryVoteMute(const NETADDR *pAddr, int Secs); + bool VoteMute(const NETADDR *pAddr, int Secs, const char *pDisplayName, int AuthedID); + bool VoteUnmute(const NETADDR *pAddr, const char *pDisplayName, int AuthedID); public: CLayers* Layers() { return &m_Layers; } From f800fdffbba680ff34cc48c758d7ba577a09c2aa Mon Sep 17 00:00:00 2001 From: trafilaw Date: Tue, 7 Apr 2020 18:19:10 +0200 Subject: [PATCH 5/9] Add sv_rcon_vote --- src/engine/shared/config_variables.h | 1 + src/game/server/gamecontext.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index 8addae2f..b57a6564 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -99,6 +99,7 @@ MACRO_CONFIG_STR(SvDnsblHost, sv_dnsbl_host, 128, "", CFGFLAG_SERVER, "Hostname MACRO_CONFIG_STR(SvDnsblKey, sv_dnsbl_key, 128, "", CFGFLAG_SERVER, "Optional Authentification Key for the specified DNSBL provider") MACRO_CONFIG_INT(SvDnsblVote, sv_dnsbl_vote, 0, 0, 1, CFGFLAG_SERVER, "Block votes by blacklisted addresses") MACRO_CONFIG_INT(SvDnsblBan, sv_dnsbl_ban, 0, 0, 1, CFGFLAG_SERVER, "Automatically ban blacklisted addresses") +MACRO_CONFIG_INT(SvRconVote, sv_rcon_vote, 0, 0, 1, CFGFLAG_SERVER, "Only allow authed clients to call votes") MACRO_CONFIG_STR(EcBindaddr, ec_bindaddr, 128, "localhost", CFGFLAG_SAVE|CFGFLAG_ECON, "Address to bind the external console to. Anything but 'localhost' is dangerous") MACRO_CONFIG_INT(EcPort, ec_port, 0, 0, 0, CFGFLAG_SAVE|CFGFLAG_ECON, "Port to use for the external console") diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index a3a9ea9d..c386e92b 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1200,6 +1200,12 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) int64 Now = Server()->Tick(); int64 TickSpeed = Server()->TickSpeed(); + if(g_Config.m_SvRconVote && !Server()->GetAuthedState(ClientID)) + { + SendChatTarget(ClientID, "You can only vote after logging in."); + return; + } + if (g_Config.m_SvDnsblVote && !m_pServer->DnsblWhite(ClientID)) { // blacklisted by dnsbl From 2db437bc5893cd9461194c2a3cec7a39fbefbaf9 Mon Sep 17 00:00:00 2001 From: Learath Date: Mon, 24 Feb 2020 01:34:13 +0300 Subject: [PATCH 6/9] Fix #2476 --- src/engine/shared/network.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/engine/shared/network.cpp b/src/engine/shared/network.cpp index d354f624..9d1ae0de 100644 --- a/src/engine/shared/network.cpp +++ b/src/engine/shared/network.cpp @@ -24,6 +24,13 @@ void CNetRecvUnpacker::Start(const NETADDR *pAddr, CNetConnection *pConnection, // TODO: rename this function int CNetRecvUnpacker::FetchChunk(CNetChunk *pChunk) { + // Don't bother with connections that already went offline + if(m_pConnection && m_pConnection->State() != NET_CONNSTATE_ONLINE) + { + Clear(); + return 0; + } + CNetChunkHeader Header; unsigned char *pEnd = m_Data.m_aChunkData + m_Data.m_DataSize; @@ -247,7 +254,7 @@ int CNetBase::UnpackPacket(unsigned char *pBuffer, int Size, CNetPacketConstruct pPacket->m_Token = (pBuffer[3] << 24) | (pBuffer[4] << 16) | (pBuffer[5] << 8) | pBuffer[6]; // TTTTTTTT TTTTTTTT TTTTTTTT TTTTTTTT pPacket->m_ResponseToken = NET_TOKEN_NONE; - + if(pPacket->m_Flags&NET_PACKETFLAG_COMPRESSION) pPacket->m_DataSize = Decompress(&pBuffer[NET_PACKETHEADERSIZE], pPacket->m_DataSize, pPacket->m_aChunkData, sizeof(pPacket->m_aChunkData)); else From c7c30274f8b7b866598ecba778e5d06f9dfe675b Mon Sep 17 00:00:00 2001 From: def Date: Sat, 11 Apr 2020 12:48:18 +0200 Subject: [PATCH 7/9] Fix Freetype warning --- CMakeLists.txt | 6 +++++- cmake/{FindOwnFreetype.cmake => FindFreetype.cmake} | 0 2 files changed, 5 insertions(+), 1 deletion(-) rename cmake/{FindOwnFreetype.cmake => FindFreetype.cmake} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8aa789e..68dcc4a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,10 @@ if(POLICY CMP0092) cmake_policy(SET CMP0092 NEW) endif() +if(POLICY CMP0017) + cmake_policy(SET CMP0017 NEW) +endif() + if(POLICY CMP0048) cmake_policy(SET CMP0048 NEW) if(VERSION_PATCH STREQUAL "0") @@ -315,7 +319,7 @@ if(NOT CMAKE_CROSSCOMPILING) endif() find_package(ZLIB) find_package(Crypto) -find_package(OwnFreetype) +find_package(Freetype) find_package(Git) find_package(GTest) if(MYSQL) diff --git a/cmake/FindOwnFreetype.cmake b/cmake/FindFreetype.cmake similarity index 100% rename from cmake/FindOwnFreetype.cmake rename to cmake/FindFreetype.cmake From ae343ef0681694e49a2735ad4912c42bb3db7c2e Mon Sep 17 00:00:00 2001 From: def Date: Tue, 5 May 2020 12:33:29 +0200 Subject: [PATCH 8/9] Fix Tick crash (fixes #73) --- src/game/server/gamecontext.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 160a9056..09d4cd3a 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -669,8 +669,13 @@ void CGameContext::OnTick() // send vote options ProgressVoteOptions(i); - m_apPlayers[i]->Tick(); - m_apPlayers[i]->PostTick(); + // ProgressVoteOptions calls SendMsg which can cause a player to be + // kicked on network problems, have to recheck + if(m_apPlayers[i]) + { + m_apPlayers[i]->Tick(); + m_apPlayers[i]->PostTick(); + } } } From 600b31e0281440244456d7fad76b82b7a718eed3 Mon Sep 17 00:00:00 2001 From: def Date: Tue, 8 Sep 2020 14:19:34 +0200 Subject: [PATCH 9/9] Update readme --- readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.md b/readme.md index 6cd8e8fd..a0c7fcc2 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,9 @@ [![DDraceNetwork](https://ddnet.tw/ddnet-small.png)](https://ddnet.tw) [![CircleCI Build Status](https://circleci.com/gh/ddnet/ddnet/tree/master.png)](https://circleci.com/gh/ddnet/ddnet7) +Not updated anymore since we have 0.7 client support in DDNet: https://github.com/ddnet/ddnet + +Old description: + DDNet work in progress for teeworlds version 0.7 (server only!) ported by fokkonaut from https://github.com/ddnet/ddnet to the latest teeworlds base http://github.com/teeworlds/teeworlds