AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [help required] database connection problem (https://forums.alliedmods.net/showthread.php?t=332826)

fragnichtnach 06-03-2021 04:00

[help required] database connection problem
 
Setup:
Consider a server with two plugins. Both connected to different databases. The two databases are running on different IPs.

Problem:
If one database is offline (and the IP unreachable) both plugins are having problems with loading.
  • I'm search a solution how it's possible to have the two plugins running independent. So problems with one database doesn't effect the plugin running on another database.
  • In case this isn't possible in general: Is it possible to make one plugin loading prior to other plugins so that this plugion is loading no matter if there are problems with other database plugins?
  • In case this should be possible: Is there a open source plugin where the database handling is done correctly so that this doesn't happen?

Thanks for your help in advance.

canadianjeff 06-06-2021 18:27

Re: [help required] database connection problem
 
your problem does not actually make logical sense

plugin 1 connects to database A
plugin 2 connects to database B

plugin 1 should not have issues with plugin 2 and plugin 2 should not interfere with plugin 1

configs/databases.cfg should look something like this??

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"                                "127.0.0.1"
                "database"                        "DBNAME"
                "user"                                "DBUSER"
                "pass"                                "DBPASS"
                //"timeout"                        "0"
                //"port"                        "0"
        }
       
        "storage-local"
        {
                "driver"                        "sqlite"
                "database"                        "sourcemod-local"
        }

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

        "databaseA"
        {
                "driver" "default"
                "host"                                "127.0.0.1"
                "database"                        "DBNAME_A"
                "user"                                "DBUSER_A"
                "pass"                                "DBPASS_A"
        }

        "databaseB"
        {
                "driver" "default"
                "host"                                "127.0.0.1"
                "database"                        "DBNAME_B"
                "user"                                "DBUSER_B"
                "pass"                                "DBPASS_B"
        }
}



All times are GMT -4. The time now is 04:30.

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