1. These forums are still being retired! Please use GitHub discussions or Discord. You cannot create new threads or new accounts now. If you need to contact some user of the forums, you should do it sooner, rather than later. This notice was last updated on May 30th, 2021.

Setting up groups and permissions

Discussion in 'Help and Support' started by ManaUser, Dec 22, 2016.

  1. ManaUser

    ManaUser Level 1

    Joined:
    Dec 22, 2016
    Messages:
    11
    So I'm making my first a atempt at setting up a TShock server, and the first thing that strikes me is that there are a hell of a lot of permissions. And I know from experience as a player on a TShock server that these can take a fair amount fiddling to get right. But the only way I see to set these in any of the help files is through chat commands. Surely there's a better way... Isn't there? Some config file I could edit or something? It seems like such a pain if I have to do this one permission at a time through chat.
     
    • Like Like x 1
  2. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    That's a good idea. I often forget typing some console commands when testing plugins on the new instance of TShock server.

    Ah, it reminds me of the good old CONFIG.SYS and AUTOEXEC.BAT... :D

    p.s. Once setup has been done, saving/restoring tshock.sqlite file may be one of the best methods, but I also often forget what I have configured before. lol
     
  3. ManaUser

    ManaUser Level 1

    Joined:
    Dec 22, 2016
    Messages:
    11
    So there really isn't currently a way to do that? :confused:

    At least I've realized I can do it from the console window instead of chat, that's a small step up. But it seems weird there's no way to mass edit this stuff.
     
  4. Professor X

    Professor X Spam Cleaner 9000.5
    TShock Mod TShock Contributor

    Joined:
    Aug 18, 2014
    Messages:
    246
    I don't get what you're saying here. /group addpermission takes multiple permissions.
     
  5. ManaUser

    ManaUser Level 1

    Joined:
    Dec 22, 2016
    Messages:
    11
    You have to remember I'm a newb. I admit when I made the first post in this thread I hadn't figured that out yet. I still wish I could see everything in one place though. I guess what I'll have to do is build up the addperm commands I want in notepad as I go down the list of permissions in the documentation and then paste it into the console. It'll do I guess, it just seems a little more awkward than it needs to be.

    No insult intended to your fine product here, I probably just need to get used to the interface.
     
    #5 ManaUser, Dec 23, 2016
    Last edited: Dec 23, 2016
  6. Demonith

    Demonith Level 2

    Joined:
    Jan 16, 2012
    Messages:
    34
    And there is no way to get invasion permission to work :/ i set it up and still cant spawn them
     
  7. ManaUser

    ManaUser Level 1

    Joined:
    Dec 22, 2016
    Messages:
    11
    Which one? For spawning them with the normal items or spawning them arbitrarily?

    I'm guessing you probably mean the one for using items. I am definitely not the person to answer this kind of stuff but it did seem like something a little weird was going on. I ultimately got it to where it seemed to work though.
     
    #7 ManaUser, Dec 23, 2016
    Last edited: Dec 24, 2016
  8. ManaUser

    ManaUser Level 1

    Joined:
    Dec 22, 2016
    Messages:
    11
    I've got another permissions question.

    Here are the basic groups I'm thinking of setting up:
    guest (very limited)
    default (can do most things besides spawn invasions and bosses)
    trusted (as close to vanilla Terraria experience as possible)
    mod (limited admin abilities)
    admin (most admin abilities)
    owner (all powerful)

    And what I'm wondering is this: Is there any way I can allow mods or admins to elevate users to "trusted" but not be able to give themselves superadmin powers? It looks the /user command, or even /tempgroup is basically keys to the kingdom. Is there any more limited way to access that?

    I suspect the answer is no... If so, might the be any plug-in that enables this sort of thing?
     
  9. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    Well, anyone who is granted tshock.admin.tempgroup permission can change specified user's group by /tempgroup command.
    But he can also elevate him to superadmin by that command. That's too powerful. :eek:

    What about JIST(with SEconomy) plugin?
    I tried implementing "/trust <user>" command as shown below.

    Preparing: (on console)
    Code:
    /group add trusted tshock.npc.startinvasion,tshock.npc.startdd2,tshock.npc.summonboss
    /group parent trusted default
    /group add mod my.command.trust   <---name the permission as you like
    /group parent mod trusted
    
    /group prefix trusted [c/00ffff:(Trusted group) ]
    /group prefix mod [c/7fff00:(Mod group) ]
    
    /user group Onsen mod   <--it's me
    
    Script:
    trust.js

    In-game: (left: default group user / right: mod group user)
    [​IMG]

    Console log:
    [​IMG]
    (*) "/jist reload" should be used when you modified your script during server is running

    @ManaUser, @Professor X
    It is wonderful if we can execute bulk commands like the above by just typing "/batch command.txt" or whatever, isn't it? :D
     
  10. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    Notice: original JIST/SEconomy plugins are currently outdated, so please use my patched build if you want to try. (There are some bugs though)

    It's not necessary setting up for this test. Just place 5 DLLs at ServerPlugins/ subfolder.
    When you use it for the first time, you should place the script file at serverscripts/ subfolder (created newly when launched TShock), then type "/jist reload" on console.

    cf.) JIST Wiki
     
    #10 Onsen, Dec 25, 2016
    Last edited: Dec 25, 2016
  11. ManaUser

    ManaUser Level 1

    Joined:
    Dec 22, 2016
    Messages:
    11
    Thanks for your help! I figured something like that would be out there. But this plug-in looks a little daunting for a tshock noob. Do you know if I have to install the entire thing to make that script work? I saw somewhere else on here that SEconomy is supposed to be modular.

    Edit: Also, how would I add a check to that script that the target must currently be in the "default" group? This command shouldn't be able to "demote" admins or anything. Less likely to be a real concern, but for completeness sake I'd like to have that covered.
     
    #11 ManaUser, Dec 25, 2016
    Last edited: Dec 25, 2016
  12. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    This plugin is separated into some modulars as you said.
    Perhaps it requires only SEconomy.dll if you want to use server-side currency system alone, however most of DLLs is needed to make/work custom script.
    (For using the server-side currency system, see also this post)

    Ah, that makes sense. I've added some lines to check that.
    trust.js (modified)

    [​IMG]
     
  13. ManaUser

    ManaUser Level 1

    Joined:
    Dec 22, 2016
    Messages:
    11
    Nice. I was hoping it would be that easy. I'm not a huge fan of javascript, but this is the level of programing I can handle.

    So this will definitely be worth checking out. I'm not real sure about the whole economy thing, it seems kind of weird to be honest. But as long as it doesn't get in the way too much I guess this plug-in may well be worth it just for the scripting.
     
  14. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    SEconomy's "currency" is a sort of metaphor.
    It's used for buying items at your shop, raising character's classes like as EXP (Permabuffs plugin is useful for class system) or whatever.

    Of course, you may use this plugin just for the scripting. If so, you don't have to grant "seconomy.world.mobgains" permission to any group.
     
  15. ManaUser

    ManaUser Level 1

    Joined:
    Dec 22, 2016
    Messages:
    11
    Last question (hopefully) before I try this myself, where's the best general documentation for this mod? Your patch doesn't seem to come with any, and alot of links I'm finding are broken. Or should I be able to figure it out if I just install it and start messing around? Maybe it looks more complicated than it really is.
     
  16. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    As far as I know, there is no document except the one which this plugin author had published at his site in the past.
    - SEconomy Introduction Guide
    - SEconomy Ranking Script (v2.0) & Configuration Guide


    Many good plugins are released so far though, not all of them are still maintained.
    In addition, unfortunately (to newcomers), new generation of TShock just has been (pre)released the other day (it's the only version that supports the latest Terraria), so most of plugins we can download directly from here don't work for now.
     
  17. ManaUser

    ManaUser Level 1

    Joined:
    Dec 22, 2016
    Messages:
    11
    Ah, Internet Archive. Should have thought of that. Alright I guess it's time to grab the bull by the horns and see what I can do.

    Thanks for all your help.
     
  18. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    Not so hard. That isn't a bull, but a calf :p
    For scripting only, all it takes is doing this.
    If you got any errors, let us know.
     
  19. ManaUser

    ManaUser Level 1

    Joined:
    Dec 22, 2016
    Messages:
    11
    So far so good. Everything is installed and the script seems to work as desired. Now I'm back to fiddling with all the permissions. But everything is coming along fine. I like the idea of putting the "badges" in color (e.g. Mod group) instead of changing the whole message color. It still stands out but it looks a little nicer.

    Well, I'm getting pretty close where where I want to be. Now I'm wondering if there's any way to automatically run a command every time the server starts. Specifically /sec stop, since I've got enough going on using tshock for the first time without delving into the economy stuff. So if anyone knows another way to hide the economy-related features, that may work too. I guess the main things want to hide are the balance announcement when you log in and the /bank command. Since I'm not really using any of it, I figure it'll just confuse people (or disappoint them if they're into that kind of thing).
     
    #19 ManaUser, Dec 26, 2016
    Last edited: Dec 27, 2016
  20. Onsen

    Onsen Level 8

    Joined:
    Dec 8, 2015
    Messages:
    282
    Autobroadcast plugin might supply your want.
    (download the latest DLL from here)

    Configure AutoBroadcastConfig.json like this:
    Code:
    {
      "Broadcasts": [
        {
          "Name": "Stop SEconomy",
          "Enabled": true,
          "Messages": [
            "/sec stop"
          ],
          "ColorRGB": [
            255.0,
            0.0,
            0.0
          ],
          "Interval": 86400,
          "StartDelay": 10,
          "TriggerRegions": [],
          "RegionTrigger": "none",
          "Groups": [],
          "TriggerWords": [],
          "TriggerToWholeGroup": false
        }
      ]
    }
    
    This executes "/sec stop" 10 sec after loading world, and repeated it 1 day later (because "interval" can't be set as 0).

    Another (dirty) workaround:
    Making "SEconomy.config.json" file to empty (0 byte) will disable SEconomy due to errors. (But JIST scripts still work)