Skip to content
Snippets Groups Projects
Commit 6c4d4c17 authored by Schuh Martin's avatar Schuh Martin
Browse files

Update: Minor Fixes

parent 68b0a885
No related branches found
No related tags found
2 merge requests!7Merge DataBase to development,!6Merging from Database to development
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SqlDialectMappings">
<file url="file://$PROJECT_DIR$/src/main/java/de/hdm_stuttgart/battlearena/Persistance/Scripts/DDL_Script.sql" dialect="AZURE" />
<file url="file://$PROJECT_DIR$/src/main/java/de/hdm_stuttgart/battlearena/Persistance/Scripts/DDL_Script_Oracle.sql" dialect="AZURE" />
<file url="PROJECT" dialect="AZURE" />
</component>
<component name="SqlResolveMappings">
......
......@@ -125,12 +125,6 @@ public class OracleDB implements IDataBase {
}
/*
public void createCommunityMap(Persistence persistence){
//try to insert new entry in CommunityMaps Table - if check by unique-id fails, error message that map already exists!
//make hash of madata before trying to insert
//save data in communityMaps Arraylist
}
public void updateCommunityStats(Persistence persistence){
//Update the commulative Stats
}
......
......@@ -14,23 +14,32 @@ public class RuntimeInfo {
private LinkedHashMap<String, String> mapNames;
public MapData mapCreated; //to store parsed Data from MapCreator for Upload to SQL
public String communityMapSelected;
protected ArrayList<String> coreMapsListLocal;
protected ArrayList<String> communityMapsListLocal;
protected ArrayList<String> coreMapsListLocal; //include mapID
protected ArrayList<String> communityMapsListLocal; //include mapID
protected ArrayList<String> communityMapsListRemote;
public String mapTileString; //Maxe chose this name
private RuntimeInfo(){};
public static RuntimeInfo getInstance(){
return runtimeInfoSingleton;
}
private String getMap(String mapSelected) throws RuntimeException{
for(int i = 0; i < persistenceInst.coreMaps.size(); i++){
if(persistenceInst.coreMaps.get(i).getMapID().equals("mapSelected")){
return persistenceInst.coreMaps.get(i).getMapID();
}
private void setMap(String mapSelected, boolean choseCoremaps){
if(choseCoremaps) {
for (int mapListIndex = 0; mapListIndex < persistenceInst.coreMaps.size(); mapListIndex++) {
if (persistenceInst.coreMaps.get(mapListIndex).getMapID().equals("mapSelected")) {
mapTileString = persistenceInst.coreMaps.get(mapListIndex).getMapID();
}
}
}
else {
for (int mapListIndex = 0; mapListIndex < persistenceInst.communityMaps.size(); mapListIndex++) {
if (persistenceInst.communityMaps.get(mapListIndex).getMapID().equals("mapSelected")) {
mapTileString = persistenceInst.coreMaps.get(mapListIndex).getMapID();
}
}
}
throw new RuntimeException("no Map found");
}
public void getCommunityMap(){
......
--Note: DDL to be run as admin on MsSQL (AzureDB);
DROP TABLE coremaps;
DROP TABLE communitymaps;
CREATE TABLE coremaps(
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); --allows for map size up to 29x29
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); --allows for map size up to 29x29
INSERT INTO coremaps (map_id, map_name, map_width, map_height, map_data)
VALUES ('a593cafd1d061f0f463a2d2051bf4718aaaf5c48',
'Arena1',
18,
18,
'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');
INSERT INTO coremaps (map_id, map_name, map_width, map_height, map_data)
VALUES ('e559d8fbb53b333f5839cb3c6c0c515395afe344',
'Arena2',
18,
18,
'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 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');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment