Update to VirtualBox 6.1

It's about time
This commit is contained in:
Norbi Peti 2020-08-01 00:14:30 +02:00
parent c98fcdb1c0
commit cd0e1d01b6
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
20 changed files with 80 additions and 93 deletions

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent> <parent>
<artifactId>VirtualComputer</artifactId> <artifactId>VirtualComputer</artifactId>
<groupId>io.github.NorbiPeti</groupId> <groupId>io.github.NorbiPeti</groupId>
@ -24,14 +23,14 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version> <version>3.2.4</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
<goals> <goals>
<goal>shade</goal> <goal>shade</goal>
</goals> </goals>
<configuration/> <configuration />
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
@ -104,7 +103,7 @@
<dependency> <dependency>
<groupId>org.virtualbox</groupId> <groupId>org.virtualbox</groupId>
<artifactId>VirtualBox-MSCOM</artifactId> <artifactId>VirtualBox-MSCOM</artifactId>
<version>6.0</version> <version>6.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -125,38 +124,23 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.12-R0.1-SNAPSHOT</version> <version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> </dependency>
<exclusion> <dependency>
<artifactId>commons-lang</artifactId> <groupId>org.spigotmc</groupId>
<groupId>commons-lang</groupId> <artifactId>spigot</artifactId>
</exclusion> <version>1.16.1-R0.1-SNAPSHOT</version>
<exclusion> <scope>provided</scope>
<artifactId>json-simple</artifactId>
<groupId>com.googlecode.json-simple</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
<exclusion>
<artifactId>gson</artifactId>
<groupId>com.google.code.gson</groupId>
</exclusion>
<exclusion>
<artifactId>snakeyaml</artifactId>
<groupId>org.yaml</groupId>
</exclusion>
<exclusion>
<artifactId>bungeecord-chat</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View file

@ -24,7 +24,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version> <version>3.2.4</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
@ -42,7 +42,7 @@
<dependency> <!-- This has the least additional (platform-dependent) code --> <dependency> <!-- This has the least additional (platform-dependent) code -->
<groupId>org.virtualbox</groupId> <groupId>org.virtualbox</groupId>
<artifactId>VirtualBox-MSCOM</artifactId> <artifactId>VirtualBox-MSCOM</artifactId>
<version>6.0</version> <version>6.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.aparapi</groupId> <groupId>com.aparapi</groupId>

View file

@ -5,7 +5,7 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.virtualbox_6_0.VBoxException; import org.virtualbox_6_1.VBoxException;
public class Commands implements CommandExecutor { public class Commands implements CommandExecutor {

View file

@ -5,7 +5,7 @@ import lombok.Getter;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.virtualbox_6_0.*; import org.virtualbox_6_1.*;
import sznp.virtualcomputer.events.MachineEventHandler; import sznp.virtualcomputer.events.MachineEventHandler;
import sznp.virtualcomputer.events.VBoxEventHandler; import sznp.virtualcomputer.events.VBoxEventHandler;
import sznp.virtualcomputer.renderer.GPURenderer; import sznp.virtualcomputer.renderer.GPURenderer;
@ -136,7 +136,7 @@ public final class Computer {
return; return;
sendMessage(sender, "§eFixing screen..."); sendMessage(sender, "§eFixing screen...");
session.getConsole().getDisplay().setSeamlessMode(false); session.getConsole().getDisplay().setSeamlessMode(false);
session.getConsole().getDisplay().setVideoModeHint(0L, true, false, 0, 0, 640L, 480L, 32L); session.getConsole().getDisplay().setVideoModeHint(0L, true, false, 0, 0, 640L, 480L, 32L, true);
sendMessage(sender, "§eScreen fixed."); sendMessage(sender, "§eScreen fixed.");
} }

View file

@ -6,8 +6,8 @@ import org.bukkit.Bukkit;
import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import org.virtualbox_6_0.IVirtualBox; import org.virtualbox_6_1.IVirtualBox;
import org.virtualbox_6_0.VirtualBoxManager; import org.virtualbox_6_1.VirtualBoxManager;
import sznp.virtualcomputer.events.VBoxEventHandler; import sznp.virtualcomputer.events.VBoxEventHandler;
import sznp.virtualcomputer.renderer.BukkitRenderer; import sznp.virtualcomputer.renderer.BukkitRenderer;
import sznp.virtualcomputer.renderer.GPURenderer; import sznp.virtualcomputer.renderer.GPURenderer;

View file

@ -2,9 +2,9 @@ package sznp.virtualcomputer.events;
import lombok.val; import lombok.val;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.virtualbox_6_0.IEvent; import org.virtualbox_6_1.IEvent;
import org.virtualbox_6_0.IEventSource; import org.virtualbox_6_1.IEventSource;
import org.virtualbox_6_0.VBoxEventType; import org.virtualbox_6_1.VBoxEventType;
import sznp.virtualcomputer.util.COMUtils; import sznp.virtualcomputer.util.COMUtils;
import sznp.virtualcomputer.util.IEventHandler; import sznp.virtualcomputer.util.IEventHandler;
@ -20,10 +20,10 @@ public abstract class EventHandlerBase implements IEventHandler {
/** /**
* The events to listen for. It will only look for these handlers. * The events to listen for. It will only look for these handlers.
*/ */
private final Map<VBoxEventType, Class<? extends org.virtualbox_6_0.IEvent>> eventMap; private final Map<VBoxEventType, Class<? extends org.virtualbox_6_1.IEvent>> eventMap;
private boolean enabled = true; private boolean enabled = true;
protected EventHandlerBase(Map<VBoxEventType, Class<? extends org.virtualbox_6_0.IEvent>> eventMap) { protected EventHandlerBase(Map<VBoxEventType, Class<? extends org.virtualbox_6_1.IEvent>> eventMap) {
this.eventMap = eventMap; this.eventMap = eventMap;
} }
@ -50,7 +50,7 @@ public abstract class EventHandlerBase implements IEventHandler {
} }
} }
public <T extends EventHandlerBase> org.virtualbox_6_0.IEventListener registerTo(IEventSource source) { public <T extends EventHandlerBase> org.virtualbox_6_1.IEventListener registerTo(IEventSource source) {
return COMUtils.registerListener(source, this, new ArrayList<>(eventMap.keySet())); return COMUtils.registerListener(source, this, new ArrayList<>(eventMap.keySet()));
} }

View file

@ -6,9 +6,9 @@ import lombok.experimental.var;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.virtualbox_6_0.IProgress; import org.virtualbox_6_1.IProgress;
import org.virtualbox_6_0.IStateChangedEvent; import org.virtualbox_6_1.IStateChangedEvent;
import org.virtualbox_6_0.VBoxEventType; import org.virtualbox_6_1.VBoxEventType;
import sznp.virtualcomputer.Computer; import sznp.virtualcomputer.Computer;
import sznp.virtualcomputer.PluginMain; import sznp.virtualcomputer.PluginMain;

View file

@ -4,9 +4,9 @@ import com.google.common.collect.ImmutableMap;
import lombok.Getter; import lombok.Getter;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.virtualbox_6_0.ISessionStateChangedEvent; import org.virtualbox_6_1.ISessionStateChangedEvent;
import org.virtualbox_6_0.SessionState; import org.virtualbox_6_1.SessionState;
import org.virtualbox_6_0.VBoxEventType; import org.virtualbox_6_1.VBoxEventType;
import sznp.virtualcomputer.Computer; import sznp.virtualcomputer.Computer;
public class VBoxEventHandler extends EventHandlerBase { public class VBoxEventHandler extends EventHandlerBase {

View file

@ -4,10 +4,10 @@ import com.sun.jna.Pointer;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import org.virtualbox_6_0.Holder; import org.virtualbox_6_1.Holder;
import org.virtualbox_6_0.IDisplay; import org.virtualbox_6_1.IDisplay;
import org.virtualbox_6_0.IDisplaySourceBitmap; import org.virtualbox_6_1.IDisplaySourceBitmap;
import org.virtualbox_6_0.VBoxException; import org.virtualbox_6_1.VBoxException;
import sznp.virtualcomputer.PluginMain; import sznp.virtualcomputer.PluginMain;
import sznp.virtualcomputer.util.COMUtils; import sznp.virtualcomputer.util.COMUtils;
import sznp.virtualcomputer.util.IMCFrameBuffer; import sznp.virtualcomputer.util.IMCFrameBuffer;
@ -16,7 +16,7 @@ import sznp.virtualcomputer.util.Timing;
@RequiredArgsConstructor @RequiredArgsConstructor
public class MCFrameBuffer implements IMCFrameBuffer { public class MCFrameBuffer implements IMCFrameBuffer {
private final IDisplay display; private final IDisplay display;
private Holder<IDisplaySourceBitmap> holder = new Holder<>(); private final Holder<IDisplaySourceBitmap> holder = new Holder<>();
private BukkitTask tt; private BukkitTask tt;
private Pointer pointer; private Pointer pointer;
private int width; private int width;

View file

@ -18,7 +18,7 @@
<dependency> <dependency>
<groupId>org.virtualbox</groupId> <groupId>org.virtualbox</groupId>
<artifactId>VirtualBox-MSCOM</artifactId> <artifactId>VirtualBox-MSCOM</artifactId>
<version>6.0</version> <version>6.1</version>
<optional>true <optional>true
</optional> <!-- https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html --> </optional> <!-- https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html -->
</dependency> </dependency>

View file

@ -15,7 +15,7 @@
<dependency> <dependency>
<groupId>org.virtualbox</groupId> <groupId>org.virtualbox</groupId>
<artifactId>VirtualBox</artifactId> <artifactId>VirtualBox</artifactId>
<version>6.0</version> <version>6.1</version>
<optional>true <optional>true
</optional> <!-- https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html --> </optional> <!-- https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html -->
</dependency> </dependency>

View file

@ -5,8 +5,8 @@ import org.mozilla.interfaces.IFramebuffer;
import org.mozilla.interfaces.IFramebufferOverlay; import org.mozilla.interfaces.IFramebufferOverlay;
import org.mozilla.interfaces.nsISupports; import org.mozilla.interfaces.nsISupports;
import org.mozilla.xpcom.Mozilla; import org.mozilla.xpcom.Mozilla;
import org.virtualbox_6_0.BitmapFormat; import org.virtualbox_6_1.BitmapFormat;
import org.virtualbox_6_0.FramebufferCapabilities; import org.virtualbox_6_1.FramebufferCapabilities;
import sznp.virtualcomputer.util.IMCFrameBuffer; import sznp.virtualcomputer.util.IMCFrameBuffer;
import java.util.Arrays; import java.util.Arrays;

View file

@ -25,7 +25,7 @@ public final class EventHandler extends COMObjectBase implements IEventListener
public final void handleEvent(IEvent iEvent) { public final void handleEvent(IEvent iEvent) {
if (!enabled) if (!enabled)
return; return;
handler.handleEvent(new org.virtualbox_6_0.IEvent(iEvent)); handler.handleEvent(new org.virtualbox_6_1.IEvent(iEvent));
} }
public void disable() { public void disable() {

View file

@ -1,8 +1,8 @@
package sznp.virtualcomputer.util; package sznp.virtualcomputer.util;
import lombok.val; import lombok.val;
import org.virtualbox_6_0.*; import org.virtualbox_6_1.*;
import org.virtualbox_6_0.xpcom.IUnknown; import org.virtualbox_6_1.xpcom.IUnknown;
import sznp.virtualcomputer.COMFrameBuffer; import sznp.virtualcomputer.COMFrameBuffer;
import sznp.virtualcomputer.EventHandler; import sznp.virtualcomputer.EventHandler;
@ -14,8 +14,8 @@ public final class COMUtils {
} }
//public static void registerListener(IEventSource source, IEventListener listener, VBoxEventType... types) { //public static void registerListener(IEventSource source, IEventListener listener, VBoxEventType... types) {
public static org.virtualbox_6_0.IEventListener registerListener(IEventSource source, IEventHandler listener, List<VBoxEventType> types) { public static org.virtualbox_6_1.IEventListener registerListener(IEventSource source, IEventHandler listener, List<VBoxEventType> types) {
val ret = new org.virtualbox_6_0.IEventListener(new EventHandler(listener)); val ret = new org.virtualbox_6_1.IEventListener(new EventHandler(listener));
source.registerListener(ret, types, true); source.registerListener(ret, types, true);
return ret; return ret;
} }

View file

@ -1,6 +1,6 @@
package sznp.virtualcomputer.util; package sznp.virtualcomputer.util;
import org.virtualbox_6_0.IEvent; import org.virtualbox_6_1.IEvent;
public interface IEventHandler { public interface IEventHandler {
void handleEvent(IEvent iEvent); void handleEvent(IEvent iEvent);

15
pom.xml
View file

@ -27,7 +27,7 @@
<repositories> <repositories>
<repository> <repository>
<id>repo</id> <id>repo</id>
<url>file://${basedir}/repo</url> <url>file://${basedir}/../repo</url>
</repository> </repository>
<repository> <repository>
<id>spigot-repo</id> <id>spigot-repo</id>
@ -45,7 +45,8 @@
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>1.16.16</version> <version>1.18.12</version>
<scope>provided</scope>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/net.java.dev.jna/jna --> <!-- https://mvnrepository.com/artifact/net.java.dev.jna/jna -->
<dependency> <dependency>
@ -70,12 +71,12 @@
<version>1.12-R0.1-SNAPSHOT</version> <version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- <dependency> - Not using anything from here directly so we're not that dependent on versions <dependency> <!-- Not using anything from here directly so we're not that dependent on versions -->
<groupId>org.bukkit</groupId> <groupId>org.spigotmc</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>spigot</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version> <version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> --> </dependency>
</dependencies> </dependencies>
<build> <build>

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<metadata> <metadata>
<groupId>org.virtualbox</groupId> <groupId>org.virtualbox</groupId>
<artifactId>VirtualBox-MSCOM</artifactId> <artifactId>VirtualBox-MSCOM</artifactId>
<versioning> <versioning>
<release>6.0</release> <release>6.1</release>
<versions> <versions>
<version>6.0</version> <version>6.0</version>
</versions> <version>6.1</version>
<lastUpdated>20190405225845</lastUpdated> </versions>
</versioning> <lastUpdated>20200731215317</lastUpdated>
</versioning>
</metadata> </metadata>

View file

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<metadata> <metadata>
<groupId>org.virtualbox</groupId> <groupId>org.virtualbox</groupId>
<artifactId>VirtualBox</artifactId> <artifactId>VirtualBox</artifactId>
<versioning> <versioning>
<release>6.0</release> <release>6.1</release>
<versions> <versions>
<version>5.1</version> <version>5.1</version>
<version>5.2</version> <version>5.2</version>
<version>6.0</version> <version>6.0</version>
</versions> <version>6.1</version>
<lastUpdated>20181221211412</lastUpdated> </versions>
</versioning> <lastUpdated>20200731194146</lastUpdated>
</versioning>
</metadata> </metadata>