From 28b7a6b2377d4fe4a7d1a96bb2ddb6cbd78b529c Mon Sep 17 00:00:00 2001 From: Martin <ms618@hdm-stuttgart.de> Date: Fri, 12 Jan 2024 21:28:43 +0100 Subject: [PATCH] Update: Parser.java (change text of an exception) Update: ParserTest.java (change text of an exception) Update: AzureDB.java (added method to reset stats) Update: OracleDB.java (added method to reset stats) Update: ISQLDataBase.java (added method to reset stats) Update: DDL_Script_Oracle.sql (changed max length for mapData; added new test maps) Update: DDL_Script_AzureDB.sql (changed max length for mapData; added new test maps) Update: Persistence.java (added method to reset locally stored mapData if corrupted) --- .../Model/DataStorage/Classes/AzureDB.java | 49 ++++++++++++------- .../DataStorage/Classes/ISQLDataBase.java | 1 + .../Model/DataStorage/Classes/OracleDB.java | 31 +++++++++--- .../DataStorage/Classes/Persistence.java | 45 +++++++++++++++-- .../DataStorage/Classes/Utilities/Parser.java | 2 +- .../Scripts/DDL_Script_AzureDB.sql | 18 +++---- .../DataStorage/Scripts/DDL_Script_Oracle.sql | 18 +++---- src/main/resources/maps/communityMaps.json | 9 ++++ src/main/resources/maps/coreMaps.json | 8 +-- .../Classes/Utilities/ParserTest.java | 4 +- 10 files changed, 131 insertions(+), 54 deletions(-) diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/AzureDB.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/AzureDB.java index b138e769..38e6fcb0 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/AzureDB.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/AzureDB.java @@ -1,35 +1,30 @@ package de.hdm_stuttgart.battlearena.Model.DataStorage.Classes; +import de.hdm_stuttgart.battlearena.Model.DataStorage.Classes.Utilities.CryptoUtils; import de.hdm_stuttgart.battlearena.Model.DataStorage.Classes.Exceptions.CryptoException; import de.hdm_stuttgart.battlearena.Model.DataStorage.Classes.Exceptions.SQLException; -import de.hdm_stuttgart.battlearena.Model.DataStorage.Classes.Utilities.CryptoUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; +import java.sql.*; import java.util.ArrayList; -public class AzureDB implements ISQLDataBase { +/*this class is only here for showcasing the interchangeability of the DBMS. AzureDB could be used as fallback database when primary database is unreachable*/ - /*this class is only here for showcasing the interchangeability of the DBMS*/ +public class AzureDB implements ISQLDataBase { private static String user=""; private static String password=""; private static String[] parts= new String[2]; - static File encryptedFile = new File("src\\main\\resources\\database\\AzureDB_logindetails"); - private static final Logger log = LogManager.getLogger(OracleDB.class); public static void getLoginData() throws CryptoException { parts = CryptoUtils.decrypt(encryptedFile); user = parts[0]; password = parts[1]; - log.info("AzureDB_logindetails: user: " + user + " password: " + password); + //log.info("AzureDB_logindetails: user: " + user + " password: " + password); } @Override @@ -37,18 +32,17 @@ public class AzureDB implements ISQLDataBase { try { getLoginData(); String url = "jdbc:sqlserver://battlearena.database.windows.net;encrypt=true;user=" + user + ";password=" + password + ";databaseName=battleArena;"; - - log.info("Connecting to the database!"); Connection connection = DriverManager.getConnection(url); - log.info("Database connection test" + connection.getCatalog()); - + //log.info("Database connection test" + connection.getCatalog()); connection.setAutoCommit(true); + log.info("Connecting to the database!"); + return connection; } catch(Exception e){ log.error(e); - throw new SQLException("SQL Connection Error! " + e.getMessage()); + throw new SQLException("SQL connection error! " + e.getMessage()); } } @@ -65,14 +59,14 @@ public class AzureDB implements ISQLDataBase { while(rs.next()){ newMaps.add(new MapData(rs.getString("map_id"), rs.getString("map_name"), rs.getInt("map_width"), rs.getInt("map_height"), rs.getString("map_data"))); } - log.info("SQL query successful"); rs.close(); stmt.close(); + log.info("Coremaps retrieved successfully"); return newMaps; } catch(Exception e){ log.error(e); - throw new SQLException("Error retrieving Coremaps! " + e.getMessage()); + throw new SQLException("Error retrieving coremaps! " + e.getMessage()); } } @@ -213,7 +207,7 @@ public class AzureDB implements ISQLDataBase { log.info("Sending SQL statement"); ResultSet rs = stmt.executeQuery(); if(rs.next() == false){ //if no data matches - throw new SQLException("No match on Database"); + throw new SQLException("No match on database"); } PlayerStatistics stats = new PlayerStatistics(0, 0, 0, 0, 0, 0); while(rs.next()) { @@ -255,4 +249,23 @@ public class AzureDB implements ISQLDataBase { } } + @Override + public void resetPlayerStats(PlayerAccount account) throws SQLException{ //verification of player credentials necessary beforehand (use methode "verifyAccountData" in "Persistence.java) + try(Connection connection = connect()) { + String sql = "UPDATE players SET games_won = 0, games_lost = 0, kills = 0, deaths = 0, blocks_destroyed = 0, ingame_time = 0 WHERE player_name = ?"; + PreparedStatement stmt = connection.prepareStatement(sql); + stmt.setString(1, account.getPlayerName()); + + log.info("Sending SQL statement"); + stmt.executeQuery(); + + stmt.close(); + log.info("Player statistics reset successfully"); + } + catch(Exception e){ + log.error(e); + throw new SQLException("Error resetting player statistics! " + e.getMessage()); + } + } + } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/ISQLDataBase.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/ISQLDataBase.java index dd7bb2f0..7a169c9b 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/ISQLDataBase.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/ISQLDataBase.java @@ -19,5 +19,6 @@ public interface ISQLDataBase { String checkCredentials(String playerName) throws SQLException; PlayerStatistics getStatistics(String playerName) throws SQLException; void updatePlayerStats(PlayerStatistics stats, PlayerAccount account) throws SQLException; + void resetPlayerStats(PlayerAccount account) throws SQLException; } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/OracleDB.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/OracleDB.java index 070e42d3..582b425c 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/OracleDB.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/OracleDB.java @@ -12,18 +12,14 @@ import java.util.ArrayList; import oracle.jdbc.pool.OracleDataSource; - public class OracleDB implements ISQLDataBase { + private static String user=""; private static String password=""; private static String[] parts= new String[2]; - static File encryptedFile = new File("src\\main\\resources\\database\\OracleDB_logindetails"); - - //static File encryptedFile = new File("src\\main\\resources\\database\\document.encrypted"); - //static File decryptedFile = new File("src\\main\\resources\\database\\document.decrypted"); - private static final Logger log = LogManager.getLogger(OracleDB.class); + public static void getLoginData() throws CryptoException { parts = CryptoUtils.decrypt(encryptedFile); user = parts[0]; @@ -62,7 +58,7 @@ public class OracleDB implements ISQLDataBase { ResultSet rs = stmt.executeQuery(); while(rs.next()){ - newMaps.add(new MapData(rs.getString("map_id"), rs.getString("map_name"), rs.getInt("map_width"), rs.getInt("map_height"), rs.getString("map_data"))); + newMaps.add(new MapData(rs.getString("map_id"), rs.getString("map_name"), rs.getInt("map_width"), rs.getInt("map_height"), rs.getString("map_data"))); } rs.close(); stmt.close(); @@ -129,7 +125,7 @@ public class OracleDB implements ISQLDataBase { return mapChosen; } catch(Exception e){ - log.error(e.getMessage()); + log.error(e); throw new SQLException("Error retrieving community map! " + e.getMessage()); } } @@ -254,4 +250,23 @@ public class OracleDB implements ISQLDataBase { } } + @Override + public void resetPlayerStats(PlayerAccount account) throws SQLException{ //verification of player credentials necessary beforehand (use methode "verifyAccountData" in "Persistence.java) + try(Connection connection = connect()) { + String sql = "UPDATE battlearenadata.players SET games_won = 0, games_lost = 0, kills = 0, deaths = 0, blocks_destroyed = 0, ingame_time = 0 WHERE player_name = ?"; + PreparedStatement stmt = connection.prepareStatement(sql); + stmt.setString(1, account.getPlayerName()); + + log.info("Sending SQL statement"); + stmt.executeQuery(); + + stmt.close(); + log.info("Player statistics reset successfully"); + } + catch(Exception e){ + log.error(e); + throw new SQLException("Error resetting player statistics! " + e.getMessage()); + } + } + } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Persistence.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Persistence.java index d8dd5bf0..63697bae 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Persistence.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Persistence.java @@ -204,7 +204,7 @@ public class Persistence { Parser.usernameValid(account.getPlayerName()); } else if (account.getAccountType() == AccountType.ONLINE) { Parser.usernameValid(account.getPlayerName()); - Parser.sha1HashValid(account.getAccountPassword()); + Parser.sha1HexHashValid(account.getAccountPassword()); if (!(account.getAccountPassword().equals(db.checkCredentials(account.getPlayerName())))){ throw new DatabaseException("Locally stored password does not match online password. Please reenter credentials!"); } @@ -258,7 +258,7 @@ public class Persistence { } } - public void updatePlayerStatistics(int kills, int deaths, int gameTime, boolean gameWon){ //after game round + public void updatePlayerStatistics(int kills, int deaths, int gameTime, boolean gameWon) throws DatabaseException{ //after game round statistics.setKills(statistics.getKills() + kills); statistics.setDeaths(statistics.getDeaths() + deaths); statistics.setGameTime(statistics.getGameTime() + gameTime); @@ -268,15 +268,54 @@ public class Persistence { else{ statistics.setGamesWon(statistics.getGamesLost() + 1); } + log.info("Statistics successfully updated!"); } - public void savePlayerStatistics(){ //on shutdown of game + public void savePlayerStatistics() throws DatabaseException{ //on shutdown of game try { if (account.getAccountType() == AccountType.LOCAL) { gsonHandler.saveStats(statistics); } else if (account.getAccountType() == AccountType.ONLINE) { db.updatePlayerStats(statistics, account); } + log.info("Statistics successfully saved!"); + } + catch(Exception e){ + log.error(e); + } + } + + public void resetPlayerStatistics() throws DatabaseException{ //on shutdown of game + try { + verifyPlayerAccount(); + if (account.getAccountType() == AccountType.LOCAL) { + statistics = new PlayerStatistics(0, 0, 0, 0, 0, 0); + gsonHandler.saveStats(statistics); + } else if (account.getAccountType() == AccountType.ONLINE) { + db.resetPlayerStats(account); + statistics = new PlayerStatistics(0, 0, 0, 0, 0, 0); + } + log.info("Statistics successfully reset!"); + } + catch(Exception e){ + log.error(e); + } + } + + public void resetSettings(){ + //implement me (user can click button to reset settings to default values) + } + + public void resetMaps(){ + try { + coreMaps = new ArrayList<MapData>(); + coreMaps.add(new MapData("09a02b54d05b5b7ebc29a4383ca12d3dda846b72", "Arena1", 18, 18, "12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12")); + coreMaps.add(new MapData("0ab15557ab6dc4be60dfe6a9b0288bac3036bd97", "Arena2", 18, 18, "12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 1 1 1 1 1 1 1 5 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12")); + gsonHandler.saveMaps(coreMaps, MapType.COREMAP); + + communityMaps = new ArrayList<MapData>(); + communityMaps.add(new MapData("fbf44184867512faecc195ae75ca55d5ab7bad2d", "Arena3", 18, 18, "12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12")); + gsonHandler.saveMaps(communityMaps, MapType.COMMUNITYMAP); } catch(Exception e){ log.error(e); diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Utilities/Parser.java b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Utilities/Parser.java index aad88f10..385d1a4f 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Utilities/Parser.java +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Utilities/Parser.java @@ -133,7 +133,7 @@ public class Parser { Matcher mat = pat.matcher(address.substring(i, i+1)); boolean result = mat.find(); if(result){ - throw new ParserException("IP address does not consist out of numbers 0-9 and separators (.) !"); + throw new ParserException("IP address must consist out of numbers 0-9 and separators (.) !"); } } diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Scripts/DDL_Script_AzureDB.sql b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Scripts/DDL_Script_AzureDB.sql index 64e90f19..c4029043 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Scripts/DDL_Script_AzureDB.sql +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Scripts/DDL_Script_AzureDB.sql @@ -11,14 +11,14 @@ CREATE TABLE coremaps( map_name VARCHAR(30) NOT NULL, map_width INTEGER NOT NULL, map_height INTEGER NOT NULL, - map_data VARCHAR(1682) NOT NULL UNIQUE); --allows for map size up to 29x29 + map_data VARCHAR(1082) NOT NULL UNIQUE); --allows for map size up to 19x19 (when using double digit numbers for tiles) CREATE TABLE communitymaps( map_id CHAR(40) NOT NULL UNIQUE, --SHA1 hash is 40 chars length in hex map_name VARCHAR(30) NOT NULL, map_width INTEGER NOT NULL, map_height INTEGER NOT NULL, - map_data VARCHAR(1682) NOT NULL UNIQUE, --allows for map size up to 29x29 + map_data VARCHAR(1082) NOT NULL UNIQUE, --allows for map size up to 19x19 (when using double digit numbers for tiles) map_downloads INTEGER NOT NULL); CREATE TABLE players( @@ -33,25 +33,25 @@ CREATE TABLE players( INSERT INTO coremaps (map_id, map_name, map_width, map_height, map_data) -VALUES ('72e1c81687463ab159b4cb8d935e347a26d7fe40', +VALUES ('09a02b54d05b5b7ebc29a4383ca12d3dda846b72', 'Arena1', 18, 18, - '3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3'); + '12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12'); INSERT INTO coremaps (map_id, map_name, map_width, map_height, map_data) -VALUES ('f7e1fc56cefbacacb9ba403220476f3ac258de06', +VALUES ('0ab15557ab6dc4be60dfe6a9b0288bac3036bd97', 'Arena2', 18, 18, - '3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 3 3 3 1 3 3 3 3 3 1 1 3 3 1 1 1 1 1 3 1 1 1 1 1 1 1 3 1 1 3 3 1 1 1 1 1 3 1 3 3 3 1 1 1 3 1 1 3 3 1 1 1 1 1 3 1 1 1 1 1 1 1 3 1 1 3 3 1 1 1 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 10 10 10 10 10 10 12'); INSERT INTO communitymaps (map_id, map_name, map_width, map_height, map_data, map_downloads) -VALUES ('c8ce8e85e4a9b99e4fa956e2486e55df73b2cf08', - 'Arena1', +VALUES ('fbf44184867512faecc195ae75ca55d5ab7bad2d', + 'Arena3', 18, 18, - '3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 3 3 3 3 1 1 1 1 1 1 1 3 3 1 1 1 1 1 3 3 3 3 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3', + '12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12', 0); INSERT INTO players (player_name, player_pw, games_won, games_lost, kills, deaths, blocks_destroyed, ingame_time) diff --git a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Scripts/DDL_Script_Oracle.sql b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Scripts/DDL_Script_Oracle.sql index af8c0ca3..97ff0eea 100644 --- a/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Scripts/DDL_Script_Oracle.sql +++ b/src/main/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Scripts/DDL_Script_Oracle.sql @@ -17,14 +17,14 @@ CREATE TABLE battlearenadata.coremaps( map_name VARCHAR(30) NOT NULL, map_width INTEGER NOT NULL, map_height INTEGER NOT NULL, - map_data VARCHAR(1682) NOT NULL UNIQUE); --allows for map size up to 29x29 + map_data VARCHAR(1082) NOT NULL UNIQUE); --allows for map size up to 19x19 (when using double digit numbers for tiles) CREATE TABLE battlearenadata.communitymaps( map_id CHAR(40) NOT NULL UNIQUE, --SHA1 hash is 40 chars length in hex map_name VARCHAR(30) NOT NULL, map_width INTEGER NOT NULL, map_height INTEGER NOT NULL, - map_data VARCHAR(1682) NOT NULL UNIQUE, --allows for map size up to 29x29 + map_data VARCHAR(1082) NOT NULL UNIQUE, --allows for map size up to 19x19 (when using double digit numbers for tiles) map_downloads INTEGER NOT NULL); CREATE TABLE battlearenadata.players( @@ -42,25 +42,25 @@ ALTER USER battlearenadata QUOTA 500M ON communitymaps; ALTER USER battlearenadata QUOTA 500M ON players; INSERT INTO battlearenadata.coremaps (map_id, map_name, map_width, map_height, map_data) -VALUES ('72e1c81687463ab159b4cb8d935e347a26d7fe40', +VALUES ('09a02b54d05b5b7ebc29a4383ca12d3dda846b72', 'Arena1', 18, 18, - '3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3'); + '12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12'); INSERT INTO battlearenadata.coremaps (map_id, map_name, map_width, map_height, map_data) -VALUES ('f7e1fc56cefbacacb9ba403220476f3ac258de06', +VALUES ('0ab15557ab6dc4be60dfe6a9b0288bac3036bd97', 'Arena2', 18, 18, - '3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 3 3 3 1 3 3 3 3 3 1 1 3 3 1 1 1 1 1 3 1 1 1 1 1 1 1 3 1 1 3 3 1 1 1 1 1 3 1 3 3 3 1 1 1 3 1 1 3 3 1 1 1 1 1 3 1 1 1 1 1 1 1 3 1 1 3 3 1 1 1 1 1 3 3 3 1 3 3 3 3 3 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 3 3 3 1 3 3 3 3 3 1 1 3 3 1 1 1 1 1 3 3 3 1 3 3 3 3 3 1 1 3 3 1 1 1 1 1 3 3 3 1 3 3 3 3 3 1 1 3 3 1 1 1 1 1 3 3 3 1 3 3 3 3 3 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 1 1 1 1 3 3 3 1 3 3 3 3 3 1 1 3 3 1 1 1 1 1 3 3 3 1 3 3 3 3 3 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3'); + '12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 1 1 1 1 1 1 1 5 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12'); INSERT INTO battlearenadata.communitymaps (map_id, map_name, map_width, map_height, map_data, map_downlo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1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12', 0); INSERT INTO battlearenadata.players (player_name, player_pw, games_won, games_lost, kills, deaths, blocks_destroyed, ingame_time) diff --git a/src/main/resources/maps/communityMaps.json b/src/main/resources/maps/communityMaps.json index e69de29b..a5c9f6ba 100644 --- a/src/main/resources/maps/communityMaps.json +++ b/src/main/resources/maps/communityMaps.json @@ -0,0 +1,9 @@ +[ + { + "mapID": "fbf44184867512faecc195ae75ca55d5ab7bad2d", + "mapName": "Arena3", + "mapWidth": 18, + "mapHeight": 18, + "mapData": "12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12" + } +] \ No newline at end of file diff --git a/src/main/resources/maps/coreMaps.json b/src/main/resources/maps/coreMaps.json index 84828ae2..ba63b040 100644 --- a/src/main/resources/maps/coreMaps.json +++ b/src/main/resources/maps/coreMaps.json @@ -1,16 +1,16 @@ [ { - "mapID": "a593cafd1d061f0f463a2d2051bf4718aaaf5c48", + "mapID": "09a02b54d05b5b7ebc29a4383ca12d3dda846b72", "mapName": "Arena1", "mapWidth": 18, "mapHeight": 18, - "mapData": "4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 1 2 1 1 1 1 2 2 2 1 1 1 1 1 1 1 3 4 2 1 1 1 1 1 2 2 2 1 1 1 1 2 1 1 3 4 1 1 1 2 2 4 3 3 1 4 3 3 3 3 2 2 3 4 1 1 1 2 2 4 1 1 1 1 1 1 1 3 1 2 3 4 1 1 1 2 2 4 1 3 3 3 1 1 1 3 2 2 3 4 1 1 1 2 2 4 1 1 1 1 1 1 1 3 2 1 3 4 1 1 1 2 2 4 3 3 1 4 3 3 3 3 2 1 3 4 1 1 1 1 1 1 2 2 2 1 1 1 1 1 1 1 3 4 1 1 1 2 2 4 3 3 1 3 3 3 3 3 2 1 3 4 1 1 1 1 2 4 3 3 1 3 3 3 3 3 1 1 3 4 1 1 1 1 2 4 3 3 1 3 3 3 3 3 2 2 3 4 1 1 1 1 1 4 3 3 1 3 3 3 3 3 1 2 3 4 1 2 1 1 1 1 2 2 2 1 1 1 1 1 1 1 3 4 1 1 2 1 1 1 2 2 2 1 1 1 1 1 1 1 3 4 1 1 1 2 2 4 3 3 1 3 3 3 3 3 2 2 3 4 1 1 1 2 2 4 3 3 1 3 3 3 3 3 2 2 3 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3" + "mapData": "12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12" }, { - "mapID": "e559d8fbb53b333f5839cb3c6c0c515395afe344", + "mapID": "0ab15557ab6dc4be60dfe6a9b0288bac3036bd97", "mapName": "Arena2", "mapWidth": 18, "mapHeight": 18, - "mapData": "4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 1 2 1 1 1 1 2 2 2 1 1 1 1 1 1 1 2 4 2 1 1 1 1 1 2 2 2 1 1 1 1 2 3 1 3 4 1 1 1 2 2 4 3 3 1 4 3 3 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 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 12 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12" } ] \ No newline at end of file diff --git a/src/test/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Utilities/ParserTest.java b/src/test/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Utilities/ParserTest.java index 64b6145a..264966b6 100644 --- a/src/test/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Utilities/ParserTest.java +++ b/src/test/java/de/hdm_stuttgart/battlearena/Model/DataStorage/Classes/Utilities/ParserTest.java @@ -120,10 +120,10 @@ class ParserTest { assertTrue(testMe.getMessage().contains("IP-Address must not contain two or more consecutive dividers (.) without number in between!")); testMe = assertThrows(ParserException.class, () -> Parser.ipAddressValid("f1.12.12.12")); - assertTrue(testMe.getMessage().contains("IP address does not consist out of numbers 0-9 and separators (.) !")); + assertTrue(testMe.getMessage().contains("IP address must consist out of numbers 0-9 and separators (.) !")); testMe = assertThrows(ParserException.class, () -> Parser.ipAddressValid("12.12.12.1f")); - assertTrue(testMe.getMessage().contains("IP address does not consist out of numbers 0-9 and separators (.) !")); + assertTrue(testMe.getMessage().contains("IP address must consist out of numbers 0-9 and separators (.) !")); testMe = assertThrows(ParserException.class, () -> Parser.ipAddressValid("256.12.12.12")); assertTrue(testMe.getMessage().contains("Octets of IP-address must not exceed 255!")); -- GitLab