feat(core): Release 2.1.0#24
Merged
Merged
Conversation
- Fixed forced name not changing after renaming / when connecting - Fixed forced names list menu not opening when it was empty - Minor optimization + translations addition - Added ire. name since he made the original forced name plugin - Minor refactoring - Add `GetClientForcedName`, `GetForcedNameByAuthId`, `GetSteam2Variant`
There was a problem hiding this comment.
Pull request overview
This PR prepares the NameFilter SourceMod plugin for the 2.1.0 release, focusing on improving forced-name enforcement reliability, menu behavior, and translation/UX messaging.
Changes:
- Strengthens forced-name enforcement across connect/put-in-server/rename flows and adds helper APIs (
GetClientForcedName,GetForcedNameByAuthId,GetSteam2Variant) plus variant caching. - Fixes the forced-names menu behavior when no entries exist (and refactors the menu-building logic).
- Reworks translations and adds a player-facing chat info phrase for forced-name changes; updates plugin metadata (version/author).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| addons/sourcemod/scripting/NameFilter.sp | Refactors forced-name lookups/caching and applies forced names more consistently; updates forced-names menu behavior; bumps plugin version/author. |
| addons/sourcemod/translations/namefilter.phrases.txt | Updates and adds translated phrases (including a new forced-name chat info message) and refreshes menu/command wording. |
Comments suppressed due to low confidence (2)
addons/sourcemod/scripting/NameFilter.sp:270
- When the config has no subkeys, you add the "MenuEmpty" item here, but
bEmptyremainstrue, so the laterif (bEmpty)block adds the same disabled item a second time. This results in a duplicated "empty" row in the menu.
SetUpKeyValues();
if (!g_Kv.GotoFirstSubKey())
{
Format(MenuBuffer2, sizeof(MenuBuffer2), "%T", "MenuEmpty", client);
MainMenu.AddItem("", MenuBuffer2, ITEMDRAW_DISABLED);
addons/sourcemod/scripting/NameFilter.sp:126
CheckClientNameunconditionally schedules a forced-name change (and chat notice) if a forced name exists. If the forced name was already applied earlier (e.g., inOnClientPutInServer), this will re-apply the same name and can result in duplicate "ForcedName_ChatInfo" messages. Consider checking the current name first and only applying when it differs.
if (client && GetClientForcedName(client, g_sForcedName, sizeof(g_sForcedName)))
{
DataPack pack = new DataPack();
pack.WriteCell(client);
pack.WriteString(g_sForcedName);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetClientForcedName,GetForcedNameByAuthId,GetSteam2Variant