Raised This Month: $ Target: $400
 0% 

ClientPrefs Unstable (!settings)


Post New Thread Reply   
 
Thread Tools Display Modes
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 06-05-2012 , 00:53   Re: ClientPrefs Unstable (!settings)
Reply With Quote #21

Quote:
Originally Posted by asherkin View Post
Yep, and the bug was converting them back as signed longs instead of unsigned longs.

Code:
<predcrab> My favorite part of this story is that i *knew* putting pointers in strings would turn out terribly
ok bear with me, last question, as far as i can see the proto of AppendItem is:

PHP Code:
::AppendItem(const char info, const SourceMod::ItemDrawInfo &draw); 
so why didnt you just do something like

PHP Code:
g_CookieManager.clientMenu->AppendItem((char*)AutoMenuDataPtr, ...); 
instead of actually storing the pointers as strings
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-05-2012 , 00:59   Re: ClientPrefs Unstable (!settings)
Reply With Quote #22

Quote:
Originally Posted by Zephyrus View Post
ok bear with me, last question, as far as i can see the proto of AppendItem is:

PHP Code:
::AppendItem(const char info, const SourceMod::ItemDrawInfo &draw); 
so why didnt you just do something like

PHP Code:
g_CookieManager.clientMenu->AppendItem((char*)AutoMenuDataPtr, ...); 
instead of actually storing the pointers as strings
Because there is no guarantee the menu API wont print it as a string in, for example, an error message.
Other than giving semantically-correct answer like that, you'd need to ask pRED* about implementation details.
__________________

Last edited by asherkin; 06-05-2012 at 01:00.
asherkin is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 06-05-2012 , 01:05   Re: ClientPrefs Unstable (!settings)
Reply With Quote #23

Quote:
Originally Posted by asherkin View Post
Because there is no guarantee the menu API wont print it as a string in, for example, an error message.
Other than giving semantically-correct answer like that, you'd need to ask pRED* about implementation details.
i cant seem to find any error messages related to menu api that would print any strings, it only prints pointers but correct me if im wrong

im not trying to argue just trying to get a clear view of it

edit: ah just saw the part of pRED* okie nvm :p
__________________
Taking private C++/PHP/SourcePawn requests, PM me.

Last edited by Zephyrus; 06-05-2012 at 01:06.
Zephyrus is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-05-2012 , 01:06   Re: ClientPrefs Unstable (!settings)
Reply With Quote #24

Quote:
Originally Posted by Zephyrus View Post
i cant seem to find any error messages related to menu api that would print any strings, it only prints pointers but correct me if im wrong
What the public API guarantees doesn't necessarily equal what it actually does, clientprefs (and everything else) has to follow the public API though, and that means everything that goes in for that parameter is a printable, null-terminated string.
__________________

Last edited by asherkin; 06-05-2012 at 01:07.
asherkin is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 06-05-2012 , 22:20   Re: ClientPrefs Unstable (!settings)
Reply With Quote #25

Quote:
Originally Posted by asherkin View Post
Pointers to the menu information struts were getting corrupted internally due to a small typo, these are read in three places: 1) Drawing a menu 2) Selecting a menu option and 3) Cleaning up the menu on plugin unload.
Does that mean that those bugs are solved ? It seems to be a fix more important than just ClientPrefs.

https://bugs.alliedmods.net/show_bug.cgi?id=5308
https://bugs.alliedmods.net/show_bug.cgi?id=5271
https://bugs.alliedmods.net/show_bug.cgi?id=4997 --> talks about text (const char*) too
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work

Last edited by RedSword; 06-05-2012 at 22:21.
RedSword is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-06-2012 , 03:03  
Reply With Quote #26

Quote:
Originally Posted by RedSword View Post
Does that mean that those bugs are solved ? It seems to be a fix more important than just ClientPrefs.
Er, no.
The bug was in clientprefs specifically.
__________________
asherkin is offline
databomb
Veteran Member
Join Date: Jun 2009
Location: california
Old 06-06-2012 , 22:41   Re: ClientPrefs Unstable (!settings)
Reply With Quote #27

Awesome job tracking this down asherkin. I'm vegetarian so I've been saving these for you: :baco n!::b acon!:
__________________
databomb 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 13:36.


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