FPtje / DarkRP

DarkRP, a non-serious roleplay gamemode for Garry's Mod.
https://darkrp.miraheze.org
MIT License
462 stars 707 forks source link

[Issue] SQL tables are still not saving information #922

Closed Shigbeard closed 11 years ago

Shigbeard commented 11 years ago

Description:

SQLite tables do not save information apart from wallets. Restricted tools, blacklisted props and FAdmin ranks are lost on reconnect/restart.

Reproducing:

On a vanilla server, start up DarkRP and make a few changes to tools, etc. Set yourself root, restrict say the baloon tool to SA only, restart the server. When the server is back up, you will be a user again, and the tool will be unrestricted again.

Errors:

None present.

FPtje commented 11 years ago

Duplicate issue and I still can't reproduce it.

Shigbeard commented 11 years ago

Duplicate issue because its happening in more places. Before it was just FAdmin, now its tool groups too.

This DOES NOT happen for remote databases though, and this was a completely new server.

The only thing i can think is causing it is a lack of a libMySQL.dll or mysqloo module...

FPtje commented 11 years ago

Duplicate issue is never justified.

Shigbeard commented 11 years ago

Ugh, fine, ill go ditto this info into the old issue, will that make you happy?

FPtje commented 11 years ago

You have no new information besides "shit fucked up even more"

It works for everyone else.

FPtje commented 11 years ago

Queries error when they fail You report no errors, therefore the queries do not fail. The queries succeed, so if they're not stored in the database, it's probably your fault.

Shigbeard commented 11 years ago

it works for everyone else.

It doesnt work for me on a freshly installed server.

It doesn't work for my friend on a freshly installed server.

It doesn't work for me again on another freshly installed server.

It doesn't work for that guy at #907

Shigbeard commented 11 years ago

How can it be my fault when the damn thing is Vanilla? The only thing i put on it was DarkRP! And that loads just fine as far as i can tell, only it will not save these bits of info!

Shigbeard commented 11 years ago

If it throws an error on a failed query... but this isn't throwing an error, then perhaps its not even performing the query. Ever thought that may be the case? This is the same thing in all essence that happened at #868

FPtje commented 11 years ago

Guess I'll reinstall the game to test this

Shigbeard commented 11 years ago

A reinstalled game shouldn't be required. Just reinstall a dedicated server and only throw darkrp into it.

and dont use remote databases or anything, or any modules for remote databases either.

Bo98 commented 11 years ago

Unless it's something weird with dedicated servers, it's fine for me too.

FPtje commented 11 years ago

That's going to cost me all day. I'm using a listen server.

FPtje commented 11 years ago

Problems like this can happen if sv.db is write locked or not write accessible for gmod.

Shigbeard commented 11 years ago

And I would think the same way FPtje, if it weren't for the fact that wallets and RP names save though...

FPtje commented 11 years ago

Works for me.

Shigbeard commented 11 years ago

Still not working for me... im just gathering EVERY piece of info that may help you INCLUDING a full console.log...

Although im sure you will see that there is still visably nothing wrong except for some reason, I wont have rank on reconnect.

Shigbeard commented 11 years ago

http://puu.sh/41JTm.db - My sv.db before I start my server.

http://puu.sh/41JZu.db - My sv.db immidately after everything has started up (but before I connect)

http://puu.sh/41K5A.db - My sv.db immediately after connection.

http://puu.sh/41K9P.db - sv.db after setting myself to root and setting duplicator to superadmin only.

http://puu.sh/41KbS.db sv.db after shutting down through the quit command in the server console

http://puu.sh/41KdO.log the server log. Everything visible in my server console is visible there.

http://pastebin.com/RynR9NpT My clients console output from connection to now.

Bo98 commented 11 years ago

Looks like a load issue rather than a save issue.

Log (for Steam ID): L 08/14/2013 - 18:51:08: "Scorn<2><STEAM_0:1:68209808><>" entered the game

Every database file you sent says:

