Ulysses

Ulysses Stuff => Releases => Ulysses Release Archives => Topic started by: Beast on February 11, 2016, 07:30:52 PM

Title: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Beast on February 11, 2016, 07:30:52 PM
As if my last implementation wasn't enough, here comes the crown of the Utime modules.

This is meant to put down the need for any other Utime module, whether it be MySQL or just the default!  This addon trumps them both with it's additions and ability for future expansion.

What's So "Ultimate"?
- Well, with the help of FPjte's MySQLite module, there is now support for MySQL via tmysql4 and mysqloo as well as local SQLite storage.
- Adapted from my previous iteration, uploading of current data to a MySQL database.
- Ability to add two new columns if using SQLite - Allows for people to make addons that can use the Utime data.
- Fixed joining message.
- Addition of two columns (SteamID and Playername) - Players are still traced by UniqueID to make use of previous data, however it now can be expanded with the SteamID implementation.

Installation:
- Drag and drop into addons
- Configure sh_utime_config.lua

Notes:
- Using this will clear your server entirely as well as place a password on it.  A [MAINTENANCE] tag will be placed in front of of your hostname to inform players of what is going on.
- Use the readme.txt for full instructions!

Support:
This addon comes as is!  I will not be providing direct support to any of the users, however, I will still be fixing bugs and taking community input for the addon.

Make sure that you read the readme.txt before posting for any sort of help on here!

https://github.com/xbeastguyx/Utime-Ultimate (https://github.com/xbeastguyx/Utime-Ultimate)
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: monkeymacman on February 13, 2016, 06:56:55 AM
Wait... So on UTime MySQL at some point you said "removed pointless Steam ID and playername columns" but in here you say "added steamid and playername columns" as a good thing? I'm confused, also, I'm not understanding, what's the difference?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: roastchicken on February 13, 2016, 08:15:07 AM
Not sure why he would remove SteamID's, but the reason to have them is because A) uniqueids can only be found for online players and B) uniqueids sometimes collide (two players with the same uniqueid), steamids never collide
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Beast on February 16, 2016, 12:59:09 PM
Originally I thought those columns weren't needed, as I was thinking for strictly having data storage, not displaying the data.

UniqueID is only good for data storage, however you cannot trace people's names from it nor their Steam ID.

I added them back for the ability to expand and use this with other addons.  This means that anyone with some knowledge can query from the UTime database and figure out which player they're grabbing data from versus just some numbers.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Angrypygmy on February 18, 2016, 02:04:53 AM
I'm not sure if this was intended for a specific reason, but all of the database information is in a shared file. This seems like quite a scary exploitable security issue, since clients can get a hold of shared files rather easily if they know what they're doing. Please do correct me if i'm wrong here. Just figured i'd point this out to anyone who decides to use this.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Megiddo on February 18, 2016, 04:20:56 AM
Great attention to potential problems angrypygmy. That would be a security problem if it was shared with the clients. However, reviewing the code, it doesn't seem like it's actually shared, regardless of the 'sh_' prefix which is just convention.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Luk | twitch.tv/doctorluk on February 20, 2016, 01:47:09 PM
Does this allow UTF-8 encoded names within the MySQL table?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: ?????? ????? on February 21, 2016, 02:41:07 PM
Not working, completely. Easier to use the standard utime and your mysql module, you screwed up, specifically
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Beast on February 22, 2016, 02:16:27 PM
Not working, completely. Easier to use the standard utime and your mysql module, you screwed up, specifically

How doesn't it work?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Beast on February 22, 2016, 02:17:29 PM
Great attention to potential problems angrypygmy. That would be a security problem if it was shared with the clients. However, reviewing the code, it doesn't seem like it's actually shared, regardless of the 'sh_' prefix which is just convention.

I'll rename it and do a little check to ensure safety.

Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Buzzkill on February 24, 2016, 04:54:34 AM
Does it support the notion of a "global" time?  (ie, individual times for multiple servers plus a global time across all servers).  Since it's the "ultimate", I would hope so.   ;)
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: seabeds on March 03, 2016, 09:22:55 AM
Silly question, it wouldn't be possible to migrate time for players from the previous version, would it?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: wafflecopta on March 09, 2016, 12:27:05 AM
Whilst MySQLite is reall quite good for database manipulations, the issue is that it is already included by default into DarkRP, and since MySQLite uses a global table (MySQLite) it will clash with the currently pre-existing MySQLite. Of course Falco negated this by doing:
Code: [Select]
if moduleLoaded or not MySQLite_config or not MySQLite_config.EnableMySQL then return end
But at best this means that this addon will use the DarkRP database, or DarkRP will use this database.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Bite That Apple on March 10, 2016, 03:00:28 AM
Silly question, it wouldn't be possible to migrate time for players from the previous version, would it?

