Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basically Everything Overhaul ( libs and perms ) #398

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Basically Everything Overhaul ( libs and perms ) #398

wants to merge 5 commits into from

Conversation

davidsonbr
Copy link

DO NOT ACCEPT YET

I am just putting this here for suggestions

Okay now that that is out of the way this would literally break every SF addon.

Things that were changed:

  • Libraries are now loaded from lua/starfall/libraries/$libname where $libname is the name of the library.
  • Libraries can have the following files:
    • library.json This JSON file defines the library, it can have the following keys:
      1. name This is the name of the library, defaults to the name of the directory that it was loaded from
      2. description This is the description of the library, defaults to ""
      3. dependencies This is a table of other libraries that this library depends on.
      4. version This will hopefully be used for documentation generation, if our version of doc differs from the server then we will be able to get the correct version. Can be any unique identifier.
    • client.lua
      • This file is loaded on the client
    • server.lua
      • This file is loaded on the server
    • shared.lua
      • This file is loaded on both client and server instances
    • permissions.json This JSON file will define all permission nodes of the library.
    • permissions.lua This file requires a permissions.json file to be defined.
      • Works in a similar fashion to the prior version of providers.
    • All provider files are treated as shared.
    • provider.check has been modified to pass player, node, ...
      • player being the player that the query is for
      • node being the full name of the node i.e. entities.setColor
      • ... being any additional arguments that are passed to `SF.Permissions.check.
    • Providers are per-library, that mean no more for loop iterating over every provider to check a permisssion.
    • If no provider is defined, then it will use the default value of the permission node
      • Default values can be defined in permissions.json
      • they can be true, false, or "owner"
      • True being any player, false being nobody, and owner being players with superadmin rank.
      • I plan on making it so the providers can check with admin mods like Evolve or ULX
  • Libraries can have soft-dependencies defined within them that get loaded only if the library with that name is also loaded
    • libA/libB/shared.lua will only be loaded if libB is also loaded.
    • Works in a similar fashion to the base library directory.
    • Only client.lua, server.lua, or shared.lua files are loaded from this directory
  • Libraries that had plural names are now singular as this makes more sense and conforms to the majority of other library names

This is all I can think of right now, I will for sure update this if I can think of anything else

@awilliamson
Copy link
Member

Thanks for giving me weeks worth of work ^^

Be prepared for lots of restructuring now we can interject with design choices and decisions.

@davidsonbr
Copy link
Author

Any time :D

@awilliamson
Copy link
Member

@EpicG Still on-going? Thanks to @Jazzelhawk for reminding me of this monster.

@davidsonbr
Copy link
Author

@awilliamson Partially. There were a few issues that I needed to resolve, but I have not looked at it in a while so I kinda forgot what they were...

@davidsonbr
Copy link
Author

@awilliamson Did a little bit of a refresher on my code, realized that the issues I was having was with my panel library. Looking through this appears to be fine, it will just have to be updated to work with the changes made to libraries.

@awilliamson
Copy link
Member

awilliamson commented Jun 4, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants