Closed ghost closed 3 years ago
Bump
I also have this problem, my ranks seem to also not save to the database even though connection is completely fine. Would be great if someone could find a solution to this.
Do the ranks save to the database? Or does it not even get that far?
I updated xAdmin, and now it seems to work on the database. But now when I join the server my rank resets. Is there some sort of function that is making the players rank reset to default on spawn?
xAdmin.Database.GetUsersGroup(ply:SteamID64(), function(data) print(data[1].rank) end)
This seems to always print "user" inside PlayerInitialSpawn.
Only on PlayerInitialSpawn? Called post join does it load the correct rank??
Make sure you have mySQLoo installed, I had this issue too a while back
Although a very valid and important thing (Ensuring the latest version of MySQLOO is installed correctly), I'm pretty sure your entire server will error out if it's not.
Seeing as it was the only mysql dependant addon on the server, It wasnt causing any other issues from what I noticed. Although it was a few months back so I may not remember correctly.
If you try to use sqlite it does not save ranks - I've been having this issue too.
Make sure you have mySQLoo installed, I had this issue too a while back
It works fine if you use mysqloo as opposed to using a file database?
Make sure you have mySQLoo installed, I had this issue too a while back
It works fine if you use mysqloo as opposed to using a file database?
Well if you're using a database I'm pretty sure mysqloo is required, for xAdmin at least.
xAdmin has supported SQLite for a short while now. Your report of the bug being SQLite caused is rather interesting, I'll have a dig and get back to you.
Try using lua_run to DROP all xadmin related tables and try again. I believe this fixed the issue for someone else that had this issue.
I'm also facing this problem, even with mysql on a clean server. If i install darkrp with fadmin this problem fixed. If you print every query, you will see that something overrides the ranks with user.
`xadmin setgroup Habo superadmin You have updated Habo's usergroup to: superadmin INSERT INTO svr1_users (userid, "rank") VALUES ('76561198008925721', 'superadmin') ON DUPLICATE KEY UPDATE "rank"='superadmin';
INSERT INTO svr1_users (userid, "rank") VALUES ('76561198008925721', 'superadmin') ON DUPLICATE KEY UPDATE "rank"='superadmin';
L 12/15/2020 - 17:39:17: "Habo<3>
I'm also facing this problem, even with mysql on a clean server. If i install darkrp with fadmin this problem fixed. If you print every query, you will see that something overrides the ranks with user.
Yes, I just did some investigating pulling the sv.db at various times. When a user is set to a group, the group is written correctly to the sqlite db, but once the user leaves the server the group is reset to user.
I'm also facing this problem, even with mysql on a clean server. If i install darkrp with fadmin this problem fixed. If you print every query, you will see that something overrides the ranks with user.
Yes, I just did some investigating pulling the sv.db at various times. When a user is set to a group, the group is written correctly to the sqlite db, but once the user leaves the server the group is reset to user.
i edited my post and added the console response:
INSERT INTO svr1_users (userid, "rank") VALUES ('76561198008925721', 'user') ON DUPLICATE KEY UPDATE "rank"='user'; SELECT * FROM svr1_users WHERE userid='76561198008925721';
it inserts the user rank before loading the rank
Anyone find a fix or a way to purge the database when not running on mySQLoo, I tried using mySQLoo to try and fix the issue but there seems to be an even bigger issue with that.
lua_run sql.Query("DROP TABLE svr1_users")
Try running that in console, it should drop the table for users n stuff, then just restart your server
Even after I started using mySQLoo and not mySQLite this is still a persisting issue. When people leave and rejoin they do keep their ranks, but once the server restarts they are a user. I can also check the database and the users are all still there but the ranks change after a restart.
Even after I started using mySQLoo and not mySQLite this is still a persisting issue. When people leave and rejoin they do keep their ranks, but once the server restarts they are a user. I can also check the database and the users are all still there but the ranks change after a restart.
I assume you're using DarkRP? If so, try disabling FAdmin. I think you can do it within darkrpmodification.
I assume you're using DarkRP? If so, try disabling FAdmin. I think you can do it within darkrpmodification.
I am using DarkRP, but I have had FAdmin disabled and enabled. What's weird is with it enabled it resets ranks on rejoining, but with it disabled it resets on the server restart. Also sorry for the late response.
Edit: I have also taken a look at the databasing code and didn't see anything wrong, but I could've missed something.
so what do i have to do to fix this issue?
so what do i have to do to fix this issue?
Try disabling fAdmin.
so what do i have to do to fix this issue?
Try disabling fAdmin.
Alright ill check now
It unfortunately did not work.
This also happens to me, clean installation of DarkRP with fAdmin disabled.
So I finally figured out why this happens. When a player joins the server, gmod internally runs ply:SetUserGroup( "user" )
on join. Depending on how your server loads files, this will sometimes cause xAdmin's implementation of :SetUserGroup
to force your rank to user.
If I set my rank or a friends rank to admin / superadmin and they rejoin the server or it restarts, our ranks aren't saved. We don't use MySQL.