FAdmin_PlayerGroups
----
BOT                   user
STEAM_0:1:68209808    superadmin
Bo98 commented 11 years ago

Oh, and for that duplicator admin thing:

FPP_TOOLADMINONLY
---
duplicator             2

2 is superadmin I believe.

Shigbeard commented 11 years ago

Ok so its saving right... now lets see what happens when I load again

Shigbeard commented 11 years ago

http://puu.sh/41L7G.db - havent connected yet

http://puu.sh/41L9m.db - Connected

Noclip wont work...

] lua_run_cl print(LocalPlayer():GetNWString("usergroup")) user

Ragequit...

http://puu.sh/41LdN.db database after quit

http://puu.sh/41Les.log server log

http://pastebin.com/6jSsQggk client console

Also duplicator didnt work, however didn't read as being blocked per-say

Bo98 commented 11 years ago

Good news. I've managed to reproduce this. I'll submit a PR if I find the issue.

Shigbeard commented 11 years ago

See Falco? I was right all along!

Bo98 commented 11 years ago

I had to setup a dedicated server to reproduce it however, and it only affects FPP and FAdmin.

FPtje commented 11 years ago

And this bugreport was still posted as duplicate with much too little information

Shigbeard commented 11 years ago

I give up on you FPtje. Its quite obvious this is happening. I've shown it, your top contributor has confirmed to have replicated it, and 99% of DarkRP server's are not listen servers, so why test for listen servers?

My point being, is that there is little information to provide apart from FAdmin and FPP will not read from sv.db on a dedicated server... but WILL read from a remote MySQL source.

And I will even copy that in every other bug report detailing the same issue if that will solve your problem about duplicate reports.

FPtje commented 11 years ago

I had nothing to reproduce the issue. If there's a difference between listen servers and dedicated servers, Garry is most likely the cause. Their behaviour should be exactly the same.

Testing on a dedicated server is significantly more effort, and with the assumption that their behaviour is the same, I choose to test on listen servers.

Shigbeard commented 11 years ago

assumption that their behaviour is the same...

Yet in your own code, somewhere in the database files, i cant remember where, but i remember reading a comment saying something like this:

On a listen server, the host will walk around for a while with no data...

And how is testing on a dedicated server more effort? If anything its less!

I think what you are actually trying to say FPtje, is that you just CBF'd installing a dedicated server to test on.

And It cannot be that garry fucked up. Because I know of other servers running older versions of darkrp (before you went over the whole data.lua file changing all the commands around) that do not have this issue, and they are dedicated servers.

The only thought I have right now is perhaps the changes you made mean that people require the libmysql file and/or mysqloo no matter what. I'm going to start up my dedicated server now and see if that will fix it.

Bo98 commented 11 years ago

(Redfiend) Because I know of other servers running older versions of darkrp (before you went over the whole data.lua file changing all the commands around) that do not have this issue

The data.lua changes are not the cause.

(Redfiend) And It cannot be that garry fucked up.

You're right about him not "fucking up". However,

(FPtje) Garry is most likely the cause

Garry is the cause. He's not to blame though. Garry has his own auth system that sets the user group from settings/user.txt before the FAdmin's PlayerInitialSpawn is called. Because of eaa59d79453a89987c732b9818a1ce6ed3cc6791, this replaces the usergroup in the database so when we come around to here, the database has the "user" group under the Steam ID.

I've fixed this. See #924. One thing about it is if anybody's using settings/user.txt then it will not work anymore, though I'm not sure if it even worked in the first place with FAdmin. If it did, and you want to keep compatibility, I'll add a commit of compatibility.

I've not had a look at the FPP issue but that goes in the other repo anyway.

Bo98 commented 11 years ago

FPP works fine for me. Make sure you aren't basing your evidence off of the "edit multiple tools" button but rather the "edit/view selected tool" button.

Shigbeard commented 11 years ago

Yay. I knew something was not right.

But IDK why FPP wasn't working...

OH wait never mind, i see what was happening with FPP. Just some bigotry with a box unticked.