Raised This Month: $12 Target: $400
 3% 

{SOLVED] MySQL Not Retrieving Admins from sm_admins correctly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krillin
Senior Member
Join Date: Jul 2004
Old 07-08-2011 , 00:57   {SOLVED] MySQL Not Retrieving Admins from sm_admins correctly
Reply With Quote #1

Either this is not document or this problem has gone overlooked.

The issue is with MySQL database for admins. I have three admins in a database and none of them are given access to the server.

We are running the newest versions of Metamod Source and Source MOD:
Quote:
meta version
Metamod:Source version 1.8.7
Build ID: 772:99b7a0a11fec
Loaded As: Valve Server Plugin
Compiled on: Jun 23 2011
Plugin interface version: 15:14
SourceHook version: 5:5
http://www.metamodsource.net/
Quote:
sm plugins list
[SM] Listing 48 plugins:
01 "CS:S DM Equipment" (2.1.4) by AlliedModders LLC
02 "Admin Menu" (1.3.8) by AlliedModders LLC
03 "Admin File Reader" (1.3.8) by AlliedModders LLC
04 "Fun Votes" (1.3.8) by AlliedModders LLC
05 "Player Commands" (1.3.8) by AlliedModders LLC
06 "GunGame:SM Afk Management" (1.1.9.1) by teame06-hat, Liam, Otstrel.ru Team
07 "listen socket example" (1.0.1) by Player
08 "Hide Chat Triggers" (1.0.0.0) by AlliedModders LLC
09 "CS:S DM Preset Spawns" (2.1.4) by AlliedModders LLC
10 "Admin Help" (1.3.8) by AlliedModders LLC
11 "Basic Votes" (1.3.8) by AlliedModders LLC
12 "SM Bot Tools" (1.2) by AMP
13 "Sound Commands" (1.3.8) by AlliedModders LLC
14 "GunGame:SM Config Reader" (1.1.9.1) by teame06-hat, Liam, Otstrel.ru Team
15 "CS:S DM Bot Quotas" (2.1.4) by AlliedModders LLC
16 "SQL Admins (Prefetch)" (1.3.8) by AlliedModders LLC
17 "SM GunGame Buylevel" (1.1) by {cDS} Artsemis
18 "GunGame:SM Map Vote Starter" (1.1.9.1) by teame06-hat, Liam, Otstrel.ru Team
19 "SQL Admin Manager" (1.3.8) by AlliedModders LLC
20 "GunGame:SM Stats" (1.1.9.1) by teame06-hat, Liam, Otstrel.ru Team
21 "RandomCycle" (1.3.8) by AlliedModders LLC
22 "GunGame:SM" (1.1.9.1) by teame06-hat, Liam, Otstrel.ru Team
23 "Reserved Slots" (1.3.8) by AlliedModders LLC
24 "Basic Comm Control" (1.3.8) by AlliedModders LLC
25 "Basic Chat" (1.3.8) by AlliedModders LLC
26 "Welcome Sound" (0.0.1) by R-Hehl
27 "CS:S DM Spawn Protection" (2.1.4) by AlliedModders LLC
28 "Basic Info Triggers" (1.3.8) by AlliedModders LLC
29 "Anti-Rejoin" (2.0.0) by exvel
30 "Kigen's Anti-Cheat" (1.2.2.0) by CodingDirect LLC
31 "Anti-Flood" (1.3.8) by AlliedModders LLC
32 "Basic Commands" (1.3.8) by AlliedModders LLC
33 "CS:S DM Equipment" (2.1.4) by AlliedModders LLC
34 "CS:S DM Preset Spawns" (2.1.4) by AlliedModders LLC
35 "CS:S DM Bot Quotas" (2.1.4) by AlliedModders LLC
36 "CS:S DM Spawn Protection" (2.1.4) by AlliedModders LLC
37 "CS:S DM Basics" (2.1.4) by AlliedModders LLC
38 "SourceBans" (1.4.7) by InterWave Studios Development Team
39 "Fun Commands" (1.3.8) by AlliedModders LLC
40 "CS:S DM Basics" (2.1.4) by AlliedModders LLC
41 "GunGame:SM Display Winner" (1.1.9.1) by bl4nk, Otstrel.ru Team
42 "GunGame:SM TK Management" (1.1.9.1) by teame06-hat, Liam, Otstrel.ru Team
43 "Client Preferences" (1.3.8) by AlliedModders LLC
44 "Roll The Dice" (0.5.4) by ata-clan.de, dataviruset
45 "socket example" (1.1.0) by Player
46 "GunGame:SM Winner Logger" (1.1.9.1) by teame06-hat, Liam, Otstrel.ru Team
47 "GunGame:SM Bot Protection" (1.1.9.1) by teame06-hat, Liam, Otstrel.ru Team
48 "Nextmap" (1.3.8) by AlliedModders LLC
sm_dump_admcache
Admin cache dumped to: /data/steam/srcds_l/orangebox/cstrike/addons/sourcemod/data/admin_cache_dump.txt
Quote:
"Groups"
{
}

