Using the CBDC-Injector

As of DisguiseCraft version 2.6, this is no longer needed to have disguise PVP on your server!

This page will teach you how to use the CBDC-Injector program to enable disguise PVP on your server.

The injector program puts the necessary class files into your CraftBukkit jar. The DisguiseCraft plugin is then capable of detecting the modified jar and will activate PVP automatically. (You will be notified via the console.)

This is a standalone Java program, not a Bukkit plugin.


How To Use:

Here is the quick and simple. If it doesn't work for you, you may want to continue reading.

  1. Put your unmodified CraftBukkit jar file into an empty folder
  2. Place the CBDC-Injector program into the same folder
  3. Run the injector program by either double-clicking its icon or using "java -jar CBDC-Injector.jar"
  4. A new CraftBukkit jar file with "-DC" in its name has been created
  5. Use this new file to run your server

Will it work with your CraftBukkit build?

An up-to-date changes archive is needed for every DisguiseCraft update. This is because we compile the plugin against the injected jar. (Our Jenkins even injects a jar for every build)

What does this mean for you?

It means that when you use the injector, it is inserting the files for the CraftBukkit version that the most recent DisguiseCraft file was listed to work with.

What about other newer/older CraftBukkit versions?

So long as there is no difference between the NetServerHandler class in the build that the changes archive was made with and the build you are injecting, the injector will work fine. The injection will also fail if there was a change in Vanilla MineCraft server obfuscation. This generally means that the injections should work over whole MineCraft server versions and not break over different CraftBukkit builds for the same version.

Explanation:

After cloning Bukkit and CraftBukkit's source code from GitHub, we add in the necessary changes to allow for the melee attacking of disguised players. We then compile all of this using Maven. Afterwards, we place all of of the modified class files into an archive file which is then uploaded to our website.

The injector program downloads this file and decompresses it along with the CraftBukkit file placed in the folder alongside it. First it checks the changes properties file (CBDC.txt) for any special changes such as file deletions. Then it copies over all the previously archived modified files. These are mainly the new class files. After they are all copied, the program compresses all the files into a new jar archive with the name ending with "-DC" as an indicator. Before exiting, the injector deletes all now unnecessary temporary files and folders.

Upon loading, DisguiseCraft checks if the PlayerInvalidInteractEvent class has been loaded up by the JVM. If it has, then the CraftBukkit jar file must have been modified for disguise PVP. DisguiseCraft then begins listening for this disguise-hit event.

That's how it all works :)

Important Notes:

  • If your server host does not allow you to edit the run script and your server jar has a completely different name (e.g. server.jar), then you'll want to have two copies of the modified server file in your server directory. One would be the conventionally named file which DisguiseCraft would detect, and the other would be the server file actually being run.
    • We plan to remedy this soon by finding the best method of detecting the running jar file.

Trivial Notes:

  • Our Jenkins downloads the latest CraftBukkit stable build and runs the injector before every time it compiles DisguiseCraft
  • We must update our changes archive for new CraftBukkit builds before we can actually start compiling DisguiseCraft for them
    • This means that new features and releases now come out slower, but archive file updates are guaranteed
  • This whole injector work-around is a result of the CraftBukkit devs not accepting our ticket and pull requests
    • Their decision did make sense as they are providing a framework, not features
  • As of CB 1.2.5-R4.0, the program also deletes files as well as injects them. This was necessary in order to bypass the CraftBukkit jar's archive checksum verification.
    • The manifest file is also changed so that the version of CraftBukkit running (as stated in the console) ends with "-DC"
  • As of DC 2.4, DisguiseCraft now checks for a modified CraftBukkit jar through reflection (detecting the injected event).

Don't trust the injector?

Here's a link to the program's source code. Feel free to look through for malicious code. With this, you should keep in mind that you use the injector at your own risk.

Still don't understand?

Feel free to use the comment section of this page to ask for assistance. Hopefully one of the developers or other server admins will be around to help you.
If there was some sort of error, be sure to run the program from the console so that you can supply us with a log.


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes