Raised This Month: $ Target: $400
 0% 

snprintf Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 04-16-2006 , 10:12  
Reply With Quote #11

The KeyValues Valve code has really bad performance of reading and writing to disk once you start getting above 5000 keys.

Mani
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 04-16-2006 , 14:12  
Reply With Quote #12

Here's an INI class I wrote a while back for IRC Relay. It could probably be enhanced more, but it has worked for me well so far.

Example:
Code:
IniFile ini;
ini.Load("settings.ini");
const char *value = ini.GetString("Section", "Key");
Attached Files
File Type: h ini.h (1.7 KB, 134 views)
File Type: cpp ini.cpp (7.3 KB, 127 views)
__________________
sslice is offline
Stormsys
Member
Join Date: Oct 2005
Old 04-17-2006 , 06:39  
Reply With Quote #13

hey mani thx for tip, =) thanks slice
Stormsys is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 04-17-2006 , 16:14  
Reply With Quote #14

Quote:
Originally Posted by sslice
Code:
IniFile ini;
ini.Load("settings.ini");
const char *value = ini.GetString("Section", "Key");
And wheres WriteString :\ ?
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
Stormsys
Member
Join Date: Oct 2005
Old 04-17-2006 , 16:21  
Reply With Quote #15

Quote:
Originally Posted by c0ldfyr3
Quote:
Originally Posted by sslice
Code:
IniFile ini;
ini.Load("settings.ini");
const char *value = ini.GetString("Section", "Key");
And wheres WriteString :\ ?
=D was gonna ask this- looking threw the code theres no easy way to actualy write one. its posible but verry long and if it was to be called alot would cause lots of lagg
Stormsys is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 04-17-2006 , 16:29  
Reply With Quote #16

Yeah, manually editing a huge string like that would suck.
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 04-17-2006 , 17:42  
Reply With Quote #17

Well.. I never actually needed to save an INI from my use.. it wouldn't be hard to do unless you wanted to retain comments and such.

If all you're doing is saving data per player such as XP or whatever.. why not just write it as binary?
__________________
sslice 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 10:32.


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