ULX

Author Topic: ULX Settings Not Saving  (Read 8809 times)

0 Members and 4 Guests are viewing this topic.

Offline PossessiveDemon

  • Newbie
  • *
  • Posts: 7
  • Karma: 1
ULX Settings Not Saving
« on: May 10, 2016, 06:49:20 AM »
This sub-forum is only for help or discussion regarding projects created by Team Ulysses. If you are requesting help, please search the forums FIRST to make sure your question has not already been answered. If you still need help, fill in the following information.

My ULib/ULX versions (run "ulx version" in console):
ULib v2.60
ULX v3.70


Game mode(s) I am having this problem on:

DarkRP

Lua errors shown in console, if any:

None.



I looked at the config.txt, and all it contained was "lol".
I changed the MOTD in game, and it added the MOTD option, but "lol" was still there.

After a reboot, my ULX settings go back to how they were.
I mean like, group inheritance, command access, etc.
I honestly don't know why..

Now, I know the title is the same as others, but I'm on about the MOTD, not sbox_ variables.

Thanks in advance.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: ULX Settings Not Saving
« Reply #1 on: May 10, 2016, 09:38:24 AM »
You're saying that your server's data\ulx\config.txt file contained nothing but "lol"? But when you changed the MOTD setting, it contained 'lol' plus the newly changed MOTD line underneath it?

If that is the case, it sounds like you have a rouge addon that's messing with your config file (or someone has gotten access to your FTP/RCON). Does the MOTD setting go away (the config.txt gets reset to 'lol') on mapchange or when you reboot your server? One thing to try right away is to remove all of your addons except ULX/ULib, and see if the config file keeps getting reset to 'lol'.
« Last Edit: May 10, 2016, 09:45:21 AM by Stickly Man! »
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline PossessiveDemon

  • Newbie
  • *
  • Posts: 7
  • Karma: 1
Re: ULX Settings Not Saving
« Reply #2 on: May 10, 2016, 09:51:14 AM »
You're saying that your server's data\ulx\config.txt file contained nothing but "lol"? But when you changed the MOTD setting, it contained 'lol' plus the newly changed MOTD line underneath it?

If that is the case, it sounds like you have a rouge addon that's messing with your config file (or someone has gotten access to your FTP/RCON). Does the MOTD setting go away on mapchange or when you reboot your server? One thing to try right away is to remove all of your addons except ULX/ULib, and see if the config file keeps getting reset to 'lol'.

To your first part, that's exactly right.

MOTD goes away after a mapchange/restart/etc.
I've tried editing it to the default config.txt, rebooted, and it goes back to "lol".
It's stressing me out, but as we speak, I'm downloading the files, rather than having to delete addons and then the player's times resetting.

Also, is there a file that keeps note of the player's playtime?

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: ULX Settings Not Saving
« Reply #3 on: May 10, 2016, 10:20:31 AM »
If you're talking about UTime data, that should be stored in the SQLLite database in the garrysmod root called 'sv.db', which contains a lot of other data (for DarkRP, etc.) as well.

You definitely have some bit of code that's resetting the ulx_config.txt. Workshop addons are harder to look through, but you can quickly search through addons in your garrysmod\addons folder- You can do a find in files to look for lines containing "file.write(", then filter those to see any lines that mention ulx_config.txt. Alternately, you could just keep disabling addons one by one until it stops overwriting the config. It's a tedious process, but do let us know what you find.
« Last Edit: May 10, 2016, 10:22:04 AM by Stickly Man! »
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: ULX Settings Not Saving
« Reply #4 on: May 10, 2016, 10:21:24 AM »
Also, is there a file that keeps note of the player's playtime?
Player data (including playtime recorded by UTime) is stored in the SQLite database file for Garry's Mod servers, or /sv.db.

ninja'd :(
bw81@ulysses-forums ~ % whoami
Homepage

Offline PossessiveDemon

  • Newbie
  • *
  • Posts: 7
  • Karma: 1
Re: ULX Settings Not Saving
« Reply #5 on: May 10, 2016, 10:26:09 AM »
If you're talking about UTime data, that should be stored in the SQLLite database in the garrysmod root called 'sv.db', which contains a lot of other data (for DarkRP, etc.) as well.

You definitely have some bit of code that's resetting the ulx_config.txt. Workshop addons are harder to look through, but you can quickly search through addons in your garrysmod\addons folder- You can do a find in files to look for lines containing "file.write(", then filter those to see any lines that mention ulx_config.txt. Alternately, you could just keep disabling addons one by one until it stops overwriting the config. It's a tedious process, but do let us know what you find.

UTime data, that's it, thank you.
I'm currently downloading 2.8GB of data, then I'm going to do a file search, as you said.
Would I just have to use the Windows search, or use an external program?
What would be best?

I would do that, but I have like, 20 players on at the moment.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: ULX Settings Not Saving
« Reply #6 on: May 10, 2016, 10:45:52 AM »
Understandable. Windows Grep is a good tool that does the job efficiently: http://www.wingrep.com/, but you can also search windows for *.lua, drag all the files into your editor of choice (Notepad++, Sublime, etc.), then use their "find in all open files" feature.

Secondly, if you find the .gma files for your workshop addons, you can extract them manually and then search through them as well. See this guide here: https://steamcommunity.com/sharedfiles/filedetails/?id=431638110

There is an addon made by a member on the forums that can search your lua files on the server while it is running. It mainly detects specific lua keywords/functions that could potentially cause you problems. Unfortunately, it is not set up to detect file.write, which is what we are most likely looking for.
http://forums.ulyssesmod.net/index.php?topic=8477.0

I should also note that you may want to take a peek in your server's garrysmod\lua\autorun folder- there are a lot of files in there that are important for gmod, but somebody may have snuck something unwanted in there.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline PossessiveDemon

  • Newbie
  • *
  • Posts: 7
  • Karma: 1
Re: ULX Settings Not Saving
« Reply #7 on: May 10, 2016, 11:40:10 AM »
Understandable. Windows Grep is a good tool that does the job efficiently: http://www.wingrep.com/, but you can also search windows for *.lua, drag all the files into your editor of choice (Notepad++, Sublime, etc.), then use their "find in all open files" feature.

Secondly, if you find the .gma files for your workshop addons, you can extract them manually and then search through them as well. See this guide here: https://steamcommunity.com/sharedfiles/filedetails/?id=431638110

There is an addon made by a member on the forums that can search your lua files on the server while it is running. It mainly detects specific lua keywords/functions that could potentially cause you problems. Unfortunately, it is not set up to detect file.write, which is what we are most likely looking for.
http://forums.ulyssesmod.net/index.php?topic=8477.0

I should also note that you may want to take a peek in your server's garrysmod\lua\autorun folder- there are a lot of files in there that are important for gmod, but somebody may have snuck something unwanted in there.

I've gone through all of it, and there's nothing that relates to the config.txt.
Nothing that writes to it, and I've gone through the code of every .gma and through the lua/autorun; addons; data, etc.
This is stressing me out, aha.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: ULX Settings Not Saving
« Reply #8 on: May 10, 2016, 11:51:23 AM »
Try searching for both "file.write" (with regular expressions disabled), as well as "fileWrite"

New plan: Modify the following lines in ULX code and change "config.txt" to something else, say "config_alt.txt"
https://github.com/TeamUlysses/ulx/blob/master/lua/ulx/base.lua#L95
https://github.com/TeamUlysses/ulx/blob/master/lua/ulx/data.lua#L74

Then, on mapchange, a new config file should be generated. See if that one persists and can have settings saved to it, and doesn't get overwritten with 'lol'. If that works, then you will need to dig deeper to find the call that overwrites the file. If the newly named file gets changed to "lol", then there might be a bug someone is abusing with the config saving code, and we'll need to look into it further.

One more thought- do you have sv_allowupload or sv_allowcslua enabled? I'm curious if one of your active/online players is causing trouble...
« Last Edit: May 10, 2016, 11:54:44 AM by Stickly Man! »
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline PossessiveDemon

  • Newbie
  • *
  • Posts: 7
  • Karma: 1
Re: ULX Settings Not Saving
« Reply #9 on: May 10, 2016, 02:51:07 PM »
Try searching for both "file.write" (with regular expressions disabled), as well as "fileWrite"

New plan: Modify the following lines in ULX code and change "config.txt" to something else, say "config_alt.txt"
https://github.com/TeamUlysses/ulx/blob/master/lua/ulx/base.lua#L95
https://github.com/TeamUlysses/ulx/blob/master/lua/ulx/data.lua#L74

Then, on mapchange, a new config file should be generated. See if that one persists and can have settings saved to it, and doesn't get overwritten with 'lol'. If that works, then you will need to dig deeper to find the call that overwrites the file. If the newly named file gets changed to "lol", then there might be a bug someone is abusing with the config saving code, and we'll need to look into it further.

One more thought- do you have sv_allowupload or sv_allowcslua enabled? I'm curious if one of your active/online players is causing trouble...

Renaming the files worked.
I couldn't find anything code wise that was writing to the config.txt, or to the ULX folder at all.
I searched the .GMA's and I searched the server files.

I have another problem, though should I create a new thread for that?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Settings Not Saving
« Reply #10 on: May 10, 2016, 03:25:12 PM »
PossesiveDemon, we only provided a work around.
You still have the same exact problem.
You have an exploit on your server.

It's likely possible it could affect more than just ULX.
Sorry for the bad news, but, you're not fixed.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline PossessiveDemon

  • Newbie
  • *
  • Posts: 7
  • Karma: 1
Re: ULX Settings Not Saving
« Reply #11 on: May 10, 2016, 03:33:40 PM »
PossesiveDemon, we only provided a work around.
You still have the same exact problem.
You have an exploit on your server.

It's likely possible it could affect more than just ULX.
Sorry for the bad news, but, you're not fixed.

Server is rebooting every 5 minutes.
Code: [Select]
5/10/2016 6:34:47 PM Stop SYSTEM 127.0.0.1 Monitoring (max query not responding) script
5/10/2016 6:34:50 PM Start SYSTEM 127.0.0.1 Monitoring (max query not responding) script
5/10/2016 6:34:56 PM Restart SYSTEM 127.0.0.1 Monitoring (max query not responding)

I'm adding every addon one by one.
I'm losing my patience.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: ULX Settings Not Saving
« Reply #12 on: May 10, 2016, 03:40:30 PM »
I have another problem, though should I create a new thread for that?

It would be a good idea.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline PossessiveDemon

  • Newbie
  • *
  • Posts: 7
  • Karma: 1
Re: ULX Settings Not Saving
« Reply #13 on: May 10, 2016, 06:35:55 PM »
PossesiveDemon, we only provided a work around.
You still have the same exact problem.
You have an exploit on your server.

It's likely possible it could affect more than just ULX.
Sorry for the bad news, but, you're not fixed.

I removed everything, put it back in, and it's all good now.

Reboot issues were to do with the server.cfg, same as why the console wasn't working.

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: ULX Settings Not Saving
« Reply #14 on: May 12, 2016, 12:56:08 PM »
Did you ever happen to identify the rogue addon? What were your addons on the server before, compared to the addons on your server now?
I cry every time I see that I am not a respected member of this community.