diff --git a/legacyworlds-server-beans-simple/src/main/java/com/deepclone/lw/beans/empire/EmpireDAOBean.java b/legacyworlds-server-beans-simple/src/main/java/com/deepclone/lw/beans/empire/EmpireDAOBean.java index e515d04..26a6d01 100644 --- a/legacyworlds-server-beans-simple/src/main/java/com/deepclone/lw/beans/empire/EmpireDAOBean.java +++ b/legacyworlds-server-beans-simple/src/main/java/com/deepclone/lw/beans/empire/EmpireDAOBean.java @@ -4,9 +4,7 @@ package com.deepclone.lw.beans.empire; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; -import java.util.HashMap; import java.util.List; -import java.util.Map; import javax.sql.DataSource; @@ -20,8 +18,6 @@ import com.deepclone.lw.cmd.player.gdata.NameIdPair; import com.deepclone.lw.cmd.player.gdata.PlanetListData; import com.deepclone.lw.cmd.player.gdata.empire.OverviewData; import com.deepclone.lw.interfaces.game.EmpireDAO; -import com.deepclone.lw.sqld.game.EmpireTechLine; -import com.deepclone.lw.sqld.game.EmpireTechnology; import com.deepclone.lw.sqld.game.GeneralInformation; import com.deepclone.lw.utils.StoredProc; @@ -145,58 +141,6 @@ public class EmpireDAOBean } - @Override - public List< EmpireTechLine > getTechnology( int empireId ) - { - String sql = "SELECT * FROM emp.tech_lines_view WHERE empire = ?"; - RowMapper< EmpireTechLine > lineMapper = new RowMapper< EmpireTechLine >( ) { - @Override - public EmpireTechLine mapRow( ResultSet rs , int rowNum ) - throws SQLException - { - EmpireTechLine etl = new EmpireTechLine( ); - etl.setId( rs.getInt( "tech_line" ) ); - etl.setName( rs.getString( "name" ) ); - etl.setDescription( rs.getString( "description" ) ); - return etl; - } - }; - - List< EmpireTechLine > lines = this.dTemplate.query( sql , lineMapper , empireId ); - if ( lines.isEmpty( ) ) { - return lines; - } - - Map< Integer , EmpireTechLine > linesById = new HashMap< Integer , EmpireTechLine >( ); - for ( EmpireTechLine etl : lines ) { - linesById.put( etl.getId( ) , etl ); - } - - sql = "SELECT * FROM emp.technologies_view WHERE empire = ?"; - RowMapper< EmpireTechnology > techMapper = new RowMapper< EmpireTechnology >( ) { - @Override - public EmpireTechnology mapRow( ResultSet rs , int rowNum ) - throws SQLException - { - EmpireTechnology et = new EmpireTechnology( ); - et.setLine( rs.getInt( "tech_line" ) ); - et.setName( rs.getString( "name" ) ); - et.setDescription( rs.getString( "description" ) ); - et.setImplemented( rs.getBoolean( "implemented" ) ); - et.setProgress( (int) rs.getDouble( "progress" ) ); - et.setCost( rs.getInt( "cost" ) ); - return et; - } - }; - - for ( EmpireTechnology et : this.dTemplate.query( sql , techMapper , empireId ) ) { - linesById.get( et.getLine( ) ).addTechnology( et ); - } - - return lines; - } - - @Override public void implementTechnology( int empireId , int lineId ) { diff --git a/legacyworlds-server-beans-simple/src/main/java/com/deepclone/lw/beans/empire/EmpireManagementBean.java b/legacyworlds-server-beans-simple/src/main/java/com/deepclone/lw/beans/empire/EmpireManagementBean.java index a940ef7..4602ce0 100644 --- a/legacyworlds-server-beans-simple/src/main/java/com/deepclone/lw/beans/empire/EmpireManagementBean.java +++ b/legacyworlds-server-beans-simple/src/main/java/com/deepclone/lw/beans/empire/EmpireManagementBean.java @@ -21,8 +21,6 @@ import com.deepclone.lw.cmd.player.gdata.PlanetListData; import com.deepclone.lw.cmd.player.gdata.PlanetListResourceRecord; import com.deepclone.lw.cmd.player.gdata.battles.BattleListEntry; import com.deepclone.lw.cmd.player.gdata.empire.OverviewData; -import com.deepclone.lw.cmd.player.gdata.empire.ResearchLineData; -import com.deepclone.lw.cmd.player.gdata.empire.TechnologyData; import com.deepclone.lw.interfaces.acm.UsersDAO; import com.deepclone.lw.interfaces.game.BattlesCache; import com.deepclone.lw.interfaces.game.BattlesDAO; @@ -33,8 +31,6 @@ import com.deepclone.lw.interfaces.naming.NamingDAO; import com.deepclone.lw.interfaces.prefs.AccountPreferences; import com.deepclone.lw.interfaces.prefs.PreferencesDAO; import com.deepclone.lw.sqld.accounts.Account; -import com.deepclone.lw.sqld.game.EmpireTechLine; -import com.deepclone.lw.sqld.game.EmpireTechnology; import com.deepclone.lw.sqld.game.GeneralInformation; import com.deepclone.lw.sqld.game.battle.BattleListRecord; import com.deepclone.lw.utils.EmailAddress; @@ -125,25 +121,6 @@ public class EmpireManagementBean public EmpireResponse getOverview( int empireId ) { OverviewData overview = this.empireDao.getOverview( empireId ); - List< ResearchLineData > research = new LinkedList< ResearchLineData >( ); - - for ( EmpireTechLine etl : this.empireDao.getTechnology( empireId ) ) { - List< TechnologyData > implemented = new LinkedList< TechnologyData >( ); - TechnologyData current = null; - - for ( EmpireTechnology et : etl.getTechnologies( ) ) { - if ( et.isImplemented( ) ) { - implemented.add( new TechnologyData( et.getName( ) , et.getDescription( ) ) ); - } else if ( et.getProgress( ) == 100 ) { - current = new TechnologyData( et.getName( ) , et.getDescription( ) , 100 , et.getCost( ) ); - } else { - current = new TechnologyData( et.getName( ) , et.getDescription( ) , et.getProgress( ) ); - } - } - - research.add( new ResearchLineData( etl.getId( ) , etl.getName( ) , etl.getDescription( ) , implemented , - current ) ); - } List< BattleListEntry > battles = new LinkedList< BattleListEntry >( ); for ( BattleListRecord record : this.battlesDao.getBattles( empireId ) ) { @@ -165,7 +142,7 @@ public class EmpireManagementBean overview.setEconomy( this.resourcesInformationDao.getEmpireInformation( empireId ) ); - return new EmpireResponse( this.getGeneralInformation( empireId ) , overview , research , battles ); + return new EmpireResponse( this.getGeneralInformation( empireId ) , overview , battles ); } diff --git a/legacyworlds-server-data/src/main/java/com/deepclone/lw/sqld/game/EmpireTechLine.java b/legacyworlds-server-data/src/main/java/com/deepclone/lw/sqld/game/EmpireTechLine.java deleted file mode 100644 index 7ab9d68..0000000 --- a/legacyworlds-server-data/src/main/java/com/deepclone/lw/sqld/game/EmpireTechLine.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.deepclone.lw.sqld.game; - - -import java.util.LinkedList; -import java.util.List; - - - -public class EmpireTechLine -{ - private int id; - - private String name; - - private String description; - - private List< EmpireTechnology > technologies = new LinkedList< EmpireTechnology >( ); - - - public int getId( ) - { - return id; - } - - - public void setId( int id ) - { - this.id = id; - } - - - public String getName( ) - { - return name; - } - - - public void setName( String name ) - { - this.name = name; - } - - - public String getDescription( ) - { - return description; - } - - - public void setDescription( String description ) - { - this.description = description; - } - - - public List< EmpireTechnology > getTechnologies( ) - { - return technologies; - } - - - public void addTechnology( EmpireTechnology eTech ) - { - this.technologies.add( eTech ); - } -} diff --git a/legacyworlds-server-data/src/main/java/com/deepclone/lw/sqld/game/EmpireTechnology.java b/legacyworlds-server-data/src/main/java/com/deepclone/lw/sqld/game/EmpireTechnology.java deleted file mode 100644 index b36d4dd..0000000 --- a/legacyworlds-server-data/src/main/java/com/deepclone/lw/sqld/game/EmpireTechnology.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.deepclone.lw.sqld.game; - - -public class EmpireTechnology -{ - private int line; - - private String name; - - private String description; - - private boolean implemented; - - private int progress; - - private int cost; - - - public int getLine( ) - { - return line; - } - - - public void setLine( int line ) - { - this.line = line; - } - - - public String getName( ) - { - return name; - } - - - public void setName( String name ) - { - this.name = name; - } - - - public String getDescription( ) - { - return description; - } - - - public void setDescription( String description ) - { - this.description = description; - } - - - public boolean isImplemented( ) - { - return implemented; - } - - - public void setImplemented( boolean implemented ) - { - this.implemented = implemented; - } - - - public int getProgress( ) - { - return progress; - } - - - public void setProgress( int progress ) - { - this.progress = progress; - } - - - public int getCost( ) - { - return cost; - } - - - public void setCost( int cost ) - { - this.cost = cost; - } - -} diff --git a/legacyworlds-server-interfaces/src/main/java/com/deepclone/lw/interfaces/game/EmpireDAO.java b/legacyworlds-server-interfaces/src/main/java/com/deepclone/lw/interfaces/game/EmpireDAO.java index 59342d4..291ba89 100644 --- a/legacyworlds-server-interfaces/src/main/java/com/deepclone/lw/interfaces/game/EmpireDAO.java +++ b/legacyworlds-server-interfaces/src/main/java/com/deepclone/lw/interfaces/game/EmpireDAO.java @@ -7,7 +7,6 @@ import com.deepclone.lw.cmd.ObjectNameError; import com.deepclone.lw.cmd.player.gdata.NameIdPair; import com.deepclone.lw.cmd.player.gdata.PlanetListData; import com.deepclone.lw.cmd.player.gdata.empire.OverviewData; -import com.deepclone.lw.sqld.game.EmpireTechLine; import com.deepclone.lw.sqld.game.GeneralInformation; @@ -24,9 +23,6 @@ public interface EmpireDAO public OverviewData getOverview( int empireId ); - public List< EmpireTechLine > getTechnology( int empireId ); - - public void implementTechnology( int empireId , int lineId ); diff --git a/legacyworlds-session/src/main/java/com/deepclone/lw/cmd/player/EmpireResponse.java b/legacyworlds-session/src/main/java/com/deepclone/lw/cmd/player/EmpireResponse.java index 7b6eea1..4fa9dd3 100644 --- a/legacyworlds-session/src/main/java/com/deepclone/lw/cmd/player/EmpireResponse.java +++ b/legacyworlds-session/src/main/java/com/deepclone/lw/cmd/player/EmpireResponse.java @@ -1,14 +1,12 @@ package com.deepclone.lw.cmd.player; -import java.util.Collections; import java.util.List; import com.deepclone.lw.cmd.player.gdata.GamePageData; import com.deepclone.lw.cmd.player.gdata.GameResponseBase; import com.deepclone.lw.cmd.player.gdata.battles.BattleListEntry; import com.deepclone.lw.cmd.player.gdata.empire.OverviewData; -import com.deepclone.lw.cmd.player.gdata.empire.ResearchLineData; @@ -18,17 +16,14 @@ public class EmpireResponse private static final long serialVersionUID = 1L; private final OverviewData overview; - private final List< ResearchLineData > research; private final List< BattleListEntry > battles; - public EmpireResponse( GamePageData page , OverviewData overview , List< ResearchLineData > research , - List< BattleListEntry > battles ) + public EmpireResponse( GamePageData page , OverviewData overview , List< BattleListEntry > battles ) { super( page ); this.overview = overview; this.battles = battles; - this.research = Collections.unmodifiableList( research ); } @@ -38,12 +33,6 @@ public class EmpireResponse } - public List< ResearchLineData > getResearch( ) - { - return research; - } - - public List< BattleListEntry > getBattles( ) { return battles; diff --git a/legacyworlds-session/src/main/java/com/deepclone/lw/cmd/player/gdata/empire/ResearchLineData.java b/legacyworlds-session/src/main/java/com/deepclone/lw/cmd/player/gdata/empire/ResearchLineData.java deleted file mode 100644 index a48f027..0000000 --- a/legacyworlds-session/src/main/java/com/deepclone/lw/cmd/player/gdata/empire/ResearchLineData.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.deepclone.lw.cmd.player.gdata.empire; - - -import java.io.Serializable; -import java.util.Collections; -import java.util.List; - - - -public class ResearchLineData - implements Serializable , Comparable< ResearchLineData > -{ - - private static final long serialVersionUID = 1L; - - private final long id; - private final String name; - private final String description; - private final List< TechnologyData > implemented; - private final TechnologyData current; - - - public ResearchLineData( long id , String name , String description , List< TechnologyData > implemented , - TechnologyData current ) - { - this.id = id; - this.name = name; - this.description = description; - this.implemented = Collections.unmodifiableList( implemented ); - this.current = current; - } - - - @Override - public int compareTo( ResearchLineData other ) - { - return this.name.compareTo( other.name ); - } - - - public long getId( ) - { - return id; - } - - - public String getName( ) - { - return name; - } - - - public String getDescription( ) - { - return description; - } - - - public List< TechnologyData > getImplemented( ) - { - return implemented; - } - - - public TechnologyData getCurrent( ) - { - return current; - } - -} diff --git a/legacyworlds-session/src/main/java/com/deepclone/lw/cmd/player/gdata/empire/TechnologyData.java b/legacyworlds-session/src/main/java/com/deepclone/lw/cmd/player/gdata/empire/TechnologyData.java deleted file mode 100644 index 7ea35f0..0000000 --- a/legacyworlds-session/src/main/java/com/deepclone/lw/cmd/player/gdata/empire/TechnologyData.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.deepclone.lw.cmd.player.gdata.empire; - - -import java.io.Serializable; - - - -public class TechnologyData - implements Serializable -{ - - private static final long serialVersionUID = 1L; - - private final String name; - private final String description; - private final Integer researched; - private final Long cost; - - - public TechnologyData( String name , String description ) - { - this.name = name; - this.description = description; - this.researched = null; - this.cost = null; - } - - - public TechnologyData( String name , String description , int researched ) - { - this.name = name; - this.description = description; - this.researched = researched; - this.cost = null; - } - - - public TechnologyData( String name , String description , int researched , long cost ) - { - this.name = name; - this.description = description; - this.researched = researched; - this.cost = cost; - } - - - public String getName( ) - { - return name; - } - - - public String getDescription( ) - { - return description; - } - - - public Integer getResearched( ) - { - return researched; - } - - - public Long getCost( ) - { - return cost; - } - -} diff --git a/legacyworlds-web-main/Content/Raw/WEB-INF/fm/en/types/overview.ftl b/legacyworlds-web-main/Content/Raw/WEB-INF/fm/en/types/overview.ftl index 28d1686..4eae28b 100644 --- a/legacyworlds-web-main/Content/Raw/WEB-INF/fm/en/types/overview.ftl +++ b/legacyworlds-web-main/Content/Raw/WEB-INF/fm/en/types/overview.ftl @@ -67,56 +67,6 @@ <@overviewResources /> @tab> - <@tab id="research" title="Research"> - <#if rs?size == 0> -
Our scientists are still settling in.
- #if> - <#list rs as research> -${research.description?xhtml}
- - <@left_column> - <#if research.implemented?size == 0> -No usable technologies.
- <#else> - <@dt_main> - <#list research.implemented as tech> - <@dt_status> - ${tech.name?xhtml} -- ${research.current.description?xhtml} -
- @dt_status> - <@dt_entry title="Progress">${research.current.researched}%@dt_entry> - <#if research.current.cost?has_content> - <@dt_entry title="Cost">${research.current.cost?string(",##0")} <@abbr_bgc/>@dt_entry> - <#if data.page.cash gte research.current.cost && data.page.special! != 'v'> - <@dt_status>@dt_status> - #if> - #if> - @dt_main> - @right_column> - #if> - -Nos scientifiques sont encore en train de s'installer.
- #if> - <#list rs as research> -${research.description?xhtml}
- - <@left_column> - <#if research.implemented?size == 0> -Aucune technologie utilisable.
- <#else> - <@dt_main> - <#list research.implemented as tech> - <@dt_status> - ${tech.name?xhtml} -- ${research.current.description?xhtml} -
- @dt_status> - <@dt_entry title="Progression">${research.current.researched}%@dt_entry> - <#if research.current.cost?has_content> - <@dt_entry title="Coût">${research.current.cost?string(",##0")} <@abbr_bgc/>@dt_entry> - <#if data.page.cash gte research.current.cost && data.page.special! != 'v'> - <@dt_status>@dt_status> - #if> - #if> - @dt_main> - @right_column> - #if> - -