Filled Command delay until player login

Discussion in 'Plugin Requests' started by Probdutch, May 1, 2017.

Thread Status:
Not open for further replies.
  1. Minecraft version: Latest (1.11.2 and up)

    Suggested name: CommandLoginDelay (cld)

    What I want: I'd like to have an plugin, allowing commands to be delayed until the login of the player. The way it would work is, you would enter cld <playerUuid> <commandToExecute> in the console. If the player is online, the command will be exectued from the console instantly, And if not it will be stored with the player's uuid in an text file, On login it will be checked for commands in the "waiting list". I dont think there is any config file needed, as its an really basic plugin.

    Ideas for commands: cld <playerUuid> <commandToExecute>, function descriped earlyer in the post

    Ideas for permissions: cld.add - adding commands to the list

    When I'd like it by: As fast as possible, im quite in an hurry :/ But i would rather have it 1 day later then have it not work :)

    Thanks, Probdutch

    Edit: Swapped around uuid and command, thats way more logical and allows for spaces. Thanks to @Jeyge for telling me
     
    Last edited: May 1, 2017
  2. Offline

    timtower Administrator Administrator Moderator

    @Probdutch I made this before but my version requires MySQL, has no commands to set commands either.
     
  3. @timtower MySql is no problem :) but what do you m ean with
    I assume you mean like a default command for the plugin, In my case thats not needed

    Edit: I got it, found it in your signature, You mean setting commands for join.
     
  4. Offline

    timtower Administrator Administrator Moderator

    @Probdutch No, you can only add commands through the database itself at the moment.
     
  5. Edit was half a minute too late :), I was wondering if there is any way you could add this to the plugin, And just before inserting it to the tables, also checking if the player is online, and if thats the case, executing it right away. Thanks
     
  6. Offline

    timtower Administrator Administrator Moderator

    @Probdutch Can be added no problem, when? Not sure
     
  7. @timtower I kinda need it quite soon, But i am not sure if it would be faster to modify it or create a new plugin.
     
  8. Offline

    timtower Administrator Administrator Moderator

    @Probdutch Modifying it is easy for me. But I am also working on school.
    Within 24 hours is very doable for me.
     
  9. Sure, within 24 hours would help me out immensly, Thanks :D
     
  10. Offline

    timtower Administrator Administrator Moderator

    @Probdutch Updated the link. Do check the new description.
    WebCommandPlayer is the plugin I am talking about.
    Do note: I have no tested this.
    The code for command handling is far from perfect.
    Was made to handle commands from websites, not from players.
     
  11. @timtower It seems to work, but i dont really know how to use the command, How would i get it to execute the command
    Code:
    give ef580819-3aad-45d9-8945-04554393d237 diamond 1
    for Player Probdutch with uuid ef580819-3aad-45d9-8945-04554393d237 on login? When i do /webcommandplayer in the console it returns back "no command to run"
     
  12. Offline

    timtower Administrator Administrator Moderator

    @Probdutch It works with player names.
    And that is not how the plugin works.
    It is not able to recognize any command.
    /webcommandplayer Probdutch Any give Probdutch diamond 1
    The any is to determine the world to work in.
     
  13. Got it, thanks.
    Except i am getting an error back from the sql server:
    Error (open)

    Code:
    [22:25:42 WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''   ', 'Probdutch', null)' at line 1
    [22:25:42 WARN]:        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [22:25:42 WARN]:        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    [22:25:42 WARN]:        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    [22:25:42 WARN]:        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    [22:25:42 WARN]:        at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    [22:25:42 WARN]:        at com.mysql.jdbc.Util.getInstance(Util.java:408)
    [22:25:42 WARN]:        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
    [22:25:42 WARN]:        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
    [22:25:42 WARN]:        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
    [22:25:42 WARN]:        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
    [22:25:42 WARN]:        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
    [22:25:42 WARN]:        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
    [22:25:42 WARN]:        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
    [22:25:42 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)
    [22:25:42 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)
    [22:25:42 WARN]:        at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5098)
    [22:25:42 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994)
    [22:25:42 WARN]:        at nl.timdebrouwer.webcommandplayer.WebCommandPlayer$1.run(WebCommandPlayer.java:117)
    [22:25:42 WARN]:        at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58)
    [22:25:42 WARN]:        at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52)
    [22:25:42 WARN]:        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
    [22:25:42 WARN]:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    [22:25:42 WARN]:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    [22:25:42 WARN]:        at java.lang.Thread.run(Thread.java:745)
    
     
  14. Offline

    timtower Administrator Administrator Moderator

    @Probdutch Fixed, same link.
    Alias is /wcp btw
     
  15. Thanks, Testing it in a moment.

    mh, another error:
    Code:
    [22:55:52 WARN]: java.sql.SQLException: Column count doesn't match value count at row 1
    [22:55:52 WARN]:        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
    [22:55:52 WARN]:        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
    [22:55:52 WARN]:        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
    [22:55:52 WARN]:        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
    [22:55:52 WARN]:        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
    [22:55:52 WARN]:        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
    [22:55:52 WARN]:        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
    [22:55:52 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)
    [22:55:52 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)
    [22:55:52 WARN]:        at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5098)
    [22:55:52 WARN]:        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994)
    [22:55:52 WARN]:        at nl.timdebrouwer.webcommandplayer.WebCommandPlayer$1.run(WebCommandPlayer.java:117)
    [22:55:52 WARN]:        at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58)
    [22:55:52 WARN]:        at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52)
    [22:55:52 WARN]:        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
    [22:55:52 WARN]:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    [22:55:52 WARN]:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    [22:55:52 WARN]:        at java.lang.Thread.run(Thread.java:745)
    also, this is not an bug in the plugin but an "feature" from mysql, I am seeing this really often now in the console
    Code:
    [22:57:03 WARN]: Tue May 02 22:57:03 CEST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
    
    Would it be possible to add an option in the config file for adding this useSSL=false flag?

    Thanks, Probdutch

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 2, 2017
  16. Offline

    timtower Administrator Administrator Moderator

    @Probdutch Updated the file.
    Fixed that error.
    Added SSL support, disabled by default.
     
  17. Seems like it is working, except i still have no idea how to add the correct commands. If i do webcommandplayer Probdutch Any give Probdutch diamond 1, it inserts it just fine, and after the next check, ill see "unknown command" popping up. Typing "give Probdutch diamond 1" manually does however work.

    EDIT:
    This is the row in the database, command is empty
    [​IMG]
    EDIT 2:
    Adding rows in to the database does work perfectly
     
  18. Offline

    timtower Administrator Administrator Moderator

  19. mh, now it only inserts the last piece of the command
    [​IMG]

    EDIT:
    View attachment 29391
    I got that a few times later
     
  20. Offline

    timtower Administrator Administrator Moderator

    @Probdutch Updated, if you get more errors then you tell me and I will go testing myself.
     
  21. Yay, it works perfecly now. Thanks :)
    The only feature that would be nice, is for it to check on login. Then it would completely replace the initial request for the plugin i had, Then Everything i needed works :D
     
  22. Offline

    timtower Administrator Administrator Moderator

    @Probdutch Done
    Do note that the timing might break due to that and that all players are being checked when somebody joins.
     
  23. @timtower Thanks, But what do you mean with timing?
     
  24. Offline

    timtower Administrator Administrator Moderator

    @Probdutch The thing that checks every 5 minutes, nothing big.
     
  25. oh, no problem than. Ill get the latest version installed, and report back if it worked :)

    Edit:
    An sql error gets back on login of an player:
    Code:
    [14:59:16] [Craft Scheduler Thread - 6/WARN]: java.sql.SQLException: No operations allowed after statement closed.
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at com.mysql.jdbc.StatementImpl.checkClosed(StatementImpl.java:436)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1293)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at nl.timdebrouwer.webcommandplayer.WebCommandPlayer.check(WebCommandPlayer.java:241)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at nl.timdebrouwer.webcommandplayer.WebCommandPlayer$2.run(WebCommandPlayer.java:225)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    [14:59:16] [Craft Scheduler Thread - 6/WARN]:     at java.lang.Thread.run(Thread.java:745)
    Edit2: Nevermind, i was sending about 20 players to the server at the exact same moment. So there where a lot of queries at the same moment. So many that it didnt complete the 2nd one before the 1st one. Thanks for making this plugin. It helps me a ton :). Ill set it to filled
     
    Last edited: May 3, 2017
  26. Offline

    timtower Administrator Administrator Moderator

    @Probdutch And that is indeed one of the dangerous things about that check on join.
     
  27. true, but another plugin limits the amount of players logging in at the same moment. I just disabled it for a second. No big deal, so these errors shount happen any more often
     
Thread Status:
Not open for further replies.

Share This Page