Changeset 6422552e6576d46ff8b90ecf3db4ff6bee2db0ec

Show
Ignore:
Timestamp:
06/03/07 16:26:29 (1 year ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1180880789 +0200
git-parent:

[f181a7abfe6f6b0c8a99cf166970fff3289e382d]

git-author:
Christopher Jung <bktheg@web.de> 1180880789 +0200
Message:

Weitere Entities hinzugefuegt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/net/driftingsouls/ds2/server/modules/AllyController.java

    r9c1e106 r6422552  
    4141import net.driftingsouls.ds2.server.framework.pipeline.generators.DSGenerator; 
    4242import net.driftingsouls.ds2.server.framework.templates.TemplateEngine; 
     43import net.driftingsouls.ds2.server.ships.Ship; 
     44import net.driftingsouls.ds2.server.ships.ShipTypeData; 
    4345import net.driftingsouls.ds2.server.ships.ShipTypes; 
    4446import net.driftingsouls.ds2.server.tasks.Task; 
     
    12931295                        SQLQuery s = db.query("SELECT name,type,time,owner FROM ships_lost WHERE destally=",this.ally.getId()," ORDER BY time DESC LIMIT ",destpos,",10"); 
    12941296                        while( s.next() ) { 
    1295                                 SQLResultRow shiptype = ShipTypes.getShipType( s.getInt("type"), false ); 
     1297                                ShipTypeData shiptype = Ship.getShipType( s.getInt("type"), false ); 
    12961298                                 
    12971299                                counter++; 
     
    13071309         
    13081310                                t.set_var(      "show.destships.name",                  s.getString("name"), 
    1309                                                         "show.destships.type.name",             shiptype.getString("nickname"), 
     1311                                                        "show.destships.type.name",             shiptype.getNickname(), 
    13101312                                                        "show.destships.type",                  s.getInt("type"), 
    1311                                                         "show.destships.type.picture",  shiptype.getString("picture"), 
     1313                                                        "show.destships.type.picture",  shiptype.getPicture(), 
    13121314                                                        "show.destships.owner",                 Common._title(ownername), 
    13131315                                                        "show.destships.time",                  Common.date("d.m.Y H:i:s",s.getLong("time")), 
     
    13461348                        s = db.query("SELECT name,type,time,owner,destowner FROM ships_lost WHERE ally=",this.ally.getId()," ORDER BY time DESC LIMIT ",lostpos,",10"); 
    13471349                        while( s.next() ) {                      
    1348                                 SQLResultRow shiptype = ShipTypes.getShipType( s.getInt("type"), false ); 
     1350                                ShipTypeData shiptype = Ship.getShipType( s.getInt("type"), false ); 
    13491351                                 
    13501352                                counter++; 
     
    13701372                                                         
    13711373                                t.set_var(      "show.lostships.name",                  s.getString("name"), 
    1372                                                         "show.lostships.type.name",             shiptype.getString("nickname"), 
     1374                                                        "show.lostships.type.name",             shiptype.getNickname(), 
    13731375                                                        "show.lostships.type",                  s.getInt("type"), 
    1374                                                         "show.lostships.type.picture",  shiptype.getString("picture"), 
     1376                                                        "show.lostships.type.picture",  shiptype.getPicture(), 
    13751377                                                        "show.lostships.owner",                 Common._title(destownername), 
    13761378                                                        "show.lostships.destroyer",             Common._title(ownername), 
  • src/net/driftingsouls/ds2/server/modules/AngriffController.java

    r3924571 r6422552  
    7777import net.driftingsouls.ds2.server.modules.ks.KSTakeCommandAction; 
    7878import net.driftingsouls.ds2.server.modules.ks.KSUndockAllAction; 
     79import net.driftingsouls.ds2.server.ships.Ship; 
     80import net.driftingsouls.ds2.server.ships.ShipTypeData; 
    7981import net.driftingsouls.ds2.server.ships.ShipTypes; 
    8082 
     
    994996                                        final String key = stid+":"+i; 
    995997                                         
    996                                         SQLResultRow shiptype = ShipTypes.getShipType(stid, false); 
     998                                        ShipTypeData shiptype = Ship.getShipType(stid, false); 
    997999                                        GroupEntry data = groupdata.get(key); 
    9981000                                         
    9991001                                        t.set_var(      "shiptypelist.count",           count, 
    1000                                                                 "shiptypelist.name",            shiptype.getString("nickname"), 
     1002                                                                "shiptypelist.name",            shiptype.getNickname(), 
    10011003                                                                "shiptypelist.groupid",         key, 
    10021004                                                                "shiptypelist.id",                      stid, 
    1003                                                                 "shiptypelist.image",           shiptype.getString("picture"), 
     1005                                                                "shiptypelist.image",           shiptype.getPicture(), 
    10041006                                                                "shiptypelist.side",            "own", 
    10051007                                                                "shiptypelist.otherside",       "enemy", 
     
    12121214                         
    12131215                                        final String key = stid+":"+i; 
    1214                                         SQLResultRow shiptype = ShipTypes.getShipType(stid, false); 
     1216                                        ShipTypeData shiptype = Ship.getShipType(stid, false); 
    12151217                                         
    12161218                                        GroupEntry data = groupdata.get(key); 
    12171219                                         
    12181220                                        t.set_var(      "shiptypelist.count",           count, 
    1219                                                                 "shiptypelist.name",            shiptype.getString("nickname"), 
     1221                                                                "shiptypelist.name",            shiptype.getNickname(), 
    12201222                                                                "shiptypelist.id",                      stid, 
    12211223                                                                "shiptypelist.groupid",         stid+":"+i, 
    1222                                                                 "shiptypelist.image",           ShipTypes.getShipType(stid, false).getString("picture"), 
     1224                                                                "shiptypelist.image",           Ship.getShipType(stid, false).getPicture(), 
    12231225                                                                "shiptypelist.side",            "enemy", 
    12241226                                                                "shiptypelist.otherside",       "own", 
  • src/net/driftingsouls/ds2/server/modules/ErsteigernController.java

    r3924571 r6422552  
    4949import net.driftingsouls.ds2.server.framework.templates.TemplateEngine; 
    5050import net.driftingsouls.ds2.server.ships.JumpNodeRouter; 
     51import net.driftingsouls.ds2.server.ships.Ship; 
     52import net.driftingsouls.ds2.server.ships.ShipTypeData; 
    5153import net.driftingsouls.ds2.server.ships.ShipTypes; 
    5254import net.driftingsouls.ds2.server.tasks.Taskmanager; 
     
    529531                 
    530532                        if( entry.getInt("mtype") == 1 ) {      //Schiff 
    531                                 SQLResultRow shiptype = ShipTypes.getShipType(entry.getInt("type"), false); 
    532                                 entryname = shiptype.getString("nickname"); 
    533                                 entryimage = shiptype.getString("picture"); 
     533                                ShipTypeData shiptype = Ship.getShipType(entry.getInt("type"), false); 
     534                                entryname = shiptype.getNickname(); 
     535                                entryimage = shiptype.getPicture(); 
    534536                                entrylink = Common.buildUrl(getContext(), "default", "module", "schiffinfo", "ship", entry.getInt("type") ); 
    535537                        } 
     
    607609                         
    608610                        if( entry.getInt("mtype") == 1 ) { 
    609                                 SQLResultRow shiptype = ShipTypes.getShipType(entry.getInt("type"), false); 
    610                                 entryname = shiptype.getString("nickname"); 
     611                                ShipTypeData shiptype = Ship.getShipType(entry.getInt("type"), false); 
     612                                entryname = shiptype.getNickname(); 
    611613                        } 
    612614                        else if( entry.getInt("mtype") == 2 ) {  
  • src/net/driftingsouls/ds2/server/modules/ForschinfoController.java

    r3924571 r6422552  
    4141import net.driftingsouls.ds2.server.framework.pipeline.generators.DSGenerator; 
    4242import net.driftingsouls.ds2.server.framework.templates.TemplateEngine; 
     43import net.driftingsouls.ds2.server.ships.Ship; 
     44import net.driftingsouls.ds2.server.ships.ShipTypeData; 
    4345import net.driftingsouls.ds2.server.ships.ShipTypes; 
    4446 
     
    348350                        t.start_record(); 
    349351 
    350                         SQLResultRow shiptype = ShipTypes.getShipType(ship.getInt("type"), false); 
     352                        ShipTypeData shiptype = Ship.getShipType(ship.getInt("type"), false); 
    351353                         
    352354                        t.set_var(      "tech.ship.id",                 ship.getInt("type"), 
    353355                                                "tech.ship.name",               Common._plaintitle(ship.getString("nickname")), 
    354                                                 "tech.ship.picture",    shiptype.getString("picture"), 
     356                                                "tech.ship.picture",    shiptype.getPicture(), 
    355357                                                "tech.ship.hr",                 !firstentry, 
    356358                                                "tech.ship.dauer",              ship.getInt("dauer"), 
  • src/net/driftingsouls/ds2/server/modules/ItemInfoController.java

    r3924571 r6422552  
    5656import net.driftingsouls.ds2.server.framework.pipeline.generators.DSGenerator; 
    5757import net.driftingsouls.ds2.server.framework.templates.TemplateEngine; 
     58import net.driftingsouls.ds2.server.ships.Ship; 
     59import net.driftingsouls.ds2.server.ships.ShipTypeData; 
    5860import net.driftingsouls.ds2.server.ships.ShipTypes; 
    5961 
     
    280282                        IEDraftShip effect = (IEDraftShip)Items.get().item(itemid).getEffect(); 
    281283                         
    282                         SQLResultRow shiptype = ShipTypes.getShipType( effect.getShipType(), false ); 
     284                        ShipTypeData shiptype = Ship.getShipType( effect.getShipType(), false ); 
    283285         
    284286                        StringBuilder data = new StringBuilder(100); 
    285                         if( shiptype.getBoolean("hide") ) { 
     287                        if( shiptype == null ) { 
     288                                data.append("<span style=\"color:red\">Unbekannter Schiffstyp</span>"); 
     289                        } 
     290                        else if( shiptype.isHide() ) { 
    286291                        if( user.getAccessLevel() > 20 ) { 
    287                                 data.append("<a class=\"forschinfo\" href=\""+Common.buildUrl(getContext(), "default", "module", "schiffinfo", "ship", effect.getShipType())+"\">"+shiptype.getString("nickname")+"</a><br /><span style=\"font-style:italic;color:red\" class=\"verysmallfont\">[unsichtbar]</span>\n"); 
     292                                data.append("<a class=\"forschinfo\" href=\""+Common.buildUrl(getContext(), "default", "module", "schiffinfo", "ship", effect.getShipType())+"\">"+shiptype.getNickname()+"</a><br /><span style=\"font-style:italic;color:red\" class=\"verysmallfont\">[unsichtbar]</span>\n"); 
    288293                        }  
    289294                        else { 
     
    291296                        } 
    292297                        }        
    293                         else if( !shiptype.isEmpty() ) { 
    294                                 data.append("<a class=\"forschinfo\" href=\""+Common.buildUrl(getContext(), "default", "module", "schiffinfo", "ship", effect.getShipType())+"\">"+shiptype.getString("nickname")+"</a>\n"); 
    295                         }        
    296298                        else { 
    297                                 data.append("<span style=\"color:red\">Unbekannter Schiffstyp</span>"); 
     299                                data.append("<a class=\"forschinfo\" href=\""+Common.buildUrl(getContext(), "default", "module", "schiffinfo", "ship", effect.getShipType())+"\">"+shiptype.getNickname()+"</a>\n"); 
    298300                        } 
    299301                         
     
    404406                        t.set_var( "entry.name", "Schiffstyp" ); 
    405407                         
    406                         SQLResultRow shiptype = ShipTypes.getShipType( effect.getShipType(), false ); 
    407                         if( !shiptype.isEmpty() ) { 
    408                                 t.set_var("entry.data", "<a class=\"forschinfo\" href=\""+Common.buildUrl(getContext(),"default", "module", "schiffinfo", "ship", effect.getShipType())+"\">"+shiptype.getString("nickname")+"</a>" ); 
     408                        ShipTypeData shiptype = Ship.getShipType( effect.getShipType(), false ); 
     409                        if( shiptype != null ) { 
     410                                t.set_var("entry.data", "<a class=\"forschinfo\" href=\""+Common.buildUrl(getContext(),"default", "module", "schiffinfo", "ship", effect.getShipType())+"\">"+shiptype.getNickname()+"</a>" ); 
    409411                        } 
    410412                        else { 
  • src/net/driftingsouls/ds2/server/modules/NPCOrderController.java

    r3e595f1 r6422552  
    2020import net.driftingsouls.ds2.server.framework.pipeline.generators.DSGenerator; 
    2121import net.driftingsouls.ds2.server.framework.templates.TemplateEngine; 
     22import net.driftingsouls.ds2.server.ships.Ship; 
     23import net.driftingsouls.ds2.server.ships.ShipTypeData; 
    2224import net.driftingsouls.ds2.server.ships.ShipTypes; 
    2325import net.driftingsouls.ds2.server.ships.ShipClasses; 
     
    8688                SQLQuery aship = db.query("SELECT * FROM ships WHERE owner="+user.getID()+" AND LOCATE('#!/tm gany_transport',destcom)"); 
    8789                while( aship.next() ) { 
    88                         SQLResultRow ashiptype = ShipTypes.getShipType(aship.getRow()); 
     90                        ShipTypeData ashiptype = Ship.getShipType(aship.getRow()); 
    8991                         
    9092                        t.set_var(      "transport.ship",               Common._plaintitle(aship.getString("name")), 
    9193                                                "transport.ship.id",    aship.getInt("id"), 
    92                                                 "transport.ship.picture",       ashiptype.getString("picture"), 
     94                                                "transport.ship.picture",       ashiptype.getPicture(), 
    9395                                                "transport.status",             "langeweile", 
    9496                                                "transport.assignment", "-" ); 
  • src/net/driftingsouls/ds2/server/modules/ScanController.java

    r3924571 r6422552  
    3535import net.driftingsouls.ds2.server.framework.pipeline.generators.DSGenerator; 
    3636import net.driftingsouls.ds2.server.framework.templates.TemplateEngine; 
     37import net.driftingsouls.ds2.server.ships.Ship; 
     38import net.driftingsouls.ds2.server.ships.ShipTypeData; 
    3739import net.driftingsouls.ds2.server.ships.ShipTypes; 
    3840 
     
    8486                        } 
    8587                         
    86                         SQLResultRow shiptype = ShipTypes.getShipType( ship ); 
    87                         int range = shiptype.getInt("sensorrange"); 
     88                        ShipTypeData shiptype = Ship.getShipType( ship ); 
     89                        int range = shiptype.getSensorRange(); 
    8890         
    8991                        // Sollte das Schiff in einem Nebel stehen -> halbe Scannerreichweite 
     
    114116                        } 
    115117         
    116                         if( ship.getInt("crew") < shiptype.getInt("crew")/3 ) { 
    117                                 addError("Es werden mindestens "+shiptype.getInt("crew")/3+" Crewmitglieder ben&ouml;tigt", Common.buildUrl(getContext(), "default", "module", "schiff", "ship", shipID)); 
     118                        if( ship.getInt("crew") < shiptype.getCrew()/3 ) { 
     119                                addError("Es werden mindestens "+shiptype.getCrew()/3+" Crewmitglieder ben&ouml;tigt", Common.buildUrl(getContext(), "default", "module", "schiff", "ship", shipID)); 
    118120                                 
    119121                                return false; 
  • src/net/driftingsouls/ds2/server/modules/SchiffController.java

    rda39d57 r6422552  
    11591159                        t.set_block("_SCHIFF", "offiziere.listitem", "offiziere.list"); 
    11601160                         
    1161                         SQLQuery offi = db.query("SELECT * FROM offiziere WHERE dest='s ",ship.getInt("id"),"'"); 
    1162                  
    1163                         while( offi.next() ) { 
    1164                                 Offizier offiObj = new Offizier( offi.getRow() ); 
    1165                                  
    1166                                 t.set_var(      "offizier.id",          offiObj.getID(), 
    1167                                                         "offizier.name",        Common._plaintitle(offiObj.getName()), 
    1168                                                         "offizier.picture",     offiObj.getPicture(), 
    1169                                                         "offizier.rang",        offiObj.getRang() ); 
     1161                        List<Offizier> offiziere = getContext().query("from Offizier where dest='s "+ship.getInt("id")+"'", Offizier.class); 
     1162                        for( Offizier offi : offiziere ) { 
     1163                                t.set_var(      "offizier.id",          offi.getID(), 
     1164                                                        "offizier.name",        Common._plaintitle(offi.getName()), 
     1165                                                        "offizier.picture",     offi.getPicture(), 
     1166                                                        "offizier.rang",        offi.getRang() ); 
    11701167                                                                         
    11711168                                t.parse("offiziere.list", "offiziere.listitem", true); 
    11721169                        } 
    1173                         offi.free(); 
    11741170                } 
    11751171                 
  • src/net/driftingsouls/ds2/server/modules/UeberController.java

    r3924571 r6422552  
    4747import net.driftingsouls.ds2.server.scripting.ScriptParser; 
    4848import net.driftingsouls.ds2.server.scripting.ScriptParserContext; 
    49 import net.driftingsouls.ds2.server.ships.ShipTypes; 
     49import net.driftingsouls.ds2.server.ships.Ship; 
     50import net.driftingsouls.ds2.server.ships.ShipTypeData; 
    5051import net.driftingsouls.ds2.server.ships.Ships; 
    5152 
     
    547548                        SQLQuery bookmark = db.query("SELECT id,name,x,y,system,destx,desty,destsystem,destcom,status,type FROM ships WHERE id>0 AND bookmark=1 AND owner=",user.getID()," ORDER BY id DESC"); 
    548549                        while( bookmark.next() ) { 
    549                                 SQLResultRow shiptype = ShipTypes.getShipType( bookmark.getRow() ); 
     550                                ShipTypeData shiptype = Ship.getShipType( bookmark.getRow() ); 
    550551                                t.set_var(      "bookmark.shipid",              bookmark.getInt("id"), 
    551552                                                        "bookmark.shipname",    bookmark.getString("name"), 
    552553                                                        "bookmark.location",    Ships.getLocationText(bookmark.getRow(), false), 
    553                                                         "bookmark.shiptype",    shiptype.getString("nickname"), 
     554                                                        "bookmark.shiptype",    shiptype.getNickname(), 
    554555                                                        "bookmark.description", bookmark.getInt("destsystem")+":"+bookmark.getInt("destx")+"/"+bookmark.getInt("desty")+"<br />"+bookmark.getString("destcom").replace("\r\n","<br />") ); 
    555556                                t.parse("bookmarks.list","bookmarks.listitem",true); 
  • src/net/driftingsouls/ds2/server/ships/Ship.java

    re3938f6 r6422552  
    2929 
    3030import net.driftingsouls.ds2.server.cargo.Cargo; 
     31import net.driftingsouls.ds2.server.framework.ContextMap; 
     32import net.driftingsouls.ds2.server.framework.Loggable; 
    3133import net.driftingsouls.ds2.server.framework.User; 
     34import net.driftingsouls.ds2.server.framework.db.Database; 
     35import net.driftingsouls.ds2.server.framework.db.SQLResultRow; 
    3236 
    3337import org.hibernate.annotations.Generated; 
     
    4246@Entity 
    4347@Table(name="ships") 
    44 public class Ship
     48public class Ship implements Loggable
    4549        @Id 
    4650        @Generated(GenerationTime.INSERT) 
     
    152156         
    153157        /** 
     158         * Gibt das zugrunde liegende Schiffstypen-Objekt zurueck 
     159         * @return Das Schiffstypen-Objekt 
     160         */ 
     161        public ShipType getBaseType() { 
     162                return ShipType.getShipType(getType()); 
     163        } 
     164         
     165        /** 
    154166         * Gibt den Cargo des Schiffes zurueck 
    155167         * @return Der Cargo 
     
    711723        } 
    712724         
    713          
     725        /** 
     726         * Gibt die Typen-Daten des angegebenen Schiffs zurueck  
     727         * @param shipdata Eine SQL-Ergebniszeile mit den daten des Schiffes 
     728         * @return die Typen-Daten 
     729         */ 
     730        public static ShipTypeData getShipType( SQLResultRow shipdata ) { 
     731                return getShipType(shipdata, false); 
     732        } 
     733         
     734        /** 
     735         * Gibt die Typen-Daten des angegebenen Schiffs bzw Schifftyps zurueck  
     736         * @param shiptype Die ID des Schiffs bzw des Schifftyps 
     737         * @param isShip Handelt es sich um ein Schiff (<code>true</code>)? 
     738         * @return die Typen-Daten 
     739         */ 
     740        public static ShipTypeData getShipType( int shiptype, boolean isShip ) { 
     741                return getShipType(shiptype, isShip, false); 
     742        } 
     743         
     744        /** 
     745         * Gibt die Typen-Daten des angegebenen Schiffs zurueck  
     746         * @param shipdata Eine SQL-Ergebniszeile mit den daten des Schiffes 
     747         * @param plaindata Sollen die Bildpfade angepasst werden (<code>false</code>) oder so zurueckgegeben werden, 
     748         * wie sie in der DB stehen (<code>true</code>)? 
     749         * @return die Typen-Daten 
     750         */ 
     751        public static ShipTypeData getShipType( SQLResultRow shipdata, boolean plaindata ) { 
     752                if( !shipdata.containsKey("type") || !shipdata.containsKey("status") ) { 
     753                        Database db = ContextMap.getContext().getDatabase(); 
     754                        shipdata = db.first("SELECT * FROM ships WHERE id="+shipdata.getInt("id")); 
     755                        LOG.warn("getShipType: type oder status fehlen in den Schiffsdaten", new Throwable()); 
     756                } 
     757                 
     758                int shiptype = shipdata.getInt("type"); 
     759                ShipModules modules = null; 
     760                 
     761                if( shipdata.getString("status").indexOf("tblmodules") != -1 ) { 
     762                        org.hibernate.Session db = ContextMap.getContext().getDB(); 
     763                        modules = (ShipModules)db.get(ShipModules.class, shipdata.getInt("id")); 
     764                } 
     765                 
     766                return getShipType(shiptype, modules, plaindata); 
     767        } 
     768         
     769        /** 
     770         * Gibt die Typen-Daten des angegebenen Schiffs bzw Schifftyps zurueck  
     771         * @param shiptype Die ID des Schiffs bzw des Schifftyps 
     772         * @param isShip Handelt es sich um ein Schiff (<code>true</code>)? 
     773         * @param plaindata Sollen die Bildpfade angepasst werden (<code>false</code>) oder so zurueckgegeben werden, 
     774         * wie sie in der DB stehen (<code>true</code>)? 
     775         * @return die Typen-Daten 
     776         */ 
     777        protected static ShipTypeData getShipType( int shiptype, boolean isShip, boolean plaindata ) { 
     778                if( isShip ) { 
     779                        int shipid = shiptype; 
     780                         
     781                        Database database = ContextMap.getContext().getDatabase(); 
     782                        SQLResultRow shipdata = database.prepare("SELECT type,status FROM ships WHERE id>0 AND id= ?") 
     783                                .first(shiptype); 
     784                         
     785                        shiptype = shipdata.getInt("type"); 
     786                        ShipModules modules = null; 
     787                         
     788                        if( shipdata.getString("status").indexOf("tblmodules") != -1 ) { 
     789                                org.hibernate.Session db = ContextMap.getContext().getDB(); 
     790                                modules = (ShipModules)db.get(ShipModules.class, shipid); 
     791                        } 
     792                         
     793                        return getShipType(shiptype, modules, plaindata); 
     794                } 
     795                return getShipType(shiptype, null, plaindata); 
     796        } 
     797         
     798        private static ShipTypeData getShipType( int shiptype, ShipModules shipdata, boolean plaindata ) {               
     799                if( !plaindata ) { 
     800                        ShipType type = ShipType.getShipType(shiptype); 
     801                         
     802                        String picture = ""; 
     803                        if( shipdata == null ) { 
     804                                picture = type.getPicture(); 
     805                        } 
     806                        else { 
     807                                picture = shipdata.getPicture(); 
     808                        } 
     809                         
     810                        return new ShipTypeDataPictureWrapper(shipdata != null ? shipdata : type,  
     811                                        !type.getPicture().equals(picture) ? true : false); 
     812                } 
     813                 
     814                return shipdata; 
     815        } 
    714816} 
  • src/net/driftingsouls/ds2/server/tick/regular/RestTick.java

    r3924571 r6422552  
    3737import net.driftingsouls.ds2.server.scripting.ScriptParser; 
    3838import net.driftingsouls.ds2.server.scripting.ScriptParserContext; 
    39 import net.driftingsouls.ds2.server.ships.ShipTypes; 
     39import net.driftingsouls.ds2.server.ships.Ship; 
     40import net.driftingsouls.ds2.server.ships.ShipTypeData; 
    4041import net.driftingsouls.ds2.server.tasks.Task; 
    4142import net.driftingsouls.ds2.server.tasks.Taskmanager; 
     
    238239                                                } 
    239240                                                 
    240                                                 SQLResultRow shiptype = ShipTypes.getShipType(aloadout.getInt("shiptype"), false); 
     241                                                ShipTypeData shiptype = Ship.getShipType(aloadout.getInt("shiptype"), false); 
    241242                                                 
    242243                                                // Schiffseintrag einfuegen 
    243244                                                db.update("INSERT INTO ships (id,name,type,owner,x,y,system,hull,crew,cargo) ", 
    244                                                                         "VALUES (",shouldId,",'Felsbrocken',",aloadout.getInt("shiptype"),",-1,",x,",",y,",",system.getInt("system"),",",shiptype.getInt("hull"),",",shiptype.getInt("crew"),",'",cargo.save(),"')"); 
     245                                                                        "VALUES (",shouldId,",'Felsbrocken',",aloadout.getInt("shiptype"),",-1,",x,",",y,",",system.getInt("system"),",",shiptype.getHull(),",",shiptype.getCrew(),",'",cargo.save(),"')"); 
    245246                                                this.log(""); 
    246247                                                 
  • src/net/driftingsouls/ds2/server/werften/WerftObject.java

    r3924571 r6422552  
    5454import net.driftingsouls.ds2.server.framework.db.SQLQuery; 
    5555import net.driftingsouls.ds2.server.framework.db.SQLResultRow; 
     56import net.driftingsouls.ds2.server.ships.Ship; 
     57import net.driftingsouls.ds2.server.ships.ShipTypeData; 
    5658import net.driftingsouls.ds2.server.ships.ShipTypes; 
    5759import net.driftingsouls.ds2.server.ships.Ships; 
     
    14171419                                ShipWerft werft = (ShipWerft)this; 
    14181420                                 
    1419                                 SQLResultRow newtype = ShipTypes.getShipType( this.getOneWayFlag(), false ); 
     1421                                ShipTypeData newtype = Ship.getShipType( this.getOneWayFlag(), false ); 
    14201422                                int crew = db.first("SELECT crew FROM ships WHERE id>0 AND id=", werft.getShipID()).getInt("crew"); 
    14211423         
     
    14261428                                 
    14271429                                db.update("INSERT INTO ships (id,name,type,hull,e,crew,x,y,system,owner,history) VALUES ", 
    1428                                                         "(",werft.getShipID(),",\"Baustelle\",",this.getOneWayFlag(),",",newtype.getInt("hull"),",",newtype.getInt("eps"),",",crew,",", 
     1430                                                        "(",werft.getShipID(),",\"Baustelle\",",this.getOneWayFlag(),",",newtype.getHull(),",",newtype.getEps(),",",crew,",", 
    14291431                                                        this.getX(),",",this.getY(),",",this.getSystem(),",",user.getID(),",'",db.prepareString(history),"')"); 
    14301432         
  • web/WEB-INF/cfg/hibernatemappings.xml

    re7d4c7f r6422552  
    3838        <mapping class="net.driftingsouls.ds2.server.Offizier" /> 
    3939        <mapping class="net.driftingsouls.ds2.server.entities.Order" /> 
    40         <!-- orders_offiziere --
    41         <!-- orders_ships --
     40        <mapping class="net.driftingsouls.ds2.server.entities.OrderOffizier" /
     41        <mapping class="net.driftingsouls.ds2.server.entities.OrderShip" /
    4242        <!-- ordner [net.driftingsouls.ds2.server.comm.Ordner migrieren] --> 
    4343        <!-- portal_articles --> 
     
    5454        <!-- scripts --> 
    5555        <!-- sectors --> 
    56         <!-- ship_fleets --
    57         <!-- ship_loot --
    58         <!-- ship_types --
     56        <mapping class="net.driftingsouls.ds2.server.ships.ShipFleet" /
     57        <mapping class="net.driftingsouls.ds2.server.ships.ShipLoot" /
     58        <mapping class="net.driftingsouls.ds2.server.ships.ShipType" /
    5959        <mapping class="net.driftingsouls.ds2.server.ships.Ship" /> 
    6060        <!-- ships_baubar --> 
    6161        <!-- ships_lost --> 
    62         <!-- ships_modules --
     62        <mapping class="net.driftingsouls.ds2.server.ships.ShipModules" /
    6363        <!-- skn --> 
    6464        <!-- skn_channels -->