AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   MySQL (https://forums.alliedmods.net/showthread.php?t=187302)

kramesa 06-11-2012 13:49

MySQL
 
How can I close the connection when map change?

jimaway 06-11-2012 14:25

Re: MySQL
 
http://www.amxmodx.org/funcwiki.php?go=func&id=1097
or if youre using dbi http://www.amxmodx.org/funcwiki.php?go=func&id=414

use them in public plugin_end ()

kramesa 06-12-2012 15:38

Re: MySQL
 
Ok, thanks! But its possible pause the plugin when map change and unpause after?

Exolent[jNr] 06-12-2012 15:39

Re: MySQL
 
Show your code. You could have some connections slowing it down.

kramesa 06-12-2012 15:44

Re: MySQL
 
The plugin is the advanced bans sql

This problem start occurring when I change my website to other country, with slow connection

How can I solve this problem?

Exolent[jNr] 06-12-2012 15:47

Re: MySQL
 
It's probably hanging until it connects to that server.

kramesa 06-12-2012 15:48

Re: MySQL
 
But have soluction to solve this? Or pause the plugin when map change

claudiuhks 06-12-2012 23:23

Re: MySQL
 
Does really ( Handle: g_hSQLTuple = SQL_MakeDbTuple( ... ) ) should be freed on plugin_end?
I don't know if is really needed. I want to avoid server crashes while changing level.

What do you think about?
Does it better to free it?

Exolent[jNr] 06-12-2012 23:35

Re: MySQL
 
Code:
/**  * Creates a connection information tuple.  * This tuple must be passed into connection routines.  * Freeing the tuple is not necessary, but is a good idea if you  *  create many of them.  You can cache these handles globally.  * !!NOTE!! I have seen most people think that this connects to the DB.  *   Nowhere does it say this, and in fact it does not.  It only caches  *   the connection information, the host/user/pass/etc.  *  * The optional timeout parameter specifies how long connections should wait before  * giving up.  If 0, the default (which is undefined) is used.  *  */ native Handle:SQL_MakeDbTuple(const host[], const user[], const pass[], const db[], timeout=0);
Quote:

Freeing the tuple is not necessary, but is a good idea if you create many of them.

kramesa 06-13-2012 16:33

Re: MySQL
 
I tried put the timeout in 5, but the server crash when change map, is not all times, but some times the server crash


All times are GMT -4. The time now is 06:18.

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