Added warp-hash update and check

This commit is contained in:
Willem Cazander 2022-03-15 16:53:12 +01:00
parent 14f4cbc2ec
commit fadf971074
12 changed files with 282 additions and 37 deletions

View file

@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="1c2d010066a39d96ace8af0ecc37c72d6f79109f30939e2959befcd9ce25fc8d">../gdxapp4d-chain-sys-engine/src/main/chain</entry>
<entry key="f8be3b29da5b6b2cb464f781469ceede6ccfd848d158293a4cdffbc2c41a410b">../gdxapp4d-chain-sys-default/src/main/chain</entry>
<entry key="1c2d010066a39d96ace8af0ecc37c72d6f79109f30939e2959befcd9ce25fc8d">../gdxapp4d-chain-sys-engine/target/chain</entry>
<entry key="f8be3b29da5b6b2cb464f781469ceede6ccfd848d158293a4cdffbc2c41a410b">../gdxapp4d-chain-sys-default/target/chain</entry>
<entry key="8833aa29da5b6b2cb464f781469ceede6ccfd848d158293a4cdffbc2c41b58de">../gdxapp4d-chain-dep-osgi-scr/src/main/chain</entry>
<entry key="8833aa29da5b6b2cb464f781469ceede6ccfd848d158293a4cdffbc2c41b58de">../gdxapp4d-chain-dep-osgi-scr/target/chain</entry>
<entry key="9944bb29da5b6b2cb464f781469ceede6ccfd848d158293a4cdffbc2c41b62ed">../gdxapp4d-chain-font-unicode4d/target/chain</entry>
<entry key="ffee3329da5b6b2cb4befcc14aac55de6777d848d158293a4cdffbc2c41b12ad">../gdxapp4d-chain-default-music/src/main/chain</entry>
<entry key="7744aa29da5b6b2cb4b8f781469c33de688fd848d158293a4cdddbc2c41b12aa">../gdxapp4d-chain-default-apps/src/main/chain</entry>
<entry key="ffee3329da5b6b2cb4befcc14aac55de6777d848d158293a4cdffbc2c41b12ad">../gdxapp4d-chain-default-music/target/chain</entry>
<entry key="7744aa29da5b6b2cb4b8f781469c33de688fd848d158293a4cdddbc2c41b12aa">../gdxapp4d-chain-default-apps/target/chain</entry>
<entry key="7744aa29da5b6b2cb4b8f781469c33de688fd848d158293a4cdddbc2c41b12aa.bundle/gdxapp4d-app-calculator.jar">../gdxapp4d-app-calculator/target/classes</entry>
<entry key="7744aa29da5b6b2cb4b8f781469c33de688fd848d158293a4cdddbc2c41b12aa.bundle/gdxapp4d-app-hewallet.jar">../gdxapp4d-app-hewallet/target/classes</entry>
<entry key="7744aa29da5b6b2cb4b8f781469c33de688fd848d158293a4cdddbc2c41b12aa.bundle/gdxapp4d-app-tosamp.jar">../gdxapp4d-app-tosamp/target/classes</entry>
<entry key="7744aa29da5b6b2cb4b8f781469c33de688fd848d158293a4cdddbc2c41b12aa.bundle/gdxapp4d-app-notepad.jar">../gdxapp4d-app-notepad/target/classes</entry>
<entry key="7744aa29da5b6b2cb4b8f781469c33de688fd848d158293a4cdddbc2c41b12aa.bundle/gdxapp4d-app-glyphdemo.jar">../gdxapp4d-app-glyphdemo/target/classes</entry>
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc">../gdxapp4d-chain-vrlib/src/main/chain</entry>
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc">../gdxapp4d-chain-vrlib/target/chain</entry>
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc.bundle/gdxapp4d-vrgem4.jar">../gdxapp4d-vrgem4/target/classes</entry>
<entry key="ccba3b29da8b1b1cb444f381449beede3cbfd442d158293a4cdffbc3c41a31cc.bundle/gdxapp4d-vrsys5.jar">../gdxapp4d-vrsys5/target/classes</entry>
</properties>

View file