"Admins"
{
/* num = 1, aid = 0x0, serialno = 0x2*/
"Krillin"
{
"auth" "steam"
"identity" "XXXXXX"
"password" "*"
"flags" "z"
"immunity" "0"
}

/* num = 2, aid = 0x4A, serialno = 0x15*/
"Prince Vegeta"
{
"auth" "steam"
"identity" "XXXXXX"
"password" "*"
"flags" "abcdefghijklmnopqrs"
"immunity" "0"
}

/* num = 3, aid = 0x9A, serialno = 0x9*/
"BodomChild"
{
"auth" "steam"
"identity" "XXXXXX"
"password" "*"
"flags" "bcdefgjk"
"immunity" "0"
}

/* num = 4, aid = 0xE7, serialno = 0x2*/
"Krillin"
{
"auth" "steam"
"identity" "X:XXXXXX"
"flags" "z"
"immunity" "0"
}

/* num = 5, aid = 0x131, serialno = 0x13*/
"PrinceVegeta"
{
"auth" "steam"
"identity" "X:XXXXXX"
"flags" "bcdefghijklmopqrs"
"immunity" "0"
}
}

"Overrides"
{
}
Here is an MySQL dump of the database.
Quote:
mysql> SELECT * FROM sm_admins s LIMIT 0,1000;
+----+----------+----------+----------+----------------------+---------------+----------+
| id | authtype | identity | password | flags | name | immunity |
+----+----------+----------+----------+----------------------+---------------+----------+
| 1 | steam | XXXXXX | * | z | Krillin | 0 |
| 2 | steam | XXXXXX | * | abcdefghijklmnopqrst | Prince Vegeta | 0 |
| 3 | steam | XXXXXX | * | bcdefgjk | BodomChild | 0 |
+----+----------+----------+----------+----------------------+---------------+----------+
3 rows in set (0.00 sec)
Every time I delete the admins.cfg file, sourcemod creates an new one and this is the the contents of the file.
Quote:
"Admins"
{
"Krillin"
{
"auth" "steam"
"identity" "STEAM_0:X:XXXXXX"
"flags" "z"
"immunity" "100"
}
"PrinceVegeta"
{
"auth" "steam"
"identity" "STEAM_0:X:XXXXXX"
"flags" "bcdefghijklmopqrst"
}
}
So why isn't the third admin not given administration rights as it set by the database? Is there something missing here? Flags required but not mentioned?

(Steam ID's are X-out due to the fact of Steam's EULA for displaying SteamID in clear text is prohibited).

Debian 6.0.1 64Bit Linux Hosted Dedicated Server: P4 DualCore 3.4Ghz 3GB-DDR2-5300

Thanks in Advance,
Krillin

P.S. A temporary fix for this is to add the left out admin(s) into the addons/sourcemod/configs/admins.cfg and mark this file READ-ONLY so the file doesn't get overwritten on map changes.

Last edited by Krillin; 07-13-2011 at 23:18. Reason: [SOLVED] Updated GGM:SM Core & Removed stock map votes. Trying to changelevel to two different maps causing crashes.
Krillin is offline
SuperShadow
SourceMod Donor
Join Date: Jun 2008
Location: Westminster, MD
Old 07-08-2011 , 10:48   Re: MySQL Not Retrieving Admins from sm_admins correctly
Reply With Quote #2

