From b8d38f7f4900a2a8c1b2bf187321a934559f7ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Mon, 13 Nov 2023 23:03:02 +0100 Subject: [PATCH 01/12] Fix server crash on DDTeam message with lower `sv_max_clients` When the `CGameContext::SendChatTeam` function is used to send a chat message to all members of a DDTeam (e.g. on completed /swap chat command), it was not checked whether the target players are online but only whether they belong to the specified team according to the teams core. However, the default team for unconnected/cleared players is 0 in the teams core, which is the same for players in team 0, so chat messages were being sent to client IDs not corresponding to connected clients when chat messages where supposed to be sent to players in team 0. This was causing the server to crash with the assertion error "erroneous client id" specifically when the server is started with `sv_max_clients` being less than the default, maximum 64. Closes #7450. --- src/game/server/gamecontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 9263180149b..e1dac4d9c36 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -522,7 +522,7 @@ void CGameContext::SendChatTarget(int To, const char *pText, int Flags) void CGameContext::SendChatTeam(int Team, const char *pText) { for(int i = 0; i < MAX_CLIENTS; i++) - if(((CGameControllerDDRace *)m_pController)->m_Teams.m_Core.Team(i) == Team) + if(m_apPlayers[i] != nullptr && ((CGameControllerDDRace *)m_pController)->m_Teams.m_Core.Team(i) == Team) SendChatTarget(i, pText); } From 361f3121a95481ac3c213a8dd40b8f1737447b82 Mon Sep 17 00:00:00 2001 From: ByFox Date: Tue, 14 Nov 2023 13:29:42 +0500 Subject: [PATCH 02/12] Update russian.txt --- data/languages/russian.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/data/languages/russian.txt b/data/languages/russian.txt index 5047ddee685..1270cd746b0 100644 --- a/data/languages/russian.txt +++ b/data/languages/russian.txt @@ -18,6 +18,7 @@ # unban 2023-03-10 21:50:50 # eblan 2023-08-07 14:27:00 # kaban 2023-9-21 19:00:00 +# ByFox 2023-11-14 11:24:00 ##### /authors ##### ##### translated strings ##### @@ -614,7 +615,7 @@ DDNet Client needs to be restarted to complete update! == Перезапустите DDNet Client для завершения обновления! Please use a different filename -== +== Пожалуйста, используйте другое имя файла Show others == Показывать остальных @@ -1752,16 +1753,16 @@ Activate all == Активировать все Deactivate all -== +== Отключить все Enable ghost -== +== Включить привидение Only save improvements -== +== Сохранять только улучшения Regular background color -== +== Обычный цвет фона Entities background color -== +== Цвет фона сущностей From c97c39ad1e8747212517216580d60db3e705f0a4 Mon Sep 17 00:00:00 2001 From: Pavukoplov Date: Tue, 14 Nov 2023 13:03:58 +0300 Subject: [PATCH 03/12] Update Belarusian translation for 17.4 --- data/languages/belarusian.txt | 39 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/data/languages/belarusian.txt b/data/languages/belarusian.txt index f03d6037635..41c9074a1fc 100644 --- a/data/languages/belarusian.txt +++ b/data/languages/belarusian.txt @@ -5,6 +5,7 @@ # Chill & PoKeMoN 2023-03-31 16:00:00 # Chill & PoKeMoN 2023-07-02 00:54:00 # Chill [TD] & PoKeMoN [TD] 2023-09-22 17:49:00 +# Chill [TD] & PoKeMoN [TD] 2023-11-14 12:42:00 # ##### /authors ##### @@ -796,7 +797,7 @@ Are you sure that you want to remove the clan '%s' from your friends list? == Вы ўпэўненыя што хочаце выдаліць клан '%s' са спіса вашых сяброў? Please use a different filename -== +== Калі ласка, выкарыстайце іншае імя файла File already exists, do you want to overwrite it? == Файл ужо існуе, ці вы хочаце перазапісаць яго? @@ -1699,56 +1700,56 @@ Moved ingame == Перамешчаны ў гульні Error playing demo -== +== Памылка прайгравання дэма Some map images could not be loaded. Check the local console for details. -== +== Некаторыя відарысы карты немагчыма спампаваць. Для атрымання дэталей праверце лакальную кансоль. Some map sounds could not be loaded. Check the local console for details. -== +== Некаторыя гукі карты немагчыма спампаваць. Для атрымання дэталей праверце лакальную кансоль. Loading menu themes -== +== Спампоўка тэм меню Render complete -== +== Рэндэр завершаны Videos directory -== +== Тэчка відэа Video was saved to '%s' -== +== Відэа было захавана ў '%s' No demo selected -== +== Дэма не выбрана Created -== +== Створана Netversion -== +== Сеткавая версія [Demo details] map not included -== +== карта не ўключана Ghosts directory -== +== Тэчка прывідаў Activate all -== +== Актываваць усе Deactivate all -== +== Дэактываваць усе Enable ghost -== +== Уключыць прывід Only save improvements -== +== Захоўваць толькі паляпшэнні Regular background color -== +== Колер звычайнага фону Entities background color -== +== Колер фону энтыты From 7c155146964277e9cdbb4e23e900d9597e2195e9 Mon Sep 17 00:00:00 2001 From: Axel Vestin Date: Tue, 14 Nov 2023 21:17:07 +0100 Subject: [PATCH 04/12] Use Escape to cancel OP_SCALE envelope --- src/game/editor/editor.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 99014915118..fe459343e87 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -373,7 +373,7 @@ int CEditor::UiDoValueSelector(void *pID, CUIRect *pRect, const char *pLabel, in s_TextMode = false; } - if(Input()->KeyIsPressed(KEY_ESCAPE)) + if(UI()->ConsumeHotkey(CUI::HOTKEY_ESCAPE)) { UI()->DisableMouseLock(); UI()->SetActiveItem(nullptr); @@ -6874,7 +6874,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View) { s_Operation = OP_NONE; } - else if(UI()->MouseButton(1)) + else if(UI()->MouseButton(1) || UI()->ConsumeHotkey(CUI::HOTKEY_ESCAPE)) { for(size_t k = 0; k < m_vSelectedEnvelopePoints.size(); k++) { @@ -7199,7 +7199,7 @@ void CEditor::RenderMenubar(CUIRect MenuBar) UI()->DoLabel(&Info, aBuf, 10.0f, TEXTALIGN_MR); static int s_CloseButton = 0; - if(DoButton_Editor(&s_CloseButton, "×", 0, &Close, 0, "Exits from the editor") || (m_Dialog == DIALOG_NONE && !UI()->IsPopupOpen() && !m_PopupEventActivated && Input()->KeyPress(KEY_ESCAPE))) + if(DoButton_Editor(&s_CloseButton, "×", 0, &Close, 0, "Exits from the editor")) { OnClose(); g_Config.m_ClEditor = 0; @@ -7460,6 +7460,12 @@ void CEditor::Render() UI()->RenderPopupMenus(); FreeDynamicPopupMenus(); + if(m_Dialog == DIALOG_NONE && !m_PopupEventActivated && UI()->ConsumeHotkey(CUI::HOTKEY_ESCAPE)) + { + OnClose(); + g_Config.m_ClEditor = 0; + } + // The tooltip can be set in popup menus so we have to render the tooltip after the popup menus. if(m_GuiActive) RenderTooltip(TooltipRect); From 9e27a5a1078d7c318f949cbb6349b45d2c0439e5 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Wed, 15 Nov 2023 12:11:58 +0100 Subject: [PATCH 05/12] Fix unused variabled m_WasRecording --- src/engine/shared/demo.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/engine/shared/demo.h b/src/engine/shared/demo.h index 4cb18304f7d..0544f41786c 100644 --- a/src/engine/shared/demo.h +++ b/src/engine/shared/demo.h @@ -122,7 +122,9 @@ class CDemoPlayer : public IDemoPlayer class CSnapshotDelta *m_pSnapshotDelta; bool m_UseVideo; +#if defined(CONF_VIDEORECORDER) bool m_WasRecording = false; +#endif enum EReadChunkHeaderResult { From e27223a027f38d3c84784719a750e06b6e2366d0 Mon Sep 17 00:00:00 2001 From: furo Date: Wed, 15 Nov 2023 15:08:30 +0100 Subject: [PATCH 06/12] Correct usage of `demo_extract_chat` tool. --- src/tools/demo_extract_chat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/demo_extract_chat.cpp b/src/tools/demo_extract_chat.cpp index 729ddcd6710..1f2d2b260ed 100644 --- a/src/tools/demo_extract_chat.cpp +++ b/src/tools/demo_extract_chat.cpp @@ -237,7 +237,7 @@ int main(int argc, const char *argv[]) if(argc != 2) { - dbg_msg(TOOL_NAME, "Usage: %s [demo_filename]", TOOL_NAME); + dbg_msg(TOOL_NAME, "Usage: %s ", TOOL_NAME); return -1; } From 08a00cff6b77c8dd484df20daf12f6304f71969d Mon Sep 17 00:00:00 2001 From: dobrykafe <121701317+dobrykafe@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:24:20 +0100 Subject: [PATCH 07/12] update `m_FileDialogFileNameInput` when deleting a file --- src/game/editor/editor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index fe459343e87..abfe529f090 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -5003,6 +5003,7 @@ void CEditor::RenderFileDialog() else ShowFileDialogError("Failed to delete file '%s'.", aDeleteFilePath); } + UpdateFileNameInput(); } if(s_ConfirmDeletePopupContext.m_Result != CUI::SConfirmPopupContext::UNSET) s_ConfirmDeletePopupContext.Reset(); From 740049a454d027fd474567dbb8da50e784e29f81 Mon Sep 17 00:00:00 2001 From: furo Date: Wed, 15 Nov 2023 20:54:27 +0100 Subject: [PATCH 08/12] Set size of text when changing slider of `cl_text_entities_size`. --- src/game/client/components/menus_settings.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index 8581cf47604..a0716b8664d 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -3085,8 +3085,14 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView) g_Config.m_ClTextEntities ^= 1; if(g_Config.m_ClTextEntities) + { + int PreviousSize = g_Config.m_ClTextEntitiesSize; UI()->DoScrollbarOption(&g_Config.m_ClTextEntitiesSize, &g_Config.m_ClTextEntitiesSize, &Button, Localize("Size"), 0, 100); + if(PreviousSize != g_Config.m_ClTextEntitiesSize) + m_pClient->m_MapImages.SetTextureScale(g_Config.m_ClTextEntitiesSize); + } + Left.HSplitTop(20.0f, &Button, &Left); Button.VSplitMid(&LeftLeft, &Button); From f54fc2e44126b8bc4f350c407647034424d4e8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 15 Nov 2023 22:28:46 +0100 Subject: [PATCH 09/12] Fix parent folder not being shown in editor file browser, fix typo The check for multiple storage locations was using the base path from the previous invocation of the file dialog instead of using the new base path. Closes #7463. --- src/game/editor/editor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index abfe529f090..5f9b726212a 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -5144,15 +5144,15 @@ void CEditor::InvokeFileDialog(int StorageType, int FileType, const char *pTitle m_FileDialogStorageType = StorageType; if(m_FileDialogStorageType == IStorage::TYPE_ALL) { - int NumStoragedWithFolder = 0; + int NumStoragesWithFolder = 0; for(int CheckStorageType = IStorage::TYPE_SAVE; CheckStorageType < Storage()->NumPaths(); ++CheckStorageType) { - if(Storage()->FolderExists(m_pFileDialogPath, CheckStorageType)) + if(Storage()->FolderExists(pBasePath, CheckStorageType)) { - NumStoragedWithFolder++; + NumStoragesWithFolder++; } } - m_FileDialogMultipleStorages = NumStoragedWithFolder > 1; + m_FileDialogMultipleStorages = NumStoragesWithFolder > 1; } else { From 0042aec086b1b358de347b7716be1874b77ee07f Mon Sep 17 00:00:00 2001 From: furo Date: Wed, 15 Nov 2023 22:51:41 +0100 Subject: [PATCH 10/12] Make KEY argument case-insensitive --- src/game/client/components/binds.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index 4faca9799c9..77e638b99b9 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -389,7 +389,7 @@ int CBinds::GetKeyID(const char *pKeyName) // search for key for(int i = 0; i < KEY_LAST; i++) { - if(str_comp(pKeyName, Input()->KeyName(i)) == 0) + if(str_comp_nocase(pKeyName, Input()->KeyName(i)) == 0) return i; } @@ -404,13 +404,13 @@ int CBinds::GetBindSlot(const char *pBindString, int *pModifierCombination) const char *pKey = str_next_token(pBindString, "+", aMod, sizeof(aMod)); while(aMod[0] && *(pKey)) { - if(!str_comp(aMod, "shift")) + if(!str_comp_nocase(aMod, "shift")) *pModifierCombination |= (1 << MODIFIER_SHIFT); - else if(!str_comp(aMod, "ctrl")) + else if(!str_comp_nocase(aMod, "ctrl")) *pModifierCombination |= (1 << MODIFIER_CTRL); - else if(!str_comp(aMod, "alt")) + else if(!str_comp_nocase(aMod, "alt")) *pModifierCombination |= (1 << MODIFIER_ALT); - else if(!str_comp(aMod, "gui")) + else if(!str_comp_nocase(aMod, "gui")) *pModifierCombination |= (1 << MODIFIER_GUI); else return 0; From 3f725509f06878abf9789a47b51f14633451f1ac Mon Sep 17 00:00:00 2001 From: noKetchup <93238471+n0Ketchp@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:31:27 -0300 Subject: [PATCH 11/12] Update spanish.txt --- data/languages/spanish.txt | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/data/languages/spanish.txt b/data/languages/spanish.txt index ff17ed089e9..923bca543fa 100644 --- a/data/languages/spanish.txt +++ b/data/languages/spanish.txt @@ -279,7 +279,7 @@ Ok == Aceptar Parent Folder -== Directorio padre +== Carpeta principal Password == Contraseña @@ -674,7 +674,7 @@ Markers == Marcadores Length -== Longitud +== Duración Date == Fecha @@ -869,7 +869,7 @@ Save the best demo of each race == Guardar la mejor demo de cada carrera Default length -== Longitud predeterminada +== Duración predeterminada Enable replays == Habilitar repeticiones @@ -1718,56 +1718,56 @@ Render cut to video == Renderizar corte a vídeo Error playing demo -== +== Error al reproducir la demo Some map images could not be loaded. Check the local console for details. -== +== Algunas imágenes de mapas no se pudieron cargar. Revisa la consola local para más detalles. Some map sounds could not be loaded. Check the local console for details. -== +== Algunos sonidos de mapas no se pudieron cargar. Revisa la consola local para más detalles. Loading menu themes -== +== Cargando temas del menú Render complete -== +== Renderización completada Videos directory -== +== Carpeta de videos Video was saved to '%s' -== +== El video guardó en '%s' No demo selected -== +== Ninguna demo seleccionada Created -== +== Creado Netversion -== +== Netversion [Demo details] map not included -== +== mapa no incluido Ghosts directory -== +== Carpeta de Fantasmas Activate all -== +== Activar todo Deactivate all -== +== Desactivar todo Enable ghost -== +== Habilitar fantasma Only save improvements -== +== Solo guardar las mejoras Regular background color -== +== Color del fondo normal Entities background color -== +== Color del fondo de entidades From 06674ebecf2ef9db6d6b5f03ed4e773a99275eba Mon Sep 17 00:00:00 2001 From: Corantin H Date: Wed, 15 Nov 2023 23:41:09 +0100 Subject: [PATCH 12/12] Save current input when using UP arrow. Prevent DOWN arrow from clearing current input. --- src/game/client/components/chat.cpp | 17 +++++++++++++++-- src/game/client/components/chat.h | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index de4780a0b3f..a2aa1baa05c 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -120,6 +120,8 @@ void CChat::Reset() m_LastChatSend = 0; m_CurrentLine = 0; m_IsInputCensored = false; + m_EditingNewLine = true; + mem_zero(m_aCurrentInputText, sizeof(m_aCurrentInputText)); DisableMode(); for(int64_t &LastSoundPlayed : m_aLastSoundPlayed) @@ -426,6 +428,12 @@ bool CChat::OnInput(const IInput::CEvent &Event) if(Event.m_Flags & IInput::FLAG_PRESS && Event.m_Key == KEY_UP) { + if(m_EditingNewLine) + { + str_copy(m_aCurrentInputText, m_Input.GetString()); + m_EditingNewLine = false; + } + if(m_pHistoryEntry) { CHistoryEntry *pTest = m_History.Prev(m_pHistoryEntry); @@ -445,9 +453,14 @@ bool CChat::OnInput(const IInput::CEvent &Event) m_pHistoryEntry = m_History.Next(m_pHistoryEntry); if(m_pHistoryEntry) + { m_Input.Set(m_pHistoryEntry->m_aText); - else - m_Input.Clear(); + } + else if(!m_EditingNewLine) + { + m_Input.Set(m_aCurrentInputText); + m_EditingNewLine = true; + } } return true; diff --git a/src/game/client/components/chat.h b/src/game/client/components/chat.h index 52f1082c05d..55d95b5de32 100644 --- a/src/game/client/components/chat.h +++ b/src/game/client/components/chat.h @@ -123,6 +123,8 @@ class CChat : public CComponent int64_t m_LastChatSend; int64_t m_aLastSoundPlayed[CHAT_NUM]; bool m_IsInputCensored; + char m_aCurrentInputText[MAX_LINE_LENGTH]; + bool m_EditingNewLine; static void ConSay(IConsole::IResult *pResult, void *pUserData); static void ConSayTeam(IConsole::IResult *pResult, void *pUserData);