@ -14,6 +14,12 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d-app-glyphdemo</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d-app-hewallet</artifactId>
@ -33,4 +39,42 @@
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy todir="target/chain">
<fileset dir="src/main/chain" />
</copy>
<copy todir="target/chain/bundle">
<file file="../gdxapp4d-app-calculator/target/gdxapp4d-app-calculator.jar" />
<file file="../gdxapp4d-app-glyphdemo/target/gdxapp4d-app-glyphdemo.jar" />
<file file="../gdxapp4d-app-hewallet/target/gdxapp4d-app-hewallet.jar" />
<file file="../gdxapp4d-app-notepad/target/gdxapp4d-app-notepad.jar" />
<file file="../gdxapp4d-app-tosamp/target/gdxapp4d-app-tosamp.jar" />
</copy>
<java failonerror="true" fork="true" classname="love.distributedrebirth.warpme.hash.WaterShotAddict">
<arg value="target/chain" />
<classpath>
<pathelement location="../gdxapp4d-lib-warpme/target/gdxapp4d-lib-warpme.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/x4o-driver-0.8.7-SNAPSHOT.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/jasper-el-6.0.20.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/el-api-6.0.20.jar" />
</classpath>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -7,4 +7,35 @@
</parent>
<artifactId>gdxapp4d-chain-default-music</artifactId>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy todir="target/chain">
<fileset dir="src/main/chain" />
</copy>
<java failonerror="true" fork="true" classname="love.distributedrebirth.warpme.hash.WaterShotAddict">
<arg value="target/chain" />
<classpath>
<pathelement location="../gdxapp4d-lib-warpme/target/gdxapp4d-lib-warpme.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/x4o-driver-0.8.7-SNAPSHOT.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/jasper-el-6.0.20.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/el-api-6.0.20.jar" />
</classpath>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -7,4 +7,35 @@
</parent>
<artifactId>gdxapp4d-chain-dep-osgi-scr</artifactId>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy todir="target/chain">
<fileset dir="src/main/chain" />
</copy>
<java failonerror="true" fork="true" classname="love.distributedrebirth.warpme.hash.WaterShotAddict">
<arg value="target/chain" />
<classpath>
<pathelement location="../gdxapp4d-lib-warpme/target/gdxapp4d-lib-warpme.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/x4o-driver-0.8.7-SNAPSHOT.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/jasper-el-6.0.20.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/el-api-6.0.20.jar" />
</classpath>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -19,6 +19,15 @@
<copy todir="target/chain">
<fileset dir="src/main/chain" />
</copy>
<java failonerror="true" fork="true" classname="love.distributedrebirth.warpme.hash.WaterShotAddict">
<arg value="target/chain" />
<classpath>
<pathelement location="../gdxapp4d-lib-warpme/target/gdxapp4d-lib-warpme.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/x4o-driver-0.8.7-SNAPSHOT.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/jasper-el-6.0.20.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/el-api-6.0.20.jar" />
</classpath>
</java>
</target>
</configuration>
<goals>

View file