I use Sourcebans for my admins, so I do not have an answer as to why only two are getting rights. But while looking at your evidence, I noticed that the two admins which do get rights one the server are each listed twice in the sm_dump_admcache. Maybe this has something to do with it.
SuperShadow is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-08-2011 , 14:43   Re: MySQL Not Retrieving Admins from sm_admins correctly
Reply With Quote #3

Did you intentionally censor out your admins, or are their IDs really entered into your database as STEAM_0:X:XXXXXX?

I'm hoping you censored them... or that might explain the problem right there.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Krillin
Senior Member
Join Date: Jul 2004
Old 07-08-2011 , 14:47   Re: MySQL Not Retrieving Admins from sm_admins correctly
Reply With Quote #4

Quote:
Originally Posted by SuperShadow View Post
I use Sourcebans for my admins, so I do not have an answer as to why only two are getting rights. But while looking at your evidence, I noticed that the two admins which do get rights one the server are each listed twice in the sm_dump_admcache. Maybe this has something to do with it.
We use a Sourcebans for the most part for the website and databasing bans. Not sure if it is the same sourcebans or not. But the problem is establishing an admin for a player in source without the hassle of always editing the admin.cfg file and marking it read-only. If more are added later, this can get to be a pain in the long run.

It has everything to do with it near as I can see. It looks to me like it is taking the partial steamID of XXXXXX and adding the one prefix to the admin X:XXXXXX. But it shows as not doing this for the third admin.

This has been a problem for over a year. It is time to deal with this now and get it straightened out.

Krillin
__________________
Krillin's World Server(s) Operator


Last edited by Krillin; 07-08-2011 at 14:51.
Krillin is offline
Krillin
Senior Member
Join Date: Jul 2004
Old 07-08-2011 , 14:52   Re: MySQL Not Retrieving Admins from sm_admins correctly
Reply With Quote #5

Quote:
Originally Posted by Powerlord View Post
Did you intentionally censor out your admins, or are their IDs really entered into your database as STEAM_0:X:XXXXXX?

I'm hoping you censored them... or that might explain the problem right there.
Quote:
Originally Posted by Krillin
(Steam ID's are X-out due to the fact of Steam's EULA for displaying SteamID in clear text is prohibited).
SteamID entered in FULL STEAM_0:0:0000000 do not work in MySQL databases. We read somewhere that they have to be entered in with the last suffix if the steamID XXXXXX. But when the mod writes them to the admins.cfg file, they are the FULL and correct steamID. The first admin is STEAM_0:1:XXXXXXX and the second is STEAM_0:0:XXXXXXX. These admins have their rights, it is anyone there after who doesn't get any rights.
__________________
Krillin's World Server(s) Operator


Last edited by Krillin; 07-08-2011 at 14:57. Reason: Full SteamID vs Partial == EPIC FAIL if FULL steamIDs are used in MySQL Database
Krillin is offline
Krillin
Senior Member
Join Date: Jul 2004
Old 07-08-2011 , 15:01   Re: MySQL Not Retrieving Admins from sm_admins correctly
Reply With Quote #6

And by the way. The command SM_REHASH doesn't do anything at all and sm_reloadadmins only works for flat-file?!
__________________
Krillin's World Server(s) Operator

Krillin is offline
SuperShadow
SourceMod Donor
Join Date: Jun 2008
Location: Westminster, MD
Old 07-08-2011 , 17:49   Re: MySQL Not Retrieving Admins from sm_admins correctly
Reply With Quote #7

Quote:
Originally Posted by Krillin View Post
We use a Sourcebans for the most part for the website and databasing bans. Not sure if it is the same sourcebans or not. But the problem is establishing an admin for a player in source without the hassle of always editing the admin.cfg file and marking it read-only. If more are added later, this can get to be a pain in the long run.

It has everything to do with it near as I can see. It looks to me like it is taking the partial steamID of XXXXXX and adding the one prefix to the admin X:XXXXXX. But it shows as not doing this for the third admin.

