Raised This Month: $ Target: $400
 0% 

[TF2] Auto Renaming with SteamID?


Post New Thread Reply   
 
Thread Tools Display Modes
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-19-2014 , 12:39   Re: [TF2] Auto Renaming with SteamID?
Reply With Quote #21

Quote:
Originally Posted by ddhoward View Post
Take a look at some other plugins that pass a client through a timer. You need to pass the client's userID instead. Otherwise you run the risk, however slight, of affecting the wrong player, should the intended player disconnect and another player connects at the next moment.
That isn't actually a big problem in this case, as all the logic is in RenamePlayer - worth keeping in mind though.

However, the missing check for GetClientAuthString combined with using decl for the buffer is dangerous.
__________________
asherkin is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 10-19-2014 , 12:49   Re: [TF2] Auto Renaming with SteamID?
Reply With Quote #22

Quote:
Originally Posted by asherkin View Post
However, the missing check for GetClientAuthString combined with using decl for the buffer is dangerous.
What check ? What should I do their ?
__________________
Want to check my plugins ?
Arkarr is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 10-19-2014 , 14:16   Re: [TF2] Auto Renaming with SteamID?
Reply With Quote #23

Quote:
Originally Posted by Arkarr View Post
What check ? What should I do their ?
GetClientAuthString can fail sometimes. If this happens, the string that the steamId was supposed to go in isn't touched. And here, you are declaring the string with deck decl rather than new. Which means it's filled with garbage data.

You need to grab the return value of GetClientAuthString (true if it worked, false if it didn't), and have your plugin act appropriately.

Check out my Target Name Changers plugin for an example.
__________________

Last edited by ddhoward; 10-19-2014 at 19:48.
ddhoward is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 10-19-2014 , 14:26   Re: [TF2] Auto Renaming with SteamID?
Reply With Quote #24

Quote:
Originally Posted by ddhoward View Post
GetClientAuthString can fail sometimes. If this happens, the string that the steamId was supposed to go in isn't touched. And here, you are declaring the string with deck rather than new. Which means it's filled with garbage data.

You need to grab the return value of GetClientAuthString (true if it worked, false if it didn't), and have your plugin act appropriately.

Check out my Target Name Changers plugin for an example.
weeeeeeee ! Thanks !
__________________
Want to check my plugins ?
Arkarr is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode