Giter Club home page Giter Club logo

inspector's Introduction

Inspector Build Status

Currently not stable and under heavy development

A minecraft plugin for Sponge platforms. Allows for the tracking of block breaking, modification, etc. As well as features rollback for server owners.

Links

License

This plugin is licensed under MIT License. This means that you are allowed to code in any way you would like.

Prerequisites

Contributing

I really appreciate if people contribute to the project. I have a general set of rules I follow for my projects. Do read through it if you do plan on contributing.

Clone

The following steps will ensure your project is cloned properly

  1. git clone [email protected]:hsyyid/Inspector.git
  2. cd Inspector

Development Environment

Note: If you do not have Gradle installed then use ./gradlew for Unix systems or Git Bash and gradlew.bat for Windows systems in place of any 'gradle' command.

If you are a contributor, it is important that your development environment is setup properly. After cloning, as shown above, follow the given steps for your ide:

  1. gradle idea --refresh-dependencies
  1. gradle eclipse --refresh-dependencies

Updating your Clone

Note: If you do not have Gradle installed then use ./gradlew for Unix systems or Git Bash and gradlew.bat for Windows systems in place of any 'gradle' command.

The following steps will update your clone with the official repo.

  • git pull
  • gradle --refresh-dependencies

Building

Note: If you do not have Gradle installed then use ./gradlew for Unix systems or Git Bash and gradlew.bat for Windows systems in place of any 'gradle' command.

We use Gradle for Inspector.

In order to build Inspector you simply need to run the gradle command. You can find the compiled JAR file in ./build/libs labeled similarly to 'Inspector-x.x.jar'.

inspector's People

Contributors

hsyyid avatar parkermc avatar vorburger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

inspector's Issues

Region Selecting Not Working

While testing out this plugin, I noticed I cannot actually select a region for a rollback; I tried to install worldedit to use as a selection tool and that did not seem to make a difference. Have I done something incorrect? There are no errors given.

suggestion update api7

are there any plans to update the plugin to api7 ??

since adamantineshield is stopping
with kind regards irvin

LICENSE.txt ?

Hi, it occurred to me that perhaps you would like to put a LICENSE.txt in this repo, to clarify what open source license, if any, you are making your work available under?

Welcome contribution to run in-memory without SQL DB?

Hello @hsyyid, I would like to make a contribution with an option to store BlockInformation for rollback in memory instead of a SQL DB, but before I get to work on that wanted to ask if that would be welcome and merged, or if you have other plans or would rather I do not submit a PR to you about that? In that mode changes would not be persistent across server restarts, but fine for me, and it easier to use and set up for others.

PS: As a 2nd fallback alternative, if in-mem. is completely no go to you for some reason, you could integrate https://github.com/vorburger/MariaDB4j - interested? Of course just for a single BLOCKINFO, a pure Java in-memory DB like h2 or JavaDB / Derby would do as well.

Bug block check air

Can not check before block to air but block to block can check normally.

Please fix this bug.

WorldEdit Commands Break Stuff

It seems that large worldedit commands involving water and lava make Inspector flood console, greatly spiking the lag and even timing it out in certain situations.

Error report is very long,After deleting it! It is back to normal

[](url)-- Thread Dump --
Details:
	Threads: "Timer-204" Id=21946 WAITING on java.util.TaskQueue@6ad4a0bc
	at java.lang.Object.wait(Native Method)
	-  waiting on java.util.TaskQueue@6ad4a0bc
	at java.lang.Object.wait(Unknown Source)
	at java.util.TimerThread.mainLoop(Unknown Source)
	at java.util.TimerThread.run(Unknown Source)


"Timer-203" Id=21944 WAITING on java.util.TaskQueue@64134396
	at java.lang.Object.wait(Native Method)
	-  waiting on java.util.TaskQueue@64134396
	at java.lang.Object.wait(Unknown Source)
	at java.util.TimerThread.mainLoop(Unknown Source)
	at java.util.TimerThread.run(Unknown Source)

pool-2-thread-20517" Id=21941 BLOCKED on org.sqlite.core.NativeDB@602ccbcc owned by "pool-2-thread-15014" Id=16438
	at org.sqlite.core.NativeDB.reset(Native Method)
	-  blocked on org.sqlite.core.NativeDB@602ccbcc
	at org.sqlite.jdbc3.JDBC3PreparedStatement.executeQuery(JDBC3PreparedStatement.java:72)
	at io.github.hsyyid.inspector.utilities.DatabaseManager.getPlayerId(DatabaseManager.java:163)
	at io.github.hsyyid.inspector.utilities.DatabaseManager.lambda$updateBlockInformation$0(DatabaseManager.java:90)
	at io.github.hsyyid.inspector.utilities.DatabaseManager$$Lambda$972/1055298218.run(Unknown Source)
	at org.spongepowered.api.scheduler.Task$Builder.lambda$execute$0(Task.java:139)
	at org.spongepowered.api.scheduler.Task$Builder$$Lambda$339/1144393016.accept(Unknown Source)
	at org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$0(SchedulerBase.java:183)
	...

	Number of locked synchronizers = 1
	- java.util.concurrent.ThreadPoolExecutor$Worker@1f1d3070

