1. The forums are scheduled for deletion on or after December 31, 2024 (JST). Please back up or archive any data you find important to you. If you do not have an account, you cannot login or create an account.

2.1 TSWVote 2.3

Allows in-game voting using the tserverweb.com platform.

  1. Loganizer

    Plugin Developer

    Joined:
    Dec 2, 2012
    Messages:
    212
    TSWVote for TServerWeb.com
    For TShock API v1.16​
    Terraria 1.2.4.1​


    TSWVote (Or TServerWeb Vote) is a plugin that allow voting of servers registered on TServerWeb.com from in-game.

    Requirements
    Setting up and configuring
    Setting the plugin to work is relatively simple. All you have to do is put the DLL file into your ServerPlugins folder (Link Below) and then go to "manage" on your server at TServerWeb, and select the tab "Server Plugins." From here, select "Manage" in the In-Game voting box. This will automatically detect and configure the plugin.
    There are also some options on the manage page. In the "Commands" tab, you can define commands that will run after a successful vote. This could heal a player, reward a player with a currency, and many other options. The "Thank You Message" is what will be shown to a player on a successful vote.

    Commands/Permissions
    To vote, just type /vote in-game. There is no permission required.
    If needed, you can manually change the server ID with /tserverweb [ID]. This requires the permission vote.changeid. This should be done automatically, though.
    Note: /tswversioncheck is meant for TServerWeb.com to check for updates.

    TODO
    • Feel free to suggest anything!
    Links:
    Source/DLL
    Note: This is now maintained by Simon311.
     
    • Like Like x 5
  2. XGhozt

    Plugin Developer

    Joined:
    May 12, 2012
    Messages:
    171
    Here is a screenshot of the interface:
    [​IMG]
     
    • Like Like x 2
  3. OFF

    OFF
    Account Probation Banned Rating Banned

    Joined:
    Nov 28, 2013
    Messages:
    208
    bananaing loving this! Getting it right now! Waiting for the SEconomy :D
     
  4. XGhozt

    Plugin Developer

    Joined:
    May 12, 2012
    Messages:
    171
    You can still use it with SEconomy as-is. Just type in the command to give the currency to the user. :)
    I think it's just this:
    Code:
    /bank give [player] <amount>
     
  5. Commaster

    Banned

    Joined:
    Oct 3, 2012
    Messages:
    149
    Website refuses to detect, that it is installed:
    [1000]TServerWebVote v1.0 (by Loganizer + XGhozt).
    ^ loaded, according to /plugins command
     
  6. XGhozt

    Plugin Developer

    Joined:
    May 12, 2012
    Messages:
    171
    Make sure that you've restarted the server and you have a valid token or username/password to generate one.
    Also confirm that you can execute the command /tserverweb
     
  7. Commaster

    Banned

    Joined:
    Oct 3, 2012
    Messages:
    149
    Of course I've restarted. How else could the /plugins command detect, that it's loaded? :D
    I'm using username/password with tshock.rest.useapi permission. Your website successfully runs /tokentest.
    I just ran the /tserverweb command and updated the ID. Still red box.
     
  8. Commaster

    Banned

    Joined:
    Oct 3, 2012
    Messages:
    149
    Looks like it might need more permissions. Please specify, which permissions it requires.
     
  9. XGhozt

    Plugin Developer

    Joined:
    May 12, 2012
    Messages:
    171
    It must be an issue with your restapi user. Make sure it has access to the rawcmd endpoint.
     
  10. Commaster

    Banned

    Joined:
    Oct 3, 2012
    Messages:
    149
    Please point at the instructions, that required that permission to be granted to restapi user. I can't find such notes...

    also, access to rawcmd is most likely a security issue.
     
  11. XGhozt

    Plugin Developer

    Joined:
    May 12, 2012
    Messages:
    171
    It's usually an all or nothing. I tested your server and it doesn't look like that user has access to ANY endpoint. I'm not sure how to resolve that.
     
  12. Commaster

    Banned

    Joined:
    Oct 3, 2012
    Messages:
    149
    That user has access to only what it needed, rest.useapi. I can't find any extra requirements on your website.

    Thanks for updating the plugin requirements, but it is still a security flaw.
     
  13. XGhozt

    Plugin Developer

    Joined:
    May 12, 2012
    Messages:
    171
    The security of TServerWeb has already been discussed on the TServerWeb thread. We store the passwords in an encrypted form in the database. You must be using the wrong permission name or something. It doesn't need that permission to generate a token (I think), or validate it either. It must be an issue with the user or the permissions or the group that user is in.

    Edit: When you're editing the server that is done over SSL as well (yes, I patched the heartbleed bug).
     
  14. Commaster

    Banned

    Joined:
    Oct 3, 2012
    Messages:
    149
    Please also update, that the user needs the permissions of this plugin. :D
     
  15. XGhozt

    Plugin Developer

    Joined:
    May 12, 2012
    Messages:
    171
    Good point, the REST API user would also need access to the vote.changeid permission.
     
  16. Commaster

    Banned

    Joined:
    Oct 3, 2012
    Messages:
    149
    It fails to retrieve IP. And WHY THE HELL did it change my ID to 2246?! See, security flaw.
     
  17. XGhozt

    Plugin Developer

    Joined:
    May 12, 2012
    Messages:
    171
    Haha, that's not a security flaw. It updates your server ID automatically because it needs to match the server ID on tserverweb in order to work. Your rest API user will also need access to /v2/players/read in order to validate the player.
     
  18. Commaster

    Banned

    Joined:
    Oct 3, 2012
    Messages:
    149
    But my ID is not 2246, which is marked as private. Please stop changing my ID.
     
  19. XGhozt

    Plugin Developer

    Joined:
    May 12, 2012
    Messages:
    171
    Then that might have been me trying to help you. :p
     
  20. Commaster

    Banned

    Joined:
    Oct 3, 2012
    Messages:
    149
    Lets see... Plugin requires direct access to command execution. Then, to validate, it requests a full dump of player's inventory and buffs, it's username and position. Too much info for a simple plugin like that one, if you ask me. Wouldn't it be easier to send the IP using the plugin itself?