Raised This Month: $ Target: $400
 0% 

Plugin Config File


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ajaxx
Senior Member
Join Date: Oct 2009
Old 10-27-2010 , 23:12   Plugin Config File
Reply With Quote #1

How can I get my plugin to read custom configurations from the config.cfg file?
Ajaxx is offline
Keeper
Senior Member
Join Date: Nov 2006
Old 10-28-2010 , 08:18   Re: Plugin Config File
Reply With Quote #2

You can write a parser ...

or

just do
Code:
engine->ServerCommand("exec config.cfg\n");
Keeper is offline
Ajaxx
Senior Member
Join Date: Oct 2009
Old 10-28-2010 , 21:18   Re: Plugin Config File
Reply With Quote #3

Thanks for the reply Keeper. I'm not sure I understand or maybe I didn't word my question correct. What I'd like to do is get my SQL connection string from a config file. I'm wondering if there's a built in mechanism I can use to pull
Quote:
"Provider=SQLNCLI10; Server=DESKTOP; Database=Ultra; Trusted_Connection=yes;"
out of server.cfg or any other file without doing the parsing myself. Is this possible?
Ajaxx is offline
Ajaxx
Senior Member
Join Date: Oct 2009
Old 11-02-2010 , 16:55   Re: Plugin Config File
Reply With Quote #4

Once I execute:
Code:
engine->ServerCommand("exec config.cfg\n");
How do I reference the connection string?
Ajaxx is offline
API
Veteran Member
Join Date: May 2006
Old 11-06-2010 , 01:18   Re: Plugin Config File
Reply With Quote #5

He didn't understand your question correctly. You are just trying to parse a file and use the values for connecting. You could just use the standard fopen() and copy everything to a string with fgets()

If you plan on having multiple config lines, just explode the string by \n
__________________
API is offline
Send a message via AIM to API
Ajaxx
Senior Member
Join Date: Oct 2009
Old 11-11-2010 , 03:19   Re: Plugin Config File
Reply With Quote #6

Thanks Pimpin
I was looking for something built in but this will work.
Ajaxx 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 19:05.


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