According to what I read, this does that.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Marz on March 13, 2016, 06:00:02 AM
[ERROR] addons/utime-ultimate-master/lua/autorun/sv_utime.lua:26: attempt to call method 'Query' (a nil value)
  1. fn - addons/utime-ultimate-master/lua/autorun/sv_utime.lua:26
   2. unknown - addons/ulib-master/lua/ulib/shared/hook.lua:110

I've tried everything at 12am, I can't be stuffed trying to fix it. Just asking for a little help?

EDIT: I have tried mysqloo and tmysql. Nothing is working at this point.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Belly136 on March 29, 2016, 12:03:40 PM
Same problem here. Are you going to fix this ?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Beast on March 31, 2016, 10:35:57 AM
I need more details as to what your problem is.

What gamemode are you running?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Buzzkill on April 01, 2016, 05:44:11 AM
Code: [Select]
-- Start timer
+ RunConsoleCommand( "bot" )

There are a number of ways to get timers to start running on startup.  Adding a bot to someone's server probably isn't the best way, as you're now extending way beyond the purpose of the addon  (that is -- people might get rightfully annoyed that an addon designed to track user time is suddenly spawning bots).

Just my $.02


Code: [Select]
RunConsoleCommand( "sv_password", math.random( 1, 999999 ) ) -- This prevents people from joining and tampering with data
RunConsoleCommand( "hostname", "[MAINTENANCE] " .. GetHostName() )


Whoa.  Saw this after I commented above.  This is a little dangerous.  What if someone who doesn't appreciate what's going on runs this and it dies in the middle?  You now have a server that is unexpectedly password protected until someone either restarts the server or clears the password.  Fairly trivial for most - but certainly not for everyone.

At least give people the option for this kind of extra functionality and make the default off.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Belly136 on April 02, 2016, 12:56:28 AM
I need more details as to what your problem is.

What gamemode are you running?

https://steamcommunity.com/sharedfiles/filedetails/?id=135509255 (https://steamcommunity.com/sharedfiles/filedetails/?id=135509255)
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Beast on April 09, 2016, 12:27:47 AM
Code: [Select]
-- Start timer
+ RunConsoleCommand( "bot" )

There are a number of ways to get timers to start running on startup.  Adding a bot to someone's server probably isn't the best way, as you're now extending way beyond the purpose of the addon  (that is -- people might get rightfully annoyed that an addon designed to track user time is suddenly spawning bots).

Just my $.02


Code: [Select]
RunConsoleCommand( "sv_password", math.random( 1, 999999 ) ) -- This prevents people from joining and tampering with data
RunConsoleCommand( "hostname", "[MAINTENANCE] " .. GetHostName() )


Whoa.  Saw this after I commented above.  This is a little dangerous.  What if someone who doesn't appreciate what's going on runs this and it dies in the middle?  You now have a server that is unexpectedly password protected until someone either restarts the server or clears the password.  Fairly trivial for most - but certainly not for everyone.

At least give people the option for this kind of extra functionality and make the default off.

If you read the readme it specifies that it's going to do all of that.  I'm just having it do that so I don't have people getting annoyed by data becoming corrupt and complaining about it.
As for the bot, I did that as a hacky quick method to start tick in the case that you run this addon upon server start.  If you'd looked through carefully, that's only on the code to upload data to the MySQL database, it's not used in any other circumstances.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Belly136 on April 09, 2016, 01:52:55 AM
I tested the script on most gamemodes and got the same error.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Buzzkill on April 09, 2016, 05:09:52 AM
If you read the readme

I assume you mean the OP, and not the actual readme (your readme.md on github), since that's only a few bullets and mentions nothing about the lockdown.  I do see your reference to it in the OP now, but I still think it should be off by default.  Just my $.02.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: JamminR on April 09, 2016, 05:31:44 AM
This addon hides it's readme.txt pretty deep into the folder structure.
https://github.com/xbeastguyx/Utime-Ultimate/blob/master/lua/readme.txt

Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Buzzkill on April 09, 2016, 01:53:19 PM
Ah.  Silly me.  I should have grep'd the project.   :)
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Beast on April 12, 2016, 07:56:10 PM
Pushed an update that should fix the errors.  Me being the idiot I am, I left the github version oudated, while I used the updated version myself.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Beast on August 24, 2016, 04:59:25 AM
Just a warning for everyone having issues, I'll be rewriting this soon.  The rewrite should fix all issues previously found.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Marz on August 24, 2016, 05:33:26 AM
Just a warning for everyone having issues, I'll be rewriting this soon.  The rewrite should fix all issues previously found.
\

