Ulysses Stuff > Releases

Sourcebans & ULX/ULib

<< < (22/30) > >>

JamminR:
TrulyRazor, my apologies, I've never used either of these projects, but my guess would be - do you have a functioning sourcebans database that this can connect to, with admins in it?
From my understanding, this won't create new database/admins, it only adds bans to an already existing.
Someone more experienced can hopefully help.

Storm,
It's my understanding sourcebans won't run on Gmod, this only connects to a database created by sourcebans.
I'd experienced guestimate that the local Gmod bans file would still remain, as long as you didn't use the (2nd/replace) method from the first post.

TrulyRazor:

--- Quote from: JamminR on September 19, 2013, 02:48:19 PM ---TrulyRazor, my apologies, I've never used either of these projects, but my guess would be - do you have a functioning sourcebans database that this can connect to, with admins in it?
From my understanding, this won't create new database/admins, it only adds bans to an already existing.
Someone more experienced can hopefully help.

Storm,
It's my understanding sourcebans won't run on Gmod, this only connects to a database created by sourcebans.
I'd experienced guestimate that the local Gmod bans file would still remain, as long as you didn't use the (2nd/replace) method from the first post.

--- End quote ---

I fixed the issue!

For anyone encountering the Lua Error: [ERROR] addons/ulx/lua/includes/modules/sourcebans.lua:247: attempt to index field 'Select Admin Groups' (a nil value) error,
the thread is misleading. You actually need to replace the code he specified for line 178, not 177. AKA right below this line:

--- Quote ---    ["Select Admin Groups"] = "SELECT flags, immunity, name FROM %s_srvgroups";
--- End quote ---

So for instance, your code should look like this after you replace line 178:


--- Quote ---local queries = {
    -- BanChkr
    ["Check for Bans"] = "SELECT bid, name, ends, authid, ip FROM %s_bans WHERE (length = 0 OR ends > UNIX_TIMESTAMP()) AND removetype IS NULL AND (authid = '%s' OR ip = '%s') LIMIT 1";
    ["Check for Bans by IP"] = "SELECT bid, name, ends, authid, ip FROM %s_bans WHERE (length = 0 OR ends > UNIX_TIMESTAMP()) AND removetype IS NULL AND ip = '%s' LIMIT 1";
    ["Check for Bans by SteamID"] = "SELECT bid, name, ends, authid, ip FROM %s_bans WHERE (length = 0 OR ends > UNIX_TIMESTAMP()) AND removetype IS NULL AND authid = '%s' LIMIT 1";
    ["Get All Active Bans"] = "SELECT ip, authid, name, created, ends, length, reason, aid  FROM %s_bans WHERE (length = 0 OR ends > UNIX_TIMESTAMP()) AND removetype IS NULL;";
   
    ["Log Join Attempt"] = "INSERT INTO %s_banlog (sid, time, name, bid) VALUES( %i, %i, '%s', %i)";
   
    -- Admins
    ["Select Admin Groups"] = "SELECT flags, immunity, name FROM %s_srvgroups";
--    ["Select Admins"] = "SELECT a.aid, a.user, a.authid, a.srv_group, a.srv_flags, a.immunity FROM %s_admins a, %s_admins_servers_groups g WHERE g.server_id = %i AND g.admin_id = a.aid";
["Select Admins"] = "SELECT a.aid, a.user, a.authid, a.srv_group, a.srv_flags, a.immunity FROM %s_admins a";
   
    -- Bannin
    ["Ban Player"] = "INSERT INTO %s_bans (ip, authid, name, created, ends, length, reason, aid, adminIp, sid, country) VALUES('%s', '%s', '%s', %i, %i, %i, '%s', %i, '%s', %i, ' ')";
    -- Unbannin
    ["Unban SteamID"] = "UPDATE %s_bans SET RemovedBy = %i, RemoveType = 'U', RemovedOn = UNIX_TIMESTAMP(), ureason = '%s' WHERE (length = 0 OR ends > UNIX_TIMESTAMP()) AND removetype IS NULL AND authid = '%s'";
    ["Unban IPAddress"] = "UPDATE %s_bans SET RemovedBy = %i, RemoveType = 'U', RemovedOn = UNIX_TIMESTAMP(), ureason = '%s' WHERE (length = 0 OR ends > UNIX_TIMESTAMP()) AND removetype IS NULL AND ip = '%s'";
};
--- End quote ---

Thanks for the help, JamminR!

rainbow Dash:

--- Quote from: JamminR on September 19, 2013, 02:48:19 PM ---Storm,
It's my understanding sourcebans won't run on Gmod, this only connects to a database created by sourcebans.
I'd experienced guestimate that the local Gmod bans file would still remain, as long as you didn't use the (2nd/replace) method from the first post.

--- End quote ---

You are kind of right and wrong here.

Existing bans will still remain, as ULX will still pertain to its bans. When a new ban takes place, ULX does not ban the player (unless the database wont connect) but rather remembers they were banned, and tells the database to add it to the ban list, and then bans them through the banid method.

Web based bans, on the other hand, do not log into ulx at all from what I have seen, they appear to just get added to the ban list on all servers.

rainbow Dash:
There is a serious issue with this addon.

When the addon fails to connect to the database, all bans are forgotten. Players who have been banned can rejoin.

A suggestion to resolve this: Every time the database synchronizes, it saves a local copy of all bans, from which it reads its bans from. Every 30 minutes, it drops its MySQL connection to sourcebans and retries it from scratch to synchronize this database. This way, if the database cannot be retrieved, we still have bans that take effect.

V-Rico:
So, guys. If you got problems with incorrect symbols in base (like СЛОВО), just add:

--- Code: ---local query_names = self:query("SET NAMES utf8");
query_names:start();
--- End code ---
after

--- Code: ---function databaseOnConnected(self)
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version