MyWarp

MyWarp

220k Downloads

[Bug] Warp invite error (when using is already added)

Remski01 opened this issue · 5 comments

commented

Description of the Problem

the plugin returns the user of the command, not who you filled in.

Steps to Reproduce

Invite a player to an warp where he is allready invited to.

Log Output

>.... [23:42:54 INFO]: RemcoMC issued server command: /warp invite exowolf lol
>.... [23:42:54 WARN]: Exception in thread "pool-15-thread-5" io.github.mywarp.mywarp.internal.jooq.exception.DataAccessException: SQL [insert into "mywarp"."warp_player_map" ("warp_id", "player_id") values ((select "mywarp"."warp"."warp_id" from "mywarp"."warp" where "mywarp"."warp"."name" = cast(? as varchar) limit ?), (select "mywarp"."player"."player_id" from "mywarp"."player" where "mywarp"."player"."uuid" = cast(? as uuid) limit ?))]; (Message 23505 not found); SQL statement:
>.... [23:42:54 WARN]: insert into "mywarp"."warp_player_map" ("warp_id", "player_id") values ((select "mywarp"."warp"."warp_id" from "mywarp"."warp" where "mywarp"."warp"."name" = cast(? as varchar) limit ?), (select "mywarp"."player"."player_id" from "mywarp"."player" where "mywarp"."player"."uuid" = cast(? as uuid) limit ?)) [23505-200]
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq_3.13.4.H2.debug(Unknown Source)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.Tools.translate(Tools.java:2753)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:755)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.AbstractQuery.execute(AbstractQuery.java:385)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.AbstractDelegatingQuery.execute(AbstractDelegatingQuery.java:119)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.warp.storage.JooqWarpStorage.lambda$addPlayerInvitation$5(JooqWarpStorage.java:317)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext$3.run(DefaultDSLContext.java:636)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext$3.run(DefaultDSLContext.java:633)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.lambda$transactionResult0$0(DefaultDSLContext.java:564)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.Tools$12$1.block(Tools.java:4926)
>.... [23:42:54 WARN]: at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.Tools$12.get(Tools.java:4923)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.transactionResult0(DefaultDSLContext.java:616)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.transactionResult(DefaultDSLContext.java:533)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.transaction(DefaultDSLContext.java:633)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.warp.storage.JooqWarpStorage.addPlayerInvitation(JooqWarpStorage.java:299)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.warp.storage.JooqWarpStorage.addInvitation(JooqWarpStorage.java:279)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.warp.storage.AsyncWritingWarpStorage.lambda$addInvitation$2(AsyncWritingWarpStorage.java:71)
>.... [23:42:54 WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>.... [23:42:54 WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>.... [23:42:54 WARN]: at java.lang.Thread.run(Thread.java:748)
>.... [23:42:54 WARN]: Caused by: io.github.mywarp.mywarp.internal.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: (Message 23505 not found); SQL statement:
>.... [23:42:54 WARN]: insert into "mywarp"."warp_player_map" ("warp_id", "player_id") values ((select "mywarp"."warp"."warp_id" from "mywarp"."warp" where "mywarp"."warp"."name" = cast(? as varchar) limit ?), (select "mywarp"."player"."player_id" from "mywarp"."player" where "mywarp"."player"."uuid" = cast(? as uuid) limit ?)) [23505-200]
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.message.DbException.getJdbcSQLException(DbException.java:459)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.message.DbException.getJdbcSQLException(DbException.java:429)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.message.DbException.get(DbException.java:205)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.message.DbException.get(DbException.java:181)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:221)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:196)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.mvstore.db.MVTable.addRow(MVTable.java:531)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.command.dml.Insert.insertRows(Insert.java:195)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.command.dml.Insert.update(Insert.java:151)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.command.CommandContainer.update(CommandContainer.java:198)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.command.Command.executeUpdate(Command.java:251)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:240)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:209)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.AbstractQuery.execute(AbstractQuery.java:453)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.AbstractDMLQuery.execute(AbstractDMLQuery.java:904)
>.... [23:42:54 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.AbstractQuery.execute(AbstractQuery.java:371)
>.... [23:42:54 WARN]: ... 17 more

Affected Version

`>....�=>.... [23:46:59 INFO]: MyWarp version 3.1.1-SNAPSHOT+Travis-b1861.git-52b8ad555e

.... [23:46:59 INFO]: An extension for the Minecraft multiplayer that allows players to create and share warps with each other.
.... [23:46:59 INFO]: Website: https://mywarp.github.io/
.... [23:46:59 INFO]: Authors: tkelly, flames, spathizilla, mung3r and thee`


`>....�=>.... [23:47:00 INFO]: This server is running Paper version git-Paper-135 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)

.... [23:47:00 INFO]: Checking version, please wait...
.... [23:47:01 INFO]: Previous version: git-Paper-99 (MC: 1.16.1)
.... [23:47:01 INFO]: You are 2 version(s) behind`

Additional context

invite.successful=§8[§2Warps§8] §fJe hebt{0,choice,0#|1#the group} §6{1}§f toegevoegd bij §2{2}§f.
Also have to note that if you change this to 0 instead of the 1, it just shows 0 instead the player who used the command. (instead of showing who he typed after /warp invite)

Quick note:
I also found an interesting things, if i use /warp info there are as example 2 ExoWolf's, if i reload the plugin. There is only 1. It then allow's me to invite the said user, where it then shows the said users again 2 times. Where if then again invite ExoWolf, it does give the error...

commented

Thank you for fixing it. Thanks for trying to fix it so fast.

I will update our version and test it out to confirm its fixed.

commented

Update:
Still returns the error when using §8[§2Warps§8]§c{0,choice,0#|1#The group} §6{0}§c is al toegevoegd bij de warp., it shows {0} instead of an said player.

>.... [00:58:32 INFO]: RemcoMC issued server command: /warp invite exowolf lol
>.... [00:58:32 WARN]: Exception in thread "pool-15-thread-1" io.github.mywarp.mywarp.internal.jooq.exception.DataAccessException: SQL [insert into "mywarp"."warp_player_map" ("warp_id", "player_id") values ((select "mywarp"."warp"."warp_id" from "mywarp"."warp" where "mywarp"."warp"."name" = cast(? as varchar) limit ?), (select "mywarp"."player"."player_id" from "mywarp"."player" where "mywarp"."player"."uuid" = cast(? as uuid) limit ?))]; (Message 23505 not found); SQL statement:
>.... [00:58:32 WARN]: insert into "mywarp"."warp_player_map" ("warp_id", "player_id") values ((select "mywarp"."warp"."warp_id" from "mywarp"."warp" where "mywarp"."warp"."name" = cast(? as varchar) limit ?), (select "mywarp"."player"."player_id" from "mywarp"."player" where "mywarp"."player"."uuid" = cast(? as uuid) limit ?)) [23505-200]
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq_3.13.4.H2.debug(Unknown Source)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.Tools.translate(Tools.java:2753)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:755)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.AbstractQuery.execute(AbstractQuery.java:385)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.AbstractDelegatingQuery.execute(AbstractDelegatingQuery.java:119)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.warp.storage.JooqWarpStorage.lambda$addPlayerInvitation$5(JooqWarpStorage.java:317)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext$3.run(DefaultDSLContext.java:636)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext$3.run(DefaultDSLContext.java:633)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.lambda$transactionResult0$0(DefaultDSLContext.java:564)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.Tools$12$1.block(Tools.java:4926)
>.... [00:58:32 WARN]: at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.Tools$12.get(Tools.java:4923)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.transactionResult0(DefaultDSLContext.java:616)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.transactionResult(DefaultDSLContext.java:533)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.DefaultDSLContext.transaction(DefaultDSLContext.java:633)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.warp.storage.JooqWarpStorage.addPlayerInvitation(JooqWarpStorage.java:299)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.warp.storage.JooqWarpStorage.addInvitation(JooqWarpStorage.java:279)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.warp.storage.AsyncWritingWarpStorage.lambda$addInvitation$2(AsyncWritingWarpStorage.java:71)
>.... [00:58:32 WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>.... [00:58:32 WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>.... [00:58:32 WARN]: at java.lang.Thread.run(Thread.java:748)
>.... [00:58:32 WARN]: Caused by: io.github.mywarp.mywarp.internal.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: (Message 23505 not found); SQL statement:
>.... [00:58:32 WARN]: insert into "mywarp"."warp_player_map" ("warp_id", "player_id") values ((select "mywarp"."warp"."warp_id" from "mywarp"."warp" where "mywarp"."warp"."name" = cast(? as varchar) limit ?), (select "mywarp"."player"."player_id" from "mywarp"."player" where "mywarp"."player"."uuid" = cast(? as uuid) limit ?)) [23505-200]
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.message.DbException.getJdbcSQLException(DbException.java:459)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.message.DbException.getJdbcSQLException(DbException.java:429)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.message.DbException.get(DbException.java:205)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.message.DbException.get(DbException.java:181)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:221)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:196)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.mvstore.db.MVTable.addRow(MVTable.java:531)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.command.dml.Insert.insertRows(Insert.java:195)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.command.dml.Insert.update(Insert.java:151)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.command.CommandContainer.update(CommandContainer.java:198)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.command.Command.executeUpdate(Command.java:251)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:240)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:209)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.AbstractQuery.execute(AbstractQuery.java:453)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.AbstractDMLQuery.execute(AbstractDMLQuery.java:904)
>.... [00:58:32 WARN]: at io.github.mywarp.mywarp.internal.jooq.impl.AbstractQuery.execute(AbstractQuery.java:371)
>.... [00:58:32 WARN]: ... 17 more

....�=>.... [01:01:28 INFO]: MyWarp version 3.1.1-SNAPSHOT+Travis-b1864.git-0440f00135
.... [01:01:28 INFO]: An extension for the Minecraft multiplayer that allows players to create and share warps with each other.
.... [01:01:28 INFO]: Website: https://mywarp.github.io/
.... [01:01:28 INFO]: Authors: tkelly, flames, spathizilla, mung3r and thee


....�=>.... [01:01:30 INFO]: This server is running Paper version git-Paper-135 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
.... [01:01:30 INFO]: Checking version, please wait...
.... [01:01:30 INFO]: Previous version: git-Paper-99 (MC: 1.16.1)
.... [01:01:30 INFO]: You are 2 version(s) behind

commented

Would like to hear back if there is an mistake on my end with using the {0}.
Update: Same error occurs when changing that to {1}. It does say now the name instead an blank {0}. However both {1} and {2} shows the username while the text say that {0} shows the username and {1} the group. Could you please explain this?

commented

Turns out it was caused by an bug/issue in the database as it would fixed when i deleted the database and recreated the warp...

commented

Just to clarify, I think you were encountering two separated issues.

Firstly, the wrong name in the invite.successful message was caused by an incorrect parameter in the code. I fixed the issue in 0440f00. The message should now be correct, as long as you use the correct variables:0 is used to determine whether a player or a group has been invited, 1 is the invitee's name (depending on the context, the name of the group or the player).

Secondly, there seems to be something wrong in your database. Unfortunately, I cannot reproduce this problem, so maybe it is a local problem. If you need help to repair your database, let me know.