Question: BlockSnapshot vs. State().toContainer().get(DataQuery.of("UnsafeMeta")

Hello, this is Question, not a bug report or improvement suggestion (although it may be):

FYI I've looked at your plugin to learn how to save Block state and restore it, and initially looked at using your https://github.com/hsyyid/Inspector/blob/ee6b2ca0ac431120e4e23e85a8103d78d0e0ad47/src/main/java/io/github/hsyyid/inspector/listeners/PlayerBreakBlockListener.java and

public void revertBlock(Player player, Location<World> location, Optional<String> targetPlayer, String timeInGMT)
, but then found https://docs.spongepowered.org/master/en-GB/plugin/blocks/modifying.html and in my tests found that seems to work just fine, see what I'm doing with it for a slightly different purpose in https://github.com/vorburger/SwissKnightMinecraft/blob/633baf583981829c2ddd25a00c686fffa3191893/SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/logo/UndoableTurtle.xtend, so I was just curious and interested in if I'm missing something - does BlockSnapshot not fully work / miss some metadata that you know of? Thank you!

Error occurred while executing command: No value present

14.02 07:31:47 [Server] Server thread/INFO [nucleus]: WestusBox ran the command: /insp 
14.02 07:31:47 [Server] Server thread/ERROR [Sponge]: Error occurred while executing command 'insp' for source EntityPlayerMP['WestusBox'/0, l='world', x=-0.30, y=69.00, z=-0.33]: No value present
14.02 07:31:47 [Server] INFO java.util.NoSuchElementException: No value present
14.02 07:31:47 [Server] INFO at java.util.Optional.get(Optional.java:135) ~[?:1.8.0_111]
14.02 07:31:47 [Server] INFO at io.github.hsyyid.inspector.cmdexecutors.InspectorExecutor.execute(InspectorExecutor.java:16) ~[InspectorExecutor.class:0.6.4]
14.02 07:31:47 [Server] INFO at org.spongepowered.api.command.args.ChildCommandElementExecutor.execute(ChildCommandElementExecutor.java:171) ~[ChildCommandElementExecutor.class:1.10.2-2221-5.1.0-BETA-2142]
14.02 07:31:47 [Server] INFO at org.spongepowered.api.command.spec.CommandSpec.process(CommandSpec.java:351) ~[CommandSpec.class:1.10.2-2221-5.1.0-BETA-2142]
14.02 07:31:47 [Server] INFO at org.spongepowered.api.command.dispatcher.SimpleDispatcher.process(SimpleDispatcher.java:333) ~[SimpleDispatcher.class:1.10.2-2221-5.1.0-BETA-2142]
14.02 07:31:47 [Server] INFO at org.spongepowered.common.command.SpongeCommandManager.process(SpongeCommandManager.java:295) ~[SpongeCommandManager.class:1.10.2-2221-5.1.0-BETA-2142]
14.02 07:31:47 [Server] INFO at net.minecraft.command.ServerCommandManager.func_71556_a(SourceFile:1083) ~[bd.class:?]
14.02 07:31:47 [Server] INFO at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:913) ~[me.class:?]
14.02 07:31:47 [Server] INFO at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:892) ~[me.class:?]
14.02 07:31:47 [Server] INFO at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(SourceFile:37) ~[im.class:?]
14.02 07:31:47 [Server] INFO at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(SourceFile:9) ~[im.class:?]
14.02 07:31:47 [Server] INFO at org.spongepowered.common.network.PacketUtil.lambda$onProcessPacket$0(PacketUtil.java:157) ~[PacketUtil.class:1.10.2-2221-5.1.0-BETA-2142]
14.02 07:31:47 [Server] INFO at org.spongepowered.common.event.tracking.CauseTracker.switchToPhase(CauseTracker.java:156) [CauseTracker.class:1.10.2-2221-5.1.0-BETA-2142]
14.02 07:31:47 [Server] INFO at org.spongepowered.common.network.PacketUtil.onProcessPacket(PacketUtil.java:156) [PacketUtil.class:1.10.2-2221-5.1.0-BETA-2142]
14.02 07:31:47 [Server] INFO at net.minecraft.network.PacketThreadUtil$1.redirect$onProcessPacket$zjf000(SourceFile:539) [fl$1.class:?]
14.02 07:31:47 [Server] INFO at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [fl$1.class:?]
14.02 07:31:47 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_111]
14.02 07:31:47 [Server] INFO at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_111]
14.02 07:31:47 [Server] INFO at net.minecraft.util.Util.func_181617_a(SourceFile:45) [h.class:?]
14.02 07:31:47 [Server] INFO at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:668) [MinecraftServer.class:?]
14.02 07:31:47 [Server] INFO at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:387) [ld.class:?]
14.02 07:31:47 [Server] INFO at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:613) [MinecraftServer.class:?]
14.02 07:31:47 [Server] INFO at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471) [MinecraftServer.class:?]
14.02 07:31:47 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]

fml-server-latest.txt

Make Database operations run on an async thread

Databases can be very slow, especially when the database in question is remote. Running database operations on the main thread is going to cause a lot of lag when large numbers of block changes occur at once, which is going to be a huge problem for some servers.

https://github.com/hsyyid/Inspector/blob/master/src/main/java/io/github/hsyyid/inspector/listeners/PlayerBreakBlockListener.java#L19-L34 could get REALLY slow.

Database operations should be done OFF the main thread. You should also consider holding a pool of connections using Sponge's SQL service, rather than open a connection for each update, connections take time!

Update for 5.2.0?

Hassan,
Do you have some time to update this for spongeforge 5.2.0? It would really come in handy! Please do.
: )
Anna

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.