This has been a problem for over a year. It is time to deal with this now and get it straightened out.

Krillin
There's only one Sourcebans that I know of and information about it can be found in these forums here: http://forums.alliedmods.net/showthread.php?t=61000 and at there own website here: http://www.sourcebans.net/

We use the admin capability built into Sourcebans. We only have to enter it there and it is propigated to all of the servers with group levels we have also configured. It updates admin_groups.cfg and admins.cfg when the map changes or a new admin is added through the Sourcebans interface. There is no need to set anything read only.

Sourcebans also worked out the problem with the Steam_0:0 and Steam_0:1 just after that change was first released. We enter the steam id into the interface as it truely appears to the user and they can then admin the server.

I wonder if you have the two admins that are successfully granted rights set up in Sourcebans and the other one not. Also do you have sgl-admin-manager.smx, admin-sql-prefetch.smx or admin-sql-threaded.smx loading on the server? If you use Sourcebans to manage admins, these three should be in the disabled folder, you only need admin-flatfile.smx in the plugins folder.
SuperShadow is offline
Krillin
Senior Member
Join Date: Jul 2004
Old 07-09-2011 , 20:49   Re: MySQL Not Retrieving Admins from sm_admins correctly
Reply With Quote #8

Holly crap. I was not aware Sourcebans had done this and I need to do something about it. I do not want Sourcebans handling my admins. Sourcebans and its database are running on another server. I just wanted it to track and log bans and allow users to view them or protest them, nothing more.

Thanks for pointing this out!

Open addons/sourcemod/configs/sourcebans/sourcebans.cfg and look for the following setting:
Code:
		// Enable admin part of the plugin (1 = enabled, 0 = disabled)

		"EnableAdmins"			"1"
Change the 1 to 0 to disable.

I am trying this now. I have disabled "EnableAdmin" copied my admins.cfg. and deleted the original admins.cfg restarted the game server. (no luck)

I dumped the database, recreated the database and the tables. Launched my server, then added the three admins to the database via the sm_sql_addadmins command.

Code:
sm_sql_addadmin Krillin "steam" "STEAM_X:X:XXXXXX" z 100 *
[SM] Administrator successfully added to the database.
sm_dump_admcache
Code:
"Groups"
{
}

"Admins"
{
	/* num = 1, aid = 0x0, serialno = 0x2*/
	"Krillin"
	{
		"auth"			"steam"
		"identity"		"X:XXXXX"
		"password"		"*"
		"flags"			"z"
		"immunity"		"100"
	}

	/* num = 2, aid = 0x4C, serialno = 0x13*/
	"=^.^="
	{
		"auth"			"steam"
		"identity"		"X:XXXXXX"
		"password"		"*"
		"flags"			"bcdefghijklmopqrs"
		"immunity"		"100"
	}

	/* num = 3, aid = 0x96, serialno = 0x9*/
	"BodomChild"
	{
		"auth"			"steam"
		"identity"		"X:XXXXXX"
		"password"		"*"
		"flags"			"bcdefgjk"
		"immunity"		"100"
	}
}

"Overrides"
{
}
I get in the server, try to run SM_ADMIN and I get
Code:
[SM] You do not have access to this command.
Back to square one!

Krillin
__________________
Krillin's World Server(s) Operator


Last edited by Krillin; 07-10-2011 at 01:23. Reason: How to disable SourceBan Admin Managment. No Luck with Database with ANY admin at this point.
Krillin is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 07-10-2011 , 09:17   Re: MySQL Not Retrieving Admins from sm_admins correctly
Reply With Quote #9

Try setting "BackupConfigs" to 0 either in sourcebans.cfg.
__________________
Peace-Maker is offline
LordVader!
Member
Join Date: Nov 2009
Old 07-10-2011 , 13:11   Re: MySQL Not Retrieving Admins from sm_admins correctly
Reply With Quote #10

Quote:
Originally Posted by Krillin View Post
And by the way. The command SM_REHASH doesn't do anything at all and sm_reloadadmins only works for flat-file?!
I use sm_reloadadmins all the time and I have an SQL only setup.
__________________
ClanAO.com
LordVader! 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 05:25.


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