Raised This Month: $51 Target: $400
 12% 

Remove/Clear Client Cookies?


Post New Thread Reply   
 
Thread Tools Display Modes
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 04-08-2016 , 04:11   Re: Remove/Clear Client Cookies?
Reply With Quote #11

Dynamic could also be usefull in this case.

PHP Code:
// Create and set a dynamic objects name to the clients steamid
Dynamic clientsettings = new Dynamic();
clientsettings.SetName(ClientsSteamID);
 
// If you need to get the clients dynamic settings
// Note: This will work in other plugins as dynamic objects are global and accessible by any plugin
clientsettings Dynamic.FindByName(ClientsSteamID);
 
// Storage
clientsettings.SetInt("someint"1);
clientsettings.SetFloat("somefloat"1.0);
 
// Retrieval 
int someint clientsettings.GetInt("someint");
float somefloat clientsettings.GetFloat("somefloat");
 
// Disposal
clientsettings.Dispose(); 
__________________

Last edited by Neuro Toxin; 04-08-2016 at 04:13.
Neuro Toxin is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 04-08-2016 , 05:21   Re: Remove/Clear Client Cookies?
Reply With Quote #12

Quote:
Originally Posted by ddhoward View Post
You shouldn't be using the cookie system for that purpose anyway. The cookie system actually writes to disk, so it's meant for information that should persist even across server restarts. It's woefully inefficient for anything else. (And some of the Sourcemod devs have even gone as far as to say that the clientprefs system shouldn't be used for things that aren't client preferences.) It's much more efficient to just keep that information in RAM.

Merudo, I'm thinking that your best bet would be a string map (if this isn't what you're already using). A rough example of the relevant code can be seen below. Untested. I've also never used a stringmap before soooo...
Thanks ddhoward, this works great!
__________________
Merudo 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 12:06.


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