New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SetClientName native. #313
Conversation
@@ -333,6 +333,15 @@ native ActivateEntity(entity); | |||
native SetClientInfo(client, const String:key[], const String:value[]); | |||
|
|||
/** | |||
* Something |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something appears to be outstanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This is fixed now.
Is this for 1.7 possible or only 1.8+? |
The old bug report for reference: https://bugs.alliedmods.net/show_bug.cgi?id=5441
Finally some closure on that problem. Nice find! |
I don't have a firm answer for that yet. We generally try to avoid new features in stable releases, especially ones that add new gamedata. However, this could also be considered a bug fix.
Thanks. I had forgotten about that. I've left a comment there to point here. |
So 1.8+? |
It has been less than 24 hours since it landed on the dev branch. That is not an indication that it will or will not end up on the stable branch before the next stable release. One would think that we might want to intentionally wait some time and let early-adopters test it before we determine it to be "stable". |
can you had this for Day of Defeat source too please ? |
What issues are you seeing on Day of Defeat: Source? |
This works for all games that SM supports. (The old sm_rename should have worked fine too for DoD:S). |
I tested (on 1.7.1 182) on dods but no success: SetClientName not supported by this mod |
The gamedata updater hasn't been updated for this game yet and is probably overwriting your gamedata files with ones from before this was added. |
ok, so it will be updated in a few minutes/hours? |
The updater is updated now. |
It seems that sm_rename(SetClientName) doesn't work properly in CS:GO, the player name will be reverse to steam name after sm_rename command executed |
CS:GO was one of the game explicitly tested with this. Unless the last game update happened it break it, it should work. I'll try to take a look in the next day or two. |
I notic that in extension.cpp, some code under the compile switch "SOURCE_ENGINE == SE_CSS" is added to fix the name reverting in CSS. |
Good investigative work! I can confirm now looking at CS:GO's server.so that CCSPlayer::ChangeName does have similar to or the same logic as CS:S's version. I must have not added the ifdef until after testing. |
This is fixed now. |
* Remove obsolete slapslay.phrases.txt That plugin isn't in the stock arsenal since forever. * Remove "Dead Player Rename" phrase Unused since #313 * Remove nominations phrases from rockthevote Those phrases were moved to their own nominations.phrases.txt * Remove "Next Map" phrase from nextmap.phrases.txt It was moved to basetriggers.phrases.txt * Remove unused phrases from common.phrases.txt Only "Slapped Player" was moved to funvotes.phrases.txt * Delete empty phrase files * Fix workflow python version selection 3.10 would select Python 3.1 and fail * Deduplicate "Please select a map" phrase Only keep it in the plugin.basecommands.txt file and remove it from the basevotes.phrases.txt. Both plugins using the phrase load the basecommands phrases. * Allow manual triggering of translations action * Actually use the nextmap phrases They were never referenced in the plugin. The "ago" phrase doesn't work the way it is and needs more rethinking.
Our current method for changing names (SetUserInfo), as implemented in the sm_rename command, does not work on the top three games by SM install count - TF2 (temporarily due to game bug, this works around), CS:S, and CS:GO. There may be others as well.
By implementing a new SetClientName native to wrap CBaseClient::SetName, we gain better game compatibility as well as bypass name change cooldown restrictions in the engine. SetName is one function earlier in the same vtable as SetUserInfo for every supported game, so there's very little extra support burden.
I've also updated the playercommands plugin to use the new native for sm_rename. I removed the old, ep1-specific logic and message for name changes while dead, too. The game logic it was considering was actually specific to CS:S, not the ep1 base, and hasn't been present in CS:S since the Orangebox port years ago.
However, due to some of the legacy code in CS:S, a hook on IVEngineServer::ClientCommand was added to block changes of the client "name" convar sent from the server. Any change to that client convar in Orangebox or later now resets the client's name to their Steam name.
@GoD-Tony
@KyleSanderson