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"?>
<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">
<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">
<parent>
<artifactId>VirtualComputer</artifactId>
<groupId>io.github.NorbiPeti</groupId>
@ -24,7 +23,7 @@
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.2</version>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
@ -104,7 +103,7 @@
<dependency>
<groupId>org.virtualbox</groupId>
<artifactId>VirtualBox-MSCOM</artifactId>
<version>6.0</version>
<version>6.1</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -125,38 +124,23 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>commons-lang</artifactId>
<groupId>commons-lang</groupId>
</exclusion>
<exclusion>
<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>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View file

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

View file

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

View file

@ -5,7 +5,7 @@ import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.virtualbox_6_0.*;
import org.virtualbox_6_1.*;
import sznp.virtualcomputer.events.MachineEventHandler;
import sznp.virtualcomputer.events.VBoxEventHandler;
import sznp.virtualcomputer.renderer.GPURenderer;
@ -136,7 +136,7 @@ public final class Computer {
return;
sendMessage(sender, "§eFixing screen...");
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.");
}

View file

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

View file

@ -2,9 +2,9 @@ package sznp.virtualcomputer.events;
import lombok.val;
import org.bukkit.Bukkit;
import org.virtualbox_6_0.IEvent;
import org.virtualbox_6_0.IEventSource;
import org.virtualbox_6_0.VBoxEventType;
import org.virtualbox_6_1.IEvent;
import org.virtualbox_6_1.IEventSource;
import org.virtualbox_6_1.VBoxEventType;
import sznp.virtualcomputer.util.COMUtils;
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.
*/
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;
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;
}
@ -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()));
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

15
pom.xml
View file

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

View file

@ -3,10 +3,11 @@
<groupId>org.virtualbox</groupId>
<artifactId>VirtualBox-MSCOM</artifactId>
<versioning>
<release>6.0</release>
<release>6.1</release>
<versions>
<version>6.0</version>
<version>6.1</version>
</versions>
<lastUpdated>20190405225845</lastUpdated>
<lastUpdated>20200731215317</lastUpdated>
</versioning>
</metadata>

View file

@ -3,12 +3,13 @@
<groupId>org.virtualbox</groupId>
<artifactId>VirtualBox</artifactId>
<versioning>
<release>6.0</release>
<release>6.1</release>
<versions>
<version>5.1</version>
<version>5.2</version>
<version>6.0</version>
<version>6.1</version>
</versions>
<lastUpdated>20181221211412</lastUpdated>
<lastUpdated>20200731194146</lastUpdated>
</versioning>
</metadata>