@ -7,4 +7,35 @@
</parent>
<artifactId>gdxapp4d-chain-sys-default</artifactId>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy todir="target/chain">
<fileset dir="src/main/chain" />
</copy>
<java failonerror="true" fork="true" classname="love.distributedrebirth.warpme.hash.WaterShotAddict">
<arg value="target/chain" />
<classpath>
<pathelement location="../gdxapp4d-lib-warpme/target/gdxapp4d-lib-warpme.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/x4o-driver-0.8.7-SNAPSHOT.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/jasper-el-6.0.20.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/el-api-6.0.20.jar" />
</classpath>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -1,10 +1,41 @@
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-chain-sys-engine</artifactId>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>love.distributedrebirth.gdxapp4d</groupId>
<artifactId>gdxapp4d</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>gdxapp4d-chain-sys-engine</artifactId>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy todir="target/chain">
<fileset dir="src/main/chain" />
</copy>
<java failonerror="true" fork="true" classname="love.distributedrebirth.warpme.hash.WaterShotAddict">
<arg value="target/chain" />
<classpath>
<pathelement location="../gdxapp4d-lib-warpme/target/gdxapp4d-lib-warpme.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/x4o-driver-0.8.7-SNAPSHOT.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/jasper-el-6.0.20.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/el-api-6.0.20.jar" />
</classpath>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -21,4 +21,39 @@
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy todir="target/chain">
<fileset dir="src/main/chain" />
</copy>
<copy todir="target/chain/bundle">
<file file="../gdxapp4d-vrgem4/target/gdxapp4d-vrgem4.jar" />
<file file="../gdxapp4d-vrsys5/target/gdxapp4d-vrsys5.jar" />
</copy>
<java failonerror="true" fork="true" classname="love.distributedrebirth.warpme.hash.WaterShotAddict">
<arg value="target/chain" />
<classpath>
<pathelement location="../gdxapp4d-lib-warpme/target/gdxapp4d-lib-warpme.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/x4o-driver-0.8.7-SNAPSHOT.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/jasper-el-6.0.20.jar" />
<pathelement location="../gdxapp4d-lib-warpme/target/dependency/el-api-6.0.20.jar" />
</classpath>
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -32,17 +32,17 @@ public class TestConvFont {
}
// manually run;
// gdxapp4d-chain-sys-unicode4d/src/main/nodejs$ npm install
// gdxapp4d-chain-sys-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane0/ ../../../target/chain2/plane0/
// gdxapp4d-chain-sys-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane1/ ../../../target/chain2/plane1/
// gdxapp4d-chain-sys-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane2/ ../../../target/chain2/plane2/
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ npm install
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane0/ ../../../target/chain2/plane0/
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane1/ ../../../target/chain2/plane1/
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane2/ ../../../target/chain2/plane2/
public void run() {
System.out.println("Starting conversion.");
System.out.println("Starting conversion;");
try {
// NOTE: Are in order like the FontAtlas of ImGui
String in = "../gdxapp4d-chain-sys-unicode4d/target/chain2/";
String out = "../gdxapp4d-chain-sys-unicode4d/target/chain/";
String in = "../gdxapp4d-chain-font-unicode4d/target/chain2/";
String out = "../gdxapp4d-chain-font-unicode4d/target/chain/";
conf("code-2000", new File(in+"plane0/code-2000.ttf.xml"), new File(out+"plane0/code-2000.ttf4d"));
conf("fa-solid-900", new File(in+"plane0/fa-solid-900.ttf.xml"), new File(out+"plane0/fa-solid-900.ttf4d"));

View file

@ -17,4 +17,24 @@
<artifactId>x4o-driver</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -16,6 +16,17 @@ import love.distributedrebirth.warpme.Warpᵐᵉ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class WaterShotAddict {
public static void main(String[] args) {
try {
WaterShotAddict addict = new WaterShotAddict();
addict.updateWarpHashes(new File(args[0]));
System.exit(0);
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
public boolean validateWarpChainLink(File folder) throws FileNotFoundException, X4OConnectionException, SAXException, IOException, NoSuchAlgorithmException {
File fileWarpHash = new File(folder, Warpᵐᵉ.WARP_HASH);
if (!fileWarpHash.exists()) {

View file

@ -5,6 +5,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Hashtable;
@ -39,6 +40,7 @@ import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpSea;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemWarpShip;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;
import love.distributedrebirth.warpme.Warpᵐᵉ;
import love.distributedrebirth.warpme.hash.WaterShotAddict;
import love.distributedrebirth.warpme.sea.WaterOcean;
import love.distributedrebirth.warpme.sea.WaterOceanDriver;
import love.distributedrebirth.warpme.sea.WaterSeaChain;
@ -336,22 +338,22 @@ public class GDXAppTos4Activator implements BundleActivator {
}
LOG.debug("loadWaterOcean key={} home={}",key, waterHome);
// File waterHash = new File(waterHome, Warpᵐᵉ.WARP_HASH);
// if (!waterHash.exists()) {
// logger.accept("ERROR: Missing file: "+waterHash);
// return 1;
// }
// WaterShotAddict addict = new WaterShotAddict();
// try {
// if (!addict.validateWarpChainLink(waterHome)) {
// logger.accept("ERROR: Invalid hash in: "+waterHash);
// return 1;
// }
// } catch (NoSuchAlgorithmException | X4OConnectionException | SAXException | IOException e) {
// e.printStackTrace();
// logger.accept("ERROR: "+e.getMessage());
// return 1;
// }
File waterHash = new File(waterHome, Warpᵐᵉ.WARP_HASH);
if (!waterHash.exists()) {
logger.accept("ERROR: Missing file: "+waterHash);
return 1;
}
WaterShotAddict addict = new WaterShotAddict();
try {
if (!addict.validateWarpChainLink(waterHome)) {
logger.accept("ERROR: Invalid hash in: "+waterHash);
return 1;
}
} catch (NoSuchAlgorithmException | X4OConnectionException | SAXException | IOException e) {
e.printStackTrace();
logger.accept("ERROR: "+e.getMessage());
return 1;
}
File waterSea = new File(waterHome, Warpᵐᵉ.WARP_SEA);