Raised This Month: $ Target: $400
 0% 

Using BuildPath()


Post New Thread Reply   
 
Thread Tools Display Modes
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-20-2012 , 12:00   Re: Using BuildPath()
Reply With Quote #31

Yay.. it finally work...

Q: Is every sever need to set they database.cfg in order for the cookies to work? and is this correct? If not how do i set the correct 1? And how do i open the menu suggested by root?

PHP Code:
"Databases"
{
    
"driver_default"        "mysql"
    
    
// When specifying "host", you may use an IP address, a hostname, or a socket file path
    
    
"default"
    
{
        
"driver"            "default"
        "host"                "localhost"
        "database"            "sourcemod"
        "user"                "root"
        "pass"                ""
        
//"timeout"            "0"
        //"port"            "0"
    
}
    
    
"storage-local"
    
{
        
"driver"            "sqlite"
        "database"            "sourcemod-local"
    
}

    
"clientprefs"
    
{
        
"driver"            "sqlite"
        "host"                "localhost"
        "database"            "clientprefs"
        "user"                "root"
        "pass"                ""
        
//"timeout"            "0"
        //"port"            "0"
    
}


Last edited by GsiX; 10-20-2012 at 12:02.
GsiX is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-20-2012 , 12:53   Re: Using BuildPath()
Reply With Quote #32

Quote:
Originally Posted by GsiX View Post
Yay.. it finally work...

Q: Is every sever need to set they database.cfg in order for the cookies to work? and is this correct? If not how do i set the correct 1?
clientprefs is set to use a local SQLite database by default. If you want to share client preferences across servers, then you need an external database and would have to edit databases.cfg on every server to use it.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 10-20-2012 at 12:53.
Powerlord is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-20-2012 , 13:02   Re: Using BuildPath()
Reply With Quote #33

You were saying that the database.cfg is not required to be configure if i only want to store and read data from it? I m not planing on force the sever owner to share preferences.

EDIT: My subject is on reading and store client cookies.

EDIT2: if i use the default setting like below code. The data is not loaded..

Code:
"clientprefs"
	{
		"driver"			"sqlite"
		"host"				"localhost"
		"database"			"clientprefs-sqlite"
		"user"				"root"
		"pass"				""
		//"timeout"			"0"
		//"port"			"0"
	}

Last edited by GsiX; 10-20-2012 at 13:32.
GsiX is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 10-20-2012 , 23:02   Re: Using BuildPath()
Reply With Quote #34

Look in sourcemod/configs/sql-init-scripts/sqlite. You must set up the database correctly before using clientprefs.
__________________
FaTony is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-22-2012 , 10:28   Re: Using BuildPath()
Reply With Quote #35

Sorry for the late reply, i m deal with life crab lately... Thanks for the guide, finaly i found a file that make sense to me but ho can i set the file up? and which file i need to set up? i have 5 file there.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 10-22-2012 , 11:31   Re: Using BuildPath()
Reply With Quote #36

Quote:
Originally Posted by GsiX View Post
i m deal with life crab lately
yummy yummy, life crabs

Quote:
Originally Posted by GsiX View Post
Thanks for the guide, finaly i found a file that make sense to me but ho can i set the file up? and which file i need to set up? i have 5 file there.
The .sql files are SQL dumps, the structure of the tables which you can import into an empty database to create the tables.
The .sq3 files are already sqlite databases that can be used I think.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

Last edited by berni; 10-22-2012 at 11:32.
berni is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-22-2012 , 12:12   Re: Using BuildPath()
Reply With Quote #37

Quote:
Originally Posted by berni View Post
The .sql files are SQL dumps, the structure of the tables which you can import into an empty database to create the tables.
The .sq3 files are already sqlite databases that can be used I think.
haha... thanks for the info.. as usual i will try this until i success or i pass out. If i pass out mean i will go back here..

__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 10-22-2012 , 12:45   Re: Using BuildPath()
Reply With Quote #38

I use MySQL part of XAMPP personally. Just start MySQL, srcds and game client on the same machine - no problems. I dunno why you're refusing simple yet full-fledged solution.
__________________
FaTony is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-22-2012 , 13:19   Re: Using BuildPath()
Reply With Quote #39

Quote:
Originally Posted by FaTony View Post
I use MySQL part of XAMPP personally. Just start MySQL, srcds and game client on the same machine - no problems. I dunno why you're refusing simple yet full-fledged solution.
I'v try but i still confused why you still saying i don't use the method you suggest.

I already release what i have here. The l4d2_luffy_rpg.

EDIT: and when i release the full edition.. i may need someone to reconvert this to CS:S or TF2... not sure if any one interesting. So far i only convert my CS:S plugin to l4d2 about 70%.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 10-22-2012 at 13:22.
GsiX is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 10-22-2012 , 13:20   Re: Using BuildPath()
Reply With Quote #40

If you're trying to use Clientprefs via MySQL, you don't need to do anything. It should create the tables automatically (or at least, it has in my experience).

If you're trying to use SQLite, stop what you're doing. You're overthinking it. Just create a cookie using RegClientCookie and use GetClientCookie and SetClientCookie to access it. Everything else is taken care of for you.
__________________
Dr. McKay 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 08:47.


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