Merge pull request #60 from ScarySpider/More-Maven-fixes

More maven fixes
This commit is contained in:
Simon Fortier
2017-12-29 13:48:56 -05:00
committed by GitHub
13 changed files with 76 additions and 26 deletions

View File

@@ -6,9 +6,6 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/${parent.project.basedir}/ServerTarget" />
<excludeFolder url="file://$MODULE_DIR$/ServerTarget" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />

View File

@@ -3,15 +3,37 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.simon987.server</groupId>
<artifactId>server_root</artifactId>
<version>1.2a</version>
</parent>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>default-resources</id>
<!-- here the phase you need -->
<phase>prepare-package</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<outputDirectory>../target/</outputDirectory>
<resources>
<resource>
<directory>../Server/src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>config.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<version>3.6.2</version>
<groupId>org.apache.maven.plugins</groupId>
@@ -21,11 +43,36 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>../target/libs</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<outputDirectory>../target</outputDirectory>
<archive>
<manifest>
<mainClass>net.simon987.server.Main</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>libs/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
@@ -60,4 +107,9 @@
</dependencies>
<properties>
<!-- explicitly set build encoding so not altered by build platform defaults -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@@ -40,7 +40,7 @@ public class GameServer implements Runnable {
public GameServer() {
this.config = new ServerConfiguration(new File("config.properties"));
this.config = new ServerConfiguration("config.properties");
gameUniverse = new GameUniverse(config);
pluginManager = new PluginManager();

View File

@@ -12,8 +12,7 @@ public class Main {
LogManager.initialize();
ServerConfiguration config = new ServerConfiguration(new File("config.properties"));
ServerConfiguration config = new ServerConfiguration("config.properties");
//Load
GameServer.INSTANCE.getGameUniverse().load(new File("save.json"));

View File

@@ -6,6 +6,7 @@ import net.simon987.server.logging.LogManager;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
@@ -18,11 +19,11 @@ public class ServerConfiguration {
*/
private Properties properties;
public ServerConfiguration(File file) {
public ServerConfiguration(String file) {
try {
properties = new Properties();
properties.load(new FileInputStream(file));
InputStream is = new FileInputStream("config.properties");
properties.load(is);
} catch (IOException e) {
LogManager.LOGGER.severe("Problem loading server configuration: " + e.getMessage());

View File

@@ -0,0 +1,78 @@
# MySQL username
mysql_user=mar
# MySQL password/
mysql_pass=mar
# MySQL address
mysql_url=jdbc:mysql://localhost:3306/mar?useSSL=false
# File management
save_interval=5
clean_interval=10
history_size=10
# Web server port
webSocket_port=8887
webSocket_host=0.0.0.0
use_secure_webSocket=0
cert_path=certificates
# ----------------------------------------------
# Length of a tick in ms
tick_length=1000
# Default offset of the origin (starting point of code execution) in words
org_offset=512
# Address of the stack bottom
stack_bottom=65536
# Size of the memory in words
memory_size=65536
# Initial location of new user's controlled unit
new_user_worldX = 32767
new_user_worldY = 32767
# Default user code
new_user_code=; Welcome to Much Assembly required!\n\
; You will find useful information on the game here: https://github.com/simon987/Much-Assembly-Required/wiki\n\
.text\n\
\t; Write code here\n\
\tbrk
# Default held item
new_user_item=0
# ----------------------------------------------
# Biomass units for each blob
biomass_yield=2
# Minimum biomass blob count for the WorldGenerator
minBiomassCount=3
minBiomassRespawnCount=2
# Maximum biomass blob count for the WorldGenerator
maxBiomassCount=10
maxBiomassRespawnCount=6
# Maximum energy of the battery hardware in kJ
battery_max_energy=60000
# Time for biomass respawn in ticks
biomassRespawnTime=64
# Respawn timer will start when biomass count is below this number
biomassRespawnThreshold=1
# NPC lifetime in ticks
npc_lifetime=1024
# Maximum travel distance from the Factory in Worlds
npc_max_factory_distance=3
# Maximum NPC per Factory
factory_max_npc_count=16
# ----------------------------------------------
# Minimum center point count for the WorldGenerator
wg_centerPointCountMin=5
# Maximum center point count for the WorldGenerator
wg_centerPointCountMax=15
# Wall/Plain tile ratio for the WorldGenerator
wg_wallPlainRatio=4
# Minimum iron tiles count for the WorldGenerator
wg_minIronCount=0
# Minimum iron tile count for the WorldGenerator
wg_maxIronCount=2
# Minimum copper tile count for the WorldGenerator
wg_minCopperCount=0
# Maximum copper tile count for the WorldGenerator
wg_maxCopperCount=2
# ----------------------------------------------
# Maximum execution time of user code in ms
user_timeout=100