Skip to content

Commit bdd11bd

Browse files
Merge branch 'master' into develop
# Conflicts: # build.gradle # src/main/java/com/apporelbotna/gameserver/persistencewsclient/GameDAO.java
2 parents e33b274 + 96893a0 commit bdd11bd

File tree

4 files changed

+68
-4
lines changed

4 files changed

+68
-4
lines changed

build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jar {
1313

1414
repositories {
1515
jcenter()
16+
maven { url 'https://jitpack.io/' }
1617
}
1718

1819
dependencies {
@@ -23,11 +24,12 @@ dependencies {
2324
testImplementation 'junit:junit:4.12'
2425

2526
// https://mvnrepository.com/artifact/org.springframework.hateoas/spring-hateoas
26-
compile 'org.springframework.hateoas:spring-hateoas:0.24.0.RELEASE'
27+
compileOnly 'org.springframework.hateoas:spring-hateoas:0.24.0.RELEASE'
2728

2829
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web
2930
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.0.0.RELEASE'
3031

31-
compile fileTree(dir: 'libs', include: '*.jar')
32+
// PersistenceWS Stubs
33+
compile 'com.github.java-game-server:stubs:0.6.2'
3234

3335
}

src/main/java/com/apporelbotna/gameserver/persistencewsclient/DAO.java renamed to src/main/java/com/apporelbotna/gameserver/persistencewsclient/GameDAO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
import com.apporelbotna.gameserver.stubs.User;
1717
import com.apporelbotna.gameserver.stubs.UserWrapper;
1818

19-
public class DAO {
19+
public class GameDAO {
2020
public static final String SERVER_URL = "http://localhost:8082/";
2121
RestTemplate restTemplate = new RestTemplate();
2222

23-
public DAO() {
23+
public GameDAO() {
2424

2525
}
2626

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package com.apporelbotna.gameserver.persistencewsclient.properties;
2+
3+
import java.io.FileInputStream;
4+
import java.io.IOException;
5+
import java.util.Properties;
6+
7+
import org.slf4j.Logger;
8+
import org.slf4j.LoggerFactory;
9+
10+
public final class ApplicationProperties
11+
{
12+
private static final Logger logger = LoggerFactory.getLogger(ApplicationProperties.class);
13+
14+
private static String version;
15+
private static String name;
16+
17+
private static String serverUrl;
18+
19+
private ApplicationProperties()
20+
{
21+
throw new UnsupportedOperationException("ApplicationProperties must not be instantiated!");
22+
}
23+
24+
static
25+
{
26+
String rootPath = Thread.currentThread().getContextClassLoader().getResource("").getPath();
27+
String applicationPropertiesPath = rootPath + "com\\apporelbotna\\gameserver\\persistencewsclient\\properties\\application.properties";
28+
29+
Properties applicationProperties = new Properties();
30+
try
31+
{
32+
applicationProperties.load(new FileInputStream(applicationPropertiesPath));
33+
version = applicationProperties.getProperty("version");
34+
name = applicationProperties.getProperty("name");
35+
36+
serverUrl = applicationProperties.getProperty("server.url");
37+
}
38+
catch (IOException e)
39+
{
40+
logger.error(e.getMessage());
41+
}
42+
}
43+
44+
public static String getVersion()
45+
{
46+
return version;
47+
}
48+
49+
public static String getName()
50+
{
51+
return name;
52+
}
53+
54+
public static String getServerUrl()
55+
{
56+
return serverUrl;
57+
}
58+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version=3.0.0
2+
name=PersistenceWSClient
3+
4+
server.url=http\://localhost\:8082/

0 commit comments

Comments
 (0)