Skip to content

Commit

Permalink
begin release
Browse files Browse the repository at this point in the history
  • Loading branch information
poison committed Nov 2, 2018
2 parents aa9c5e9 + 01300a0 commit 7884a9c
Show file tree
Hide file tree
Showing 35 changed files with 312 additions and 73 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
language: java
17 changes: 12 additions & 5 deletions Building.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
## Building

Prerequisites:
**Prerequisites:**
- maven 3
- openjdk >= 8

Build:
**Build:**
```bash
./build.sh
```

Executables:
**Executables:**
```bash
dxvk-cache-client
dxvk-cache-server
```

Archlinux:
**Debian package:**
```
dxvk-cache-pool-client/target/dxvk-cache-pool-client_*_all.deb
```

### Archlinux

You can use the AUR: https://aur.archlinux.org/pkgbase/dxvk-cache-pool-git/

See [PKGBUILD](arch/PKGBUILD)
Otherwise see [PKGBUILD](arch/PKGBUILD)

## Implementation problems

Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ You can opt to only download cache entries which are signed by verified users (`

See [Verification](Verification.md).

## Miscellaneous
## FAQ

For frequently asked questions, see [FAQ.md](FAQ.md). For building, see the [Building.md](Building.md). For server documentation, see the [server README](dxvk-cache-pool-server/README.md).
For frequently asked questions, see [FAQ](FAQ.md)

## Building

See [Building](Building.md)

## Server

For server documentation, see the [server README](dxvk-cache-pool-server/README.md).
4 changes: 4 additions & 0 deletions dxvk-cache-pool-client/dxvk-cache-client-debian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

exec java -jar /usr/lib/dxvk-cache-pool/dxvk-cache-client.jar "$@"

52 changes: 51 additions & 1 deletion dxvk-cache-pool-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.ignorelist.kassandra</groupId>
<artifactId>dxvk-cache-pool</artifactId>
<version>1.0.1</version>
<version>1.1-SNAPSHOT</version>
</parent>
<artifactId>dxvk-cache-pool-client</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -71,6 +71,56 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>jdeb</artifactId>
<groupId>org.vafer</groupId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<verbose>true</verbose>
<snapshotExpand>true</snapshotExpand>
<verbose>true</verbose>
<controlDir>${basedir}/src/deb/control</controlDir>
<dataSet>
<data>
<src>${project.build.directory}/${project.build.finalName}-boot.jar</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/usr/lib/dxvk-cache-pool</prefix>
<filemode>644</filemode>
</mapper>
<dst>dxvk-cache-client.jar</dst>
</data>
<data>
<src>${maven.multiModuleProjectDirectory}/dxvk-cache-pool.sh</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/etc/profile.d</prefix>
<filemode>755</filemode>
</mapper>
</data>
<data>
<src>${project.basedir}/dxvk-cache-client-debian.sh</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/usr/bin</prefix>
<filemode>755</filemode>
</mapper>
<dst>dxvk-cache-client</dst>
</data>
</dataSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
9 changes: 9 additions & 0 deletions dxvk-cache-pool-client/src/deb/control/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: dxvk-cache-client
Version: [[version]]
Section: games
Priority: low
Architecture: all
Description: Allows sharing of DXVK State Cache, for smoother gameplay for everyone
Maintainer: "rc.poison" <[email protected]>
Homepage: https://github.com/rcpoison/dxvk-cache-pool
Depends: java8-runtime-headless
6 changes: 6 additions & 0 deletions dxvk-cache-pool-client/src/deb/control/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
#
# Script written by SpectralMemories on october 16 2018
# POST INSTALL

echo "Environment variables were tampered with. You should login again or restart the machine"
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableSet;
import com.ignorelist.kassandra.dxvk.cache.pool.common.model.PredicateStateCacheEntrySigned;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down Expand Up @@ -55,7 +56,15 @@ public static void main(String[] args) throws IOException {
c.setScanRecursive(false);
}
if (commandLine.hasOption("min-signatures")) {
c.setMinimumSignatures(Integer.parseInt(commandLine.getOptionValue("min-signatures")));
final int minSignatures=Integer.parseInt(commandLine.getOptionValue("min-signatures"));
if (minSignatures<0) {
System.err.println("min-signatures must be positive");
System.exit(1);
}
if (minSignatures<PredicateStateCacheEntrySigned.DEFAULT_SIGNATURE_MINIMUM) {
System.err.println("You've specified min-signatures < "+PredicateStateCacheEntrySigned.DEFAULT_SIGNATURE_MINIMUM+". Please reconsider, you won't be contributing your signatures.");
}
c.setMinimumSignatures(minSignatures);
}
if (commandLine.hasOption("cache-target-dir")) {
c.setCacheTargetPath(Paths.get(commandLine.getOptionValue("cache-target-dir")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ private void copyToReference(final Path source, final String baseName) throws IO
private StateCache readReference(final int version, final String baseName) throws IOException {
final Path referencePath=buildReferencePath(baseName);
try (InputStream in=new BufferedInputStream(new GZIPInputStream(Files.newInputStream(referencePath)))) {
return StateCacheIO.parse(in);
final StateCache stateCache=StateCacheIO.parse(in);
stateCache.setBaseName(baseName);
return stateCache;
} catch (IOException ioe) {
log.log(ProgressLog.Level.SUB, baseName, "couldn't find reference cache, assuming generated locally");
StateCache stateCache=new StateCache();
Expand Down
2 changes: 1 addition & 1 deletion dxvk-cache-pool-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.ignorelist.kassandra</groupId>
<artifactId>dxvk-cache-pool</artifactId>
<version>1.0.1</version>
<version>1.1-SNAPSHOT</version>
</parent>
<artifactId>dxvk-cache-pool-common</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof Identity)) {
return false;
}
final Identity other=(Identity) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof IdentityVerification)) {
return false;
}
final IdentityVerification other=(IdentityVerification) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof IdentityWithVerification)) {
return false;
}
final IdentityWithVerification other=(IdentityWithVerification) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof PublicKey)) {
return false;
}
final PublicKey other=(PublicKey) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof PublicKeyInfo)) {
return false;
}
final PublicKeyInfo other=(PublicKeyInfo) obj;
Expand All @@ -75,7 +75,7 @@ public boolean equals(Object obj) {
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("hash", BaseEncoding.base16().encode(hash))
.add("hash", null==hash ? null : BaseEncoding.base16().encode(hash))
.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof Signature)) {
return false;
}
final Signature other=(Signature) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof SignatureCount)) {
return false;
}
final SignatureCount other=(SignatureCount) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof SignaturePublicKeyInfo)) {
return false;
}
final SignaturePublicKeyInfo other=(SignaturePublicKeyInfo) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof PredicateAcceptedPublicKeys)) {
return false;
}
final PredicateAcceptedPublicKeys other=(PredicateAcceptedPublicKeys) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof PredicateMinimumSignatures)) {
return false;
}
final PredicateMinimumSignatures other=(PredicateMinimumSignatures) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import java.io.Serializable;
import java.util.Objects;
import javax.xml.bind.annotation.XmlRootElement;

/**
Expand Down Expand Up @@ -69,6 +70,41 @@ public boolean apply(StateCacheEntrySignees input) {
.apply(input);
}

@Override
public int hashCode() {
int hash=7;
hash=41*hash+Objects.hashCode(this.acceptedPublicKeys);
hash=41*hash+Objects.hashCode(this.minimumSignatures);
hash=41*hash+(this.onlyAcceptVerifiedKeys ? 1 : 0);
return hash;
}

@Override
public boolean equals(Object obj) {
if (this==obj) {
return true;
}
if (obj==null) {
return false;
}
if (!(obj instanceof PredicateStateCacheEntrySigned)) {
return false;
}
final PredicateStateCacheEntrySigned other=(PredicateStateCacheEntrySigned) obj;
if (this.onlyAcceptVerifiedKeys!=other.onlyAcceptVerifiedKeys) {
return false;
}
if (!Objects.equals(this.acceptedPublicKeys, other.acceptedPublicKeys)) {
return false;
}
if (!Objects.equals(this.minimumSignatures, other.minimumSignatures)) {
return false;
}
return true;
}



@Override
public String toString() {
return "PredicateStateCacheEntrySigned{"+"acceptedPublicKeys="+acceptedPublicKeys+", minimumSignatures="+minimumSignatures+", onlyAcceptVerifiedKeys="+onlyAcceptVerifiedKeys+'}';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
*
* @author poison
*/
@XmlRootElement
public class StateCache implements StateCacheMeta, Serializable {

private static final Logger LOG=Logger.getLogger(StateCache.class.getName());
Expand Down Expand Up @@ -205,7 +207,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof StateCache)) {
return false;
}
final StateCache other=(StateCache) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof StateCacheEntry)) {
return false;
}
final StateCacheEntry other=(StateCacheEntry) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof StateCacheEntryInfo)) {
return false;
}
final StateCacheEntryInfo other=(StateCacheEntryInfo) obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean equals(Object obj) {
if (obj==null) {
return false;
}
if (getClass()!=obj.getClass()) {
if (!(obj instanceof StateCacheEntryInfoSignees)) {
return false;
}
final StateCacheEntryInfoSignees other=(StateCacheEntryInfoSignees) obj;
Expand Down
Loading

0 comments on commit 7884a9c

Please sign in to comment.