• ULX Global Ban
    228 replies, posted
[QUOTE=mib999;39167470]I beg to differ. MySQL connects perfectly. I've fixed it now, it was another addon conflicting.[/QUOTE] Would help if you told us which addon :C
That's weird. Usually it means that, I forgot it could've been another addon.
Server doesnt start when i put in the gmsv_mysqloo.dll :S it just refuses to turn on idk why help?
[ULX GB] - Loading..... [ULX GB] - Connecting to Database! Then nothing happens in logs, when I try ban it doesn't shop up on website or mysql any ideas?
It worked 100% perfectly when I tried it about an hour ago, however when I ban someone now, it just says [code] uniqueid "STEAM_0:1:36084853" not found Writing cfg/banned_user.cfg. [ULX GB] - Database Connection Restarted [/code] and doesn't write to the database. Any solutions?
[QUOTE=ZaaZir;39300772][ULX GB] - Loading..... [ULX GB] - Connecting to Database! Then nothing happens in logs, when I try ban it doesn't shop up on website or mysql any ideas?[/QUOTE] Recheck your config Files, and your MySQL user permissions. [QUOTE=mahnahmuhnah;39306369]It worked 100% perfectly when I tried it about an hour ago, however when I ban someone now, it just says [code] uniqueid "STEAM_0:1:36084853" not found Writing cfg/banned_user.cfg. [ULX GB] - Database Connection Restarted [/code] and doesn't write to the database. Any solutions?[/QUOTE] Check that the MySQL server isn't refusing connections, it only restarts the connection if MySQLOO says it isn't active. I just did a fresh install on my local computer, and on my TTT server, both worked flawlessly.
Maybe if the db is disconnected randomly you could make a query table and have it then rerun the queries after reconnect? It's what I've done with my forum ranks system, and player shop.
[QUOTE=bcool14;39399702]Recheck your config Files, and your MySQL user permissions. Check that the MySQL server isn't refusing connections, it only restarts the connection if MySQLOO says it isn't active. I just did a fresh install on my local computer, and on my TTT server, both worked flawlessly.[/QUOTE] Tried everything, Nothing is working.
[QUOTE=ZaaZir;39403424]Tried everything, Nothing is working.[/QUOTE] Try installing it on a Local Dedicated Server, with WAMP or similar, see if it works then. [QUOTE=Phoenixf129;39401241]Maybe if the db is disconnected randomly you could make a query table and have it then rerun the queries after reconnect? It's what I've done with my forum ranks system, and player shop.[/QUOTE] It's supposed to auto-reconnect, I've already added a system to basically do that. [code] //Keep the MySQL Database Open and Connected. local function DbCheck() if (ULX_DB:status() != mysqloo.DATABASE_CONNECTED) then ULX_DB = mysqloo.connect(GB_DATABASE_HOST, GB_DATABASE_USERNAME, GB_DATABASE_PASSWORD, GB_DATABASE_NAME, GB_DATABASE_PORT) print('[ULX GB] - Database Connection Restarted' ) end end timer.Create( 'DbCheck', 90, 0, DbCheck ) [/code]
[QUOTE=bcool14;39405442]Try installing it on a Local Dedicated Server, with WAMP or similar, see if it works then. It's supposed to auto-reconnect, I've already added a system to basically do that. [code] //Keep the MySQL Database Open and Connected. local function DbCheck() if (ULX_DB:status() != mysqloo.DATABASE_CONNECTED) then ULX_DB = mysqloo.connect(GB_DATABASE_HOST, GB_DATABASE_USERNAME, GB_DATABASE_PASSWORD, GB_DATABASE_NAME, GB_DATABASE_PORT) print('[ULX GB] - Database Connection Restarted' ) end end timer.Create( 'DbCheck', 90, 0, DbCheck ) [/code][/QUOTE] To save resources, you could use query:OnError() to check if the error is because it's not connected and then reconnect, and run the queries you've stored in a table. Much better than a timer, as DB:status() causes srcds to hang while it queries (and if the mysql server is struggling, it can time players out). [lua] local Host = "put" local User = "what" local Pass = "you" local DB = "want" local Port = "here" GPiDB = {} GPiDB.MySQL = {} GPiDB.QueryQueue = {} function GPiDB:Init() require("mysqloo") MsgN( "[MySQL] Connecting to database.." ) GPiDB.MySQL = mysqloo.connect( Host, User, Pass, DB, Port ) GPiDB.MySQL.onConnected = function( db ) MsgN( "[MySQL] Connnection establised!" ) for i = 1, #self.QueryQueue, 1 do MsgN( "[MySQL] Running queued query.." ) GPiDB:RunPreparedQuery( self.QueryQueue[ i ] ) end self.QueryQueue = {} end GPiDB.MySQL.onConnectionFailed = function( db, e ) MsgN( "[MySQL] Connection FAILED:" .. e ) end GPiDB.MySQL:connect() GPiDB.MySQL:wait() end function GPiDB:RunPreparedQuery( q ) q.callback = q.callback or function() end local query = self.MySQL:query( q.sql ) function query:onSuccess( data ) MsgN( "[MySQL] Query Successful!\nQuery: " .. q.sql ) q.callback( data, unpack( q.vargs or {} ) ) end function query:onError( e, sql ) MsgN( "[MySQL] Query Failed!\nQuery: " .. sql .. "\nError: " .. e ) local stat = GPiDB.MySQL:status() if stat ~= mysqloo.DATABASE_CONNECTED then table.insert( GPiDB.QueryQueue, q ) if stat == mysqloo.DATABASE_NOT_CONNECTED then MsgN( "[MySQL] Database Connnection lost... Reconnecting!" ) GPiDB.MySQL:connect() end end end query:start() if q.wait then query:wait() end end function GPiDB:QuickQuery( sql ) local q = {} q.sql = sql GPiDB:RunPreparedQuery( q ) end function GPiDB:escape( txt ) if type( txt ) != "string" then txt = tostring(txt) end return txt end hook.Add("InitPostEntity", "InitPostEntity.GiveMeAFuckingMySQLConnection", function( p ) GPiDB:Init() end) [/lua] Here's the code I use as an example. If you decide to use it, give me/Drakehawke credits :)
[QUOTE=Phoenixf129;39407158]To save resources, you could use query:OnError() to check if the error is because it's not connected and then reconnect, and run the queries you've stored in a table. Much better than a timer, as DB:status() causes srcds to hang while it queries (and if the mysql server is struggling, it can time players out). Here's the code I use as an example. If you decide to use it, give me/Drakehawke credits :)[/QUOTE] I'll be sure to incorporate that idea! Thanks! Credits will be given where credit is due!
This is much needed and I wish I was informed it was available. Thanks for taking the time to make this for ULX.
[QUOTE=mib999;39167470]I beg to differ. MySQL connects perfectly. I've fixed it now, it was another addon conflicting.[/QUOTE] Which addon?
-snip-
[QUOTE=RANDOMlagFTW;39448267]i keep getting this error [ULX GB] - Loading..... Couldn't include file 'includes\modules\mysqloo.lua' (File not found) (@addons/ulx_globalbanmodule/lua/globalban/gb_mysqloo.lua (line 6)) [code][ERROR] addons/ulx_globalbanmodule/lua/globalban/gb_mysqloo.lua:6: Module not found! 1. require - [C]:-1 2. unknown - addons/ulx_globalbanmodule/lua/globalban/gb_mysqloo.lua:6 3. include - [C]:-1 4. unknown - addons/ulx_globalbanmodule/lua/autorun/ulx_globalban.lua:9[/code] anyone know what to do to fix this?[/QUOTE] You didn't install the MySQLoo module correctly.
-snip-
it's not throwing out errors but instead just causing srcds to crash... it puzzles me.
[QUOTE=Lebofly;39424480]Which addon?[/QUOTE] gForum. :P
[QUOTE=mib999;39450666]gForum. :P[/QUOTE] It should be fine to use with gForum.
[QUOTE=bcool14;39468541]It should be fine to use with gForum.[/QUOTE] It doesn't conflict at all with gForum or PointShop, just an FYI. Tested it. Not going to be using it though, already have my system in place :v:
-snip- I'm just an idiot, but it still isn't working :\
-snip- Fixed it.
Hey, I just set this up on a web-server, it seems to connect but I see the broken page completely. It will do this for both the original and modified version of the webpage. -- Error log generated -- [CODE] [12-Feb-2013 22:54:47 Europe/London] PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/butcherg/public_html/Bans/index.php on line 82 [12-Feb-2013 22:54:47 Europe/London] PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/butcherg/public_html/Bans/index.php on line 127 [12-Feb-2013 22:54:47 Europe/London] PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/butcherg/public_html/Bans/index.php on line 155 [/CODE] The following config for web-server is; [CODE] $dbhost = '93.189.4.34'; // Server IP/Domain of where the datab-base resides. $dbdatabase = 'butcherg_ulx_bans'; // Data-base Name. $dbuser = '*****************************'; // Username. $dbpassword = '*************'; // Password. $webname = 'ButcherGaming Bans' // Title of Community/Server/Website/Domain, pick one. [/CODE] Link to website page; [url]http://butchergaming.nn.pe/Bans/index.php[/url] Seems like its working on the server, this gets written to the logs; [CODE] Writing cfg/banned_user.cfg. [ULX GB] - Database Connection Restarted [/CODE] PHP version is; 5.3.21
[QUOTE=Soto;39566556]Hey, I just set this up on a web-server, it seems to connect but I see the broken page completely. It will do this for both the original and modified version of the webpage. -- Error log generated -- [CODE] [12-Feb-2013 22:54:47 Europe/London] PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/butcherg/public_html/Bans/index.php on line 82 [12-Feb-2013 22:54:47 Europe/London] PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/butcherg/public_html/Bans/index.php on line 127 [12-Feb-2013 22:54:47 Europe/London] PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/butcherg/public_html/Bans/index.php on line 155 [/CODE] The following config for web-server is; [CODE] $dbhost = '93.189.4.34'; // Server IP/Domain of where the datab-base resides. $dbdatabase = 'butcherg_ulx_bans'; // Data-base Name. $dbuser = '*****************************'; // Username. $dbpassword = '*************'; // Password. $webname = 'ButcherGaming Bans' // Title of Community/Server/Website/Domain, pick one. [/CODE] Link to website page; [url]http://butchergaming.nn.pe/Bans/index.php[/url] Seems like its working on the server, this gets written to the logs; [CODE] Writing cfg/banned_user.cfg. [ULX GB] - Database Connection Restarted [/CODE] PHP version is; 5.3.21[/QUOTE] Were you able to fix the problem? I checked the page it seem fine. If so what was the problem, i would like to see what i did wrong ^_^
I seem to be getting a problem in which the server isn't sending it's bans to the database, but my website can load from it fine. I checked the db and it had no files in it from gmod. I am pretty sure I installed mysqloo right, too, but just in case - I have libmySQL.dll and gmsv_mysqloo_win32.dll in both /orangebox and /orangebox/garrysmod/lua/bin other than that and the gban addon (which is mounting), is there anything I am missing? It even says connection successful in console, but I guess it is not adding right?
Did you insert the sql file into the database?
[QUOTE=TweaK2007;39613234]Did you insert the sql file into the database?[/QUOTE] yes
There's issues with hosting the SQL Server and Game server on the same machine. It creates a new server everytime the game server starts up. [editline]17th February 2013[/editline] Is there anyway of preventing this?
[QUOTE=12voltsdc;39621427]There's issues with hosting the SQL Server and Game server on the same machine. It creates a new server everytime the game server starts up. [editline]17th February 2013[/editline] Is there anyway of preventing this?[/QUOTE] My server works just fine and i have a mySQL set up on the same machine. Is it configured properly?
[QUOTE=Pandaman09;39621644]My server works just fine and i have a mySQL set up on the same machine. Is it configured properly?[/QUOTE] Everything is configured properly, It all connects fine and loads the bans. The only issue is it creates a new server and assigns it a new ID everytime my server restarts.
Sorry, you need to Log In to post a reply to this thread.