I love you for keeping this alive and still wanting to work on it.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: TheHeroBilly on August 29, 2016, 03:51:39 PM
The command "UploadUtime" doesn't exist. Or at least so says console and Rcon. any ideas?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Marz on August 29, 2016, 03:54:17 PM
The command "UploadUtime" doesn't exist. Or at least so says console and Rcon. any ideas?

Are you 100% sure you're doing it through Rcon since it is a server side command?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: TheHeroBilly on August 29, 2016, 04:06:17 PM
Yes I am. the full command I put is "rcon UploadUtime" I've also tried running it from the actual server console. and not the ingame console.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Marz on August 29, 2016, 04:06:58 PM
Yes I am. the full command I put is "rcon UploadUtime" I've also tried running it from the actual server console. and not the ingame console.

Are you adding the Rcon part when running it from the server console?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: TheHeroBilly on August 29, 2016, 04:11:24 PM
no, only from in game.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: TheHeroBilly on August 29, 2016, 04:16:23 PM
So I scoured the console looking for errors, I found this:

Code: Lua
  1. [ERROR] addons/utimeultimate/lua/autorun/sv_utime.lua:5: attempt to index global 'UTime' (a nil value)
  2.   1. unknown - addons/utimeultimate/lua/autorun/sv_utime.lua:5

Fixed that issue. Did not fix the missing command issue.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Marz on August 30, 2016, 06:10:51 AM
So I scoured the console looking for errors, I found this:

Code: Lua
  1. [ERROR] addons/utimeultimate/lua/autorun/sv_utime.lua:5: attempt to index global 'UTime' (a nil value)
  2.   1. unknown - addons/utimeultimate/lua/autorun/sv_utime.lua:5

Fixed that issue. Did not fix the missing command issue.

Wanna hit me up on Steam? www.steamcommunity.com/id/marzimain and I'll check it out with you when i wake up?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: roastchicken on August 30, 2016, 11:38:55 AM
So I scoured the console looking for errors, I found this:

Code: Lua
  1. [ERROR] addons/utimeultimate/lua/autorun/sv_utime.lua:5: attempt to index global 'UTime' (a nil value)
  2.   1. unknown - addons/utimeultimate/lua/autorun/sv_utime.lua:5

Fixed that issue. Did not fix the missing command issue.

What did you do to "fix that issue"?
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: TheHeroBilly on August 31, 2016, 08:22:20 AM
What did you do to "fix that issue"?
I was still uploading files when I started the server, I just restarted it and it fixed it.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Bite That Apple on August 31, 2016, 07:23:43 PM
[ERROR] addons/utime-ultimate-master/lua/autorun/sv_utime.lua:26: attempt to call method 'Query' (a nil value)
  1. fn - addons/utime-ultimate-master/lua/autorun/sv_utime.lua:26
   2. unknown - addons/ulib-master/lua/ulib/shared/hook.lua:110

I've tried everything at 12am, I can't be stuffed trying to fix it. Just asking for a little help?

EDIT: I have tried mysqloo and tmysql. Nothing is working at this point.

That sounds to me like you're missing mysqloo, or at least the correct version of it.

Use this one: https://facepunch.com/showthread.php?t=1357773 and at the bottom of the original post, download the Windows DLL + libmysql (unless of course you're running on a linux machine). Then place the gmsv_mysqloo_win32.dll in server garrysmod/lua/bin (sometimes the folder does not exist, so you will have to make it). The libmysql goes in the same directory the srcds.exe (or w/e you use to launch your server) directory is located.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: Beast on September 24, 2016, 12:09:59 PM
Sorry I haven't pushed anything new to it.  I'd advise against using it for now since the mysqlite module is kinda weird.  I'll be putting in my own module once I get some free time.
Title: Re: Utime - Ultimate Edition [Who needs other versions now?]
Post by: JamminR on September 24, 2016, 06:59:00 PM
<Clip>I'd advise against using it
<clip>once I get some free time.
Beast, want us to move it to release archives until you update it?
It will lock it, but we can move it back if you message any of us admins.