Skip to content

Commit

Permalink
Fixed rollback/restore on SQLite not recognizing boolean values, fixe…
Browse files Browse the repository at this point in the history
…d correct transaction ending closed commited after database closing connection.
  • Loading branch information
matcracker committed Aug 14, 2019
1 parent 8f21a64 commit 6af8d24
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: BedcoreProtect
main: matcracker\BedcoreProtect\Main
version: 0.4.1
version: 0.4.2
api: [3.4.0]
mcpe-protcol:
- 354
Expand Down
4 changes: 2 additions & 2 deletions src/matcracker/BedcoreProtect/commands/CommandParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public function buildInventoriesLogSelectionQuery(Vector3 $vector3, bool $restor
}

$prefix = $restore ? "new" : "old";

$restore = intval($restore);
$query = /**@lang text */
"SELECT log_id, il.slot, il.{$prefix}_item_id, il.{$prefix}_item_meta, il.{$prefix}_item_nbt, il.{$prefix}_item_amount, x, y, z FROM log_history
INNER JOIN inventories_log il ON log_history.log_id = il.history_id WHERE rollback = '{$restore}' AND ";
Expand All @@ -398,7 +398,7 @@ public function buildEntitiesLogSelectionQuery(Vector3 $vector3, bool $restore =
if (!$this->parsed) {
throw new BadMethodCallException("Before invoking this method, you need to invoke CommandParser::parse()");
}

$restore = intval($restore);
$query = /**@lang text */
"SELECT log_id, e.entity_classpath, el.entityfrom_id, el.entityfrom_nbt, x, y, z, action FROM log_history
INNER JOIN entities_log el ON log_history.log_id = el.history_id
Expand Down
1 change: 1 addition & 0 deletions src/matcracker/BedcoreProtect/storage/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public final function isConnected(): bool
public final function disconnect(): void
{
if ($this->isConnected()) {
$this->dataConnector->waitAll();
$this->dataConnector->close();
$this->dataConnector = null;
$this->queries = null;
Expand Down

1 comment on commit 6af8d24

@SOF3
Copy link

@SOF3 SOF3 commented on 6af8d24 Aug 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @matcracker,

I regret to inform you that your plugin "BedcoreProtect" (v0.4.2 submitted on 2019-08-16T09:18:12.000Z) has been rejected.

Plugins are not allowed to wait for operations over the Internet on the main thread. Please use async programming properly.

Please resolve these issues and submit the plugin again.

This comment is posted here because this is the last commit when the released build was created.

Please sign in to comment.