Importing SVN archives - Trunk

This commit is contained in:
Emmanuel BENOîT 2018-10-23 09:43:42 +02:00
parent fc4c6bd340
commit ff53af6668
507 changed files with 8866 additions and 2450 deletions
legacyworlds-server/legacyworlds-server-beans/legacyworlds-server-beans-bt

View file

@ -4,7 +4,7 @@
<parent>
<artifactId>legacyworlds-server-beans</artifactId>
<groupId>com.deepclone.lw</groupId>
<version>5.99.1</version>
<version>5.99.2</version>
</parent>
<dependencies>
@ -20,6 +20,6 @@
<groupId>com.deepclone.lw</groupId>
<artifactId>legacyworlds-server-beans-bt</artifactId>
<version>5.99.1</version>
<version>5.99.2</version>
<name>Legacy Worlds bug tracking system</name>
</project>

View file

@ -28,6 +28,7 @@ public class EmpireSummaryBean
private final RowMapper< DebugInformation > mMainInfo;
private final RowMapper< ResearchInformation > mResearch;
private final RowMapper< TechnologyInformation > mTechnology;
private final RowMapper< PlanetInformation > mPlanet;
private final RowMapper< QueueItemInformation > mQueueItem;
private final RowMapper< BuildingsInformation > mBuildings;
@ -42,7 +43,8 @@ public class EmpireSummaryBean
AccountInformation.class , AllianceInformation.class , BuildingsInformation.class ,
DebugInformation.class , EmpireInformation.class , FleetInformation.class , MovementInformation.class ,
PlanetInformation.class , QueueInformation.class , QueueItemInformation.class ,
ResearchInformation.class , ShipsInformation.class , SystemInformation.class
ResearchInformation.class , TechnologyInformation.class , ShipsInformation.class ,
SystemInformation.class
} );
this.mMainInfo = new RowMapper< DebugInformation >( ) {
@ -83,13 +85,23 @@ public class EmpireSummaryBean
throws SQLException
{
ResearchInformation ri = new ResearchInformation( );
ri.setId( rs.getInt( "line_id" ) );
ri.setCurrentLevel( rs.getInt( "level" ) );
ri.setLevelName( rs.getString( "name" ) );
ri.setName( rs.getString( "name" ) );
ri.setAccumulated( rs.getDouble( "accumulated" ) );
ri.setPriority( rs.getInt( "priority" ) );
return ri;
}
};
this.mTechnology = new RowMapper< TechnologyInformation >( ) {
@Override
public TechnologyInformation mapRow( ResultSet rs , int rowNum )
throws SQLException
{
TechnologyInformation ti = new TechnologyInformation( );
ti.setName( rs.getString( "name" ) );
ti.setImplemented( rs.getBoolean( "implemented" ) );
return ti;
}
};
this.mPlanet = new RowMapper< PlanetInformation >( ) {
@Override
public PlanetInformation mapRow( ResultSet rs , int rowNum )
@ -199,9 +211,10 @@ public class EmpireSummaryBean
DebugInformation di = this.dTemplate.queryForObject( sql , this.mMainInfo , empireId );
sql = "SELECT * FROM bugs.dump_research_view WHERE empire_id = ?";
for ( ResearchInformation ri : this.dTemplate.query( sql , this.mResearch , empireId ) ) {
di.getResearch( ).add( ri );
}
di.getResearch( ).addAll( this.dTemplate.query( sql , this.mResearch , empireId ) );
sql = "SELECT * FROM bugs.dump_technologies_view WHERE empire_id = ?";
di.getTechnologies( ).addAll( this.dTemplate.query( sql , this.mTechnology , empireId ) );
sql = "SELECT * FROM bugs.dump_planets_view WHERE empire_id = ?";
Map< Integer , PlanetInformation > planets = new HashMap< Integer , PlanetInformation >( );

View file

@ -15,26 +15,29 @@ public class DebugInformation
implements Serializable
{
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 2L;
@XStreamAsAttribute
@XStreamAlias( "dump-version" )
private int version = 1;
private final int version = 2;
private SystemInformation system = new SystemInformation( );
private final SystemInformation system = new SystemInformation( );
private AccountInformation account = new AccountInformation( );
private final AccountInformation account = new AccountInformation( );
private EmpireInformation empire = new EmpireInformation( );
private final EmpireInformation empire = new EmpireInformation( );
@XStreamAlias( "research" )
private List< ResearchInformation > research = new LinkedList< ResearchInformation >( );
private final List< ResearchInformation > research = new LinkedList< ResearchInformation >( );
@XStreamAlias( "technologies" )
private final List< TechnologyInformation > technologies = new LinkedList< TechnologyInformation >( );
@XStreamAlias( "planets" )
private List< PlanetInformation > planets = new LinkedList< PlanetInformation >( );
private final List< PlanetInformation > planets = new LinkedList< PlanetInformation >( );
@XStreamAlias( "fleets" )
private List< FleetInformation > fleets = new LinkedList< FleetInformation >( );
private final List< FleetInformation > fleets = new LinkedList< FleetInformation >( );
public int getVersion( )
@ -67,6 +70,12 @@ public class DebugInformation
}
public List< TechnologyInformation > getTechnologies( )
{
return technologies;
}
public List< PlanetInformation > getPlanets( )
{
return planets;
@ -78,4 +87,4 @@ public class DebugInformation
return fleets;
}
}
}

View file

@ -8,64 +8,34 @@ import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
@XStreamAlias( "research-line" )
@XStreamAlias( "research-topic" )
public class ResearchInformation
implements Serializable
{
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 2L;
@XStreamAsAttribute
@XStreamAlias( "line")
private int id;
@XStreamAsAttribute
@XStreamAlias( "level")
private int currentLevel;
private String name;
@XStreamAsAttribute
@XStreamAlias( "name")
private String levelName;
@XStreamAsAttribute
@XStreamAlias( "accumulated-points")
@XStreamAlias( "accumulated-points" )
private double accumulated;
@XStreamAsAttribute
private int priority;
public int getId( )
public String getName( )
{
return id;
return name;
}
public void setId( int id )
public void setName( String name )
{
this.id = id;
}
public int getCurrentLevel( )
{
return currentLevel;
}
public void setCurrentLevel( int currentLevel )
{
this.currentLevel = currentLevel;
}
public String getLevelName( )
{
return levelName;
}
public void setLevelName( String levelName )
{
this.levelName = levelName;
this.name = name;
}
@ -80,4 +50,16 @@ public class ResearchInformation
this.accumulated = accumulated;
}
public int getPriority( )
{
return priority;
}
public void setPriority( int priority )
{
this.priority = priority;
}
}

View file

@ -0,0 +1,48 @@
package com.deepclone.lw.beans.bt.esdata;
import java.io.Serializable;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
@XStreamAlias( "technology" )
public class TechnologyInformation
implements Serializable
{
private static final long serialVersionUID = 1L;
@XStreamAsAttribute
private String name;
@XStreamAsAttribute
private boolean implemented;
public String getName( )
{
return name;
}
public void setName( String name )
{
this.name = name;
}
public boolean isImplemented( )
{
return implemented;
}
public void setImplemented( boolean implemented )
{
this.implemented = implemented;
}
}