ULX

Author Topic: UCL to SQL Discussion  (Read 6074 times)

0 Members and 1 Guest are viewing this topic.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: UCL to SQL Discussion
« Reply #15 on: August 08, 2017, 02:39:00 PM »
It's been a while...

I was bored today and I wanted to work on a Garry's Mod project involving SQL, so I came back to this topic to look at how I structured the tables. I was inspired to take up this project again, which brings me to the purpose of this post.

I've been digging around in ucl.lua and noticed that ULib allows for users to be added by IP or UniqueID, and that it also uses UniqueID internally in at least one place to distinguish between users. Is this something that should be preserved by the SQL storage system? I'm not sure of the usefulness of storing either, apart from making the transition from flatfile to SQLite cleaner. I could just add columns for IP and UniqueID and populate them when there's no other way to identify a user, and then swap them out when the player comes online. However that would mean an extra column that is going to be very empty for most servers.

Alternatively I could drop these two records and just leave any users that are specified by these in users.txt and swap them over to SQLite when they come online. But that has the disadvantage of mixing flatfile and database for user storage, which I don't think is a very appealing idea. I guess a third option would be to just notify the server operator during the transition that they have users specified by these 'outdated' identifiers and give them the option to manually convert them if they remember who it belongs to, and after they confirm to just drop any records that don't specify a SteamID.

Does anyone actually add users by IP address? I'm definitely for removing UniqueID because it can be completely replaced by SteamID64, but IP addresses could be useful for some people I guess. I'm not sure I should remove that functionality if it is relied on by some server operators.
« Last Edit: August 08, 2017, 02:43:48 PM by roastchicken »
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 Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: UCL to SQL Discussion
« Reply #16 on: August 11, 2017, 06:23:53 AM »
The other IDs exist for historical reasons. ULX4 will be dropping support for those. From what I've seen, no one used anything other than SteamIDs. Fun fact, we used to support adding users by name and "clan tags" with an authentication password.
Experiencing God's grace one day at a time.