Changeset 144f38e652b3cb03a9e5d3030e748cfdcab97870
- Timestamp:
- 10/20/07 13:41:52 (10 months ago)
- git-parent:
- Files:
-
- db/tables/ships.sql (modified) (2 diffs)
- db/updates.xml (modified) (1 diff)
- src/net/driftingsouls/ds2/server/bases/Kommandozentrale.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/battles/Battle.java (modified) (12 diffs)
- src/net/driftingsouls/ds2/server/modules/FleetMgntController.java (modified) (10 diffs)
- src/net/driftingsouls/ds2/server/modules/KapernController.java (modified) (2 diffs)
- src/net/driftingsouls/ds2/server/modules/PluendernController.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/modules/ScanController.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/modules/SchiffController.java (modified) (2 diffs)
- src/net/driftingsouls/ds2/server/modules/TCController.java (modified) (2 diffs)
- src/net/driftingsouls/ds2/server/modules/TransportController.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/modules/schiffplugins/SensorsDefault.java (modified) (4 diffs)
- src/net/driftingsouls/ds2/server/scripting/ActionFunctions.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/ships/Ship.java (modified) (7 diffs)
- src/net/driftingsouls/ds2/server/tick/regular/NPCScriptTick.java (modified) (1 diff)
- src/net/driftingsouls/ds2/server/tick/regular/SchiffsTick.java (modified) (3 diffs)
- src/net/driftingsouls/ds2/server/werften/WerftGUI.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
db/tables/ships.sql
r390f9f1 r144f38e 28 28 `destcom` text NOT NULL default '', 29 29 `bookmark` tinyint(1) unsigned NOT NULL default '0', 30 `battle` int(11) NOT NULL default '0',30 `battle` smallint(5) unsigned, 31 31 `battleAction` tinyint(1) unsigned NOT NULL default '0', 32 32 `jumptarget` varchar(100) NOT NULL default '', … … 55 55 ALTER TABLE ships ADD CONSTRAINT ships_type_fk FOREIGN KEY (type) REFERENCES ship_types(id); 56 56 ALTER TABLE ships ADD CONSTRAINT ships_fk_ship_fleets FOREIGN KEY (fleet) REFERENCES ship_fleets(id); 57 ALTER TABLE ships ADD CONSTRAINT ships_fk_battles FOREIGN KEY (battle) REFERENCES battles(id); 57 58 58 INSERT INTO `ships` (`id`, `owner`, `name`, `type`, `cargo`, `x`, `y`, `system`, `status`, `crew`, `e`, `s`, `hull`, `shields`, `heat`, `engine`, `weapons`, `comm`, `sensors`, `docked`, `alarm`, `fleet`, `destsystem`, `destx`, `desty`, `destcom`, `bookmark`, `battle`, `battleAction`, `jumptarget`, `autodeut`, `history`, `script`, `scriptexedata`, `oncommunicate`, `lock`, `visibility`, `onmove`, `respawn`) VALUES (2, -1, 'Frachter', 27, '0,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,', 1, 1, 0, 'noconsign', 50, 80, 0, 5000, 0, '', 100, 100, 100, 100, '', 0, null, 0, 0, 0, '', 0, 0, 0, '', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL);59 INSERT INTO `ships` (`id`, `owner`, `name`, `type`, `cargo`, `x`, `y`, `system`, `status`, `crew`, `e`, `s`, `hull`, `shields`, `heat`, `engine`, `weapons`, `comm`, `sensors`, `docked`, `alarm`, `fleet`, `destsystem`, `destx`, `desty`, `destcom`, `bookmark`, `battle`, `battleAction`, `jumptarget`, `autodeut`, `history`, `script`, `scriptexedata`, `oncommunicate`, `lock`, `visibility`, `onmove`, `respawn`) VALUES (3, -1, 'Tanker', 2, '0,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', 1, 2, 0, 'noconsign', 30, 40, 0, 10000, 0, '', 100, 100, 100, 100, '', 0, null, 0, 0, 0, '', 0, 0, 0, '', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL);60 INSERT INTO `ships` (`id`, `owner`, `name`, `type`, `cargo`, `x`, `y`, `system`, `status`, `crew`, `e`, `s`, `hull`, `shields`, `heat`, `engine`, `weapons`, `comm`, `sensors`, `docked`, `alarm`, `fleet`, `destsystem`, `destx`, `desty`, `destcom`, `bookmark`, `battle`, `battleAction`, `jumptarget`, `autodeut`, `history`, `script`, `scriptexedata`, `oncommunicate`, `lock`, `visibility`, `onmove`, `respawn`) VALUES (5, -1, 'Frachter', 31, '0,60,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,', 2, 1, 0, 'noconsign', 30, 80, 0, 8500, 0, '', 100, 100, 100, 100, '', 0, null, 0, 0, 0, '', 0, 0, 0, '', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL);61 INSERT INTO `ships` (`id`, `owner`, `name`, `type`, `cargo`, `x`, `y`, `system`, `status`, `crew`, `e`, `s`, `hull`, `shields`, `heat`, `engine`, `weapons`, `comm`, `sensors`, `docked`, `alarm`, `fleet`, `destsystem`, `destx`, `desty`, `destcom`, `bookmark`, `battle`, `battleAction`, `jumptarget`, `autodeut`, `history`, `script`, `scriptexedata`, `oncommunicate`, `lock`, `visibility`, `onmove`, `respawn`) VALUES (6, -1, 'Tanker', 30, '0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', 2, 2, 0, 'noconsign', 30, 50, 0, 4000, 0, '', 100, 100, 100, 100, '', 0, null, 0, 0, 0, '', 0, 0, 0, '', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL);62 INSERT INTO `ships` (`id`, `owner`, `name`, `type`, `cargo`, `x`, `y`, `system`, `status`, `crew`, `e`, `s`, `hull`, `shields`, `heat`, `engine`, `weapons`, `comm`, `sensors`, `docked`, `alarm`, `fleet`, `destsystem`, `destx`, `desty`, `destcom`, `bookmark`, `battle`, `battleAction`, `jumptarget`, `autodeut`, `history`, `script`, `scriptexedata`, `oncommunicate`, `lock`, `visibility`, `onmove`, `respawn`) VALUES (666, -2, 'GTU Handelsposten Delta Serpentis', 10, '0,2000,0,0,500,2000,0,0,0,0,0,0,5000,0,0,0,0,0,300|10|0|0;301|3|0|0;325|3|0|0;326|3|0|0;161|500|0|0;170|500|0|0;150|500|0|0;154|500|0|0;172|500|0|0', 75, 75, 1, 'tradepost nocrew', 0, 4700, 0, 100000, 0, '', 100, 100, 100, 100, '', 0, null, 0, 0, 0, '', 0, 0, 0, '2:150/150', 1, '', NULL, NULL, '*:26:0', NULL, NULL, NULL, NULL);59 INSERT INTO `ships` (`id`, `owner`, `name`, `type`, `cargo`, `x`, `y`, `system`, `status`, `crew`, `e`, `s`, `hull`, `shields`, `heat`, `engine`, `weapons`, `comm`, `sensors`, `docked`, `alarm`, `fleet`, `destsystem`, `destx`, `desty`, `destcom`, `bookmark`, `battle`, `battleAction`, `jumptarget`, `autodeut`, `history`, `script`, `scriptexedata`, `oncommunicate`, `lock`, `visibility`, `onmove`, `respawn`) VALUES (2, -1, 'Frachter', 27, '0,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,', 1, 1, 0, 'noconsign', 50, 80, 0, 5000, 0, '', 100, 100, 100, 100, '', 0, null, 0, 0, 0, '', 0, null, 0, '', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL); 60 INSERT INTO `ships` (`id`, `owner`, `name`, `type`, `cargo`, `x`, `y`, `system`, `status`, `crew`, `e`, `s`, `hull`, `shields`, `heat`, `engine`, `weapons`, `comm`, `sensors`, `docked`, `alarm`, `fleet`, `destsystem`, `destx`, `desty`, `destcom`, `bookmark`, `battle`, `battleAction`, `jumptarget`, `autodeut`, `history`, `script`, `scriptexedata`, `oncommunicate`, `lock`, `visibility`, `onmove`, `respawn`) VALUES (3, -1, 'Tanker', 2, '0,300,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', 1, 2, 0, 'noconsign', 30, 40, 0, 10000, 0, '', 100, 100, 100, 100, '', 0, null, 0, 0, 0, '', 0, null, 0, '', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL); 61 INSERT INTO `ships` (`id`, `owner`, `name`, `type`, `cargo`, `x`, `y`, `system`, `status`, `crew`, `e`, `s`, `hull`, `shields`, `heat`, `engine`, `weapons`, `comm`, `sensors`, `docked`, `alarm`, `fleet`, `destsystem`, `destx`, `desty`, `destcom`, `bookmark`, `battle`, `battleAction`, `jumptarget`, `autodeut`, `history`, `script`, `scriptexedata`, `oncommunicate`, `lock`, `visibility`, `onmove`, `respawn`) VALUES (5, -1, 'Frachter', 31, '0,60,0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,', 2, 1, 0, 'noconsign', 30, 80, 0, 8500, 0, '', 100, 100, 100, 100, '', 0, null, 0, 0, 0, '', 0, null, 0, '', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL); 62 INSERT INTO `ships` (`id`, `owner`, `name`, `type`, `cargo`, `x`, `y`, `system`, `status`, `crew`, `e`, `s`, `hull`, `shields`, `heat`, `engine`, `weapons`, `comm`, `sensors`, `docked`, `alarm`, `fleet`, `destsystem`, `destx`, `desty`, `destcom`, `bookmark`, `battle`, `battleAction`, `jumptarget`, `autodeut`, `history`, `script`, `scriptexedata`, `oncommunicate`, `lock`, `visibility`, `onmove`, `respawn`) VALUES (6, -1, 'Tanker', 30, '0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', 2, 2, 0, 'noconsign', 30, 50, 0, 4000, 0, '', 100, 100, 100, 100, '', 0, null, 0, 0, 0, '', 0, null, 0, '', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL); 63 INSERT INTO `ships` (`id`, `owner`, `name`, `type`, `cargo`, `x`, `y`, `system`, `status`, `crew`, `e`, `s`, `hull`, `shields`, `heat`, `engine`, `weapons`, `comm`, `sensors`, `docked`, `alarm`, `fleet`, `destsystem`, `destx`, `desty`, `destcom`, `bookmark`, `battle`, `battleAction`, `jumptarget`, `autodeut`, `history`, `script`, `scriptexedata`, `oncommunicate`, `lock`, `visibility`, `onmove`, `respawn`) VALUES (666, -2, 'GTU Handelsposten Delta Serpentis', 10, '0,2000,0,0,500,2000,0,0,0,0,0,0,5000,0,0,0,0,0,300|10|0|0;301|3|0|0;325|3|0|0;326|3|0|0;161|500|0|0;170|500|0|0;150|500|0|0;154|500|0|0;172|500|0|0', 75, 75, 1, 'tradepost nocrew', 0, 4700, 0, 100000, 0, '', 100, 100, 100, 100, '', 0, null, 0, 0, 0, '', 0, null, 0, '2:150/150', 1, '', NULL, NULL, '*:26:0', NULL, NULL, NULL, NULL); db/updates.xml
r99f84cc r144f38e 415 415 ALTER TABLE `werft_queues` DROP INDEX `queueentry`; 416 416 ]]></update> 417 <update type="structure" datum="2007-10-20"><![CDATA[ 418 ALTER TABLE `ships` CHANGE `battle` `battle` SMALLINT UNSIGNED NULL DEFAULT NULL; 419 UPDATE ships SET battle=NULL WHERE battle=0; 420 ALTER TABLE ships ADD CONSTRAINT ships_fk_battles FOREIGN KEY (battle) REFERENCES battles(id); 421 ]]></update> 417 422 </updates> src/net/driftingsouls/ds2/server/bases/Kommandozentrale.java
rfc49840 r144f38e 390 390 "where id>0 and (x between :minx and :maxx) and " + 391 391 "(y between :miny and :maxy) and " + 392 "system= :sys and locate('l ',docked)=0 and battle =0" +392 "system= :sys and locate('l ',docked)=0 and battle is null " + 393 393 "order by x,y,owner,id") 394 394 .setInteger("minx", base.getX()-base.getSize()) src/net/driftingsouls/ds2/server/battles/Battle.java
reced142 r144f38e 780 780 List shiplist = db.createQuery("from Ship as s inner join fetch s.owner as u "+ 781 781 "where s.id>0 and s.x=? and s.y=? and " + 782 "s.system=? and s.battle =0and " +782 "s.system=? and s.battle is null and " + 783 783 "(ncp(u.ally,:ally1)=1 or " + 784 784 "ncp(u.ally,:ally2)=1) and " + … … 1084 1084 return false; 1085 1085 } 1086 if( shipd.getBattle() != 0) {1086 if( shipd.getBattle() != null ) { 1087 1087 context.addError("Das angegebene Schiff befindet sich bereits in einer Schlacht!"); 1088 1088 return false; … … 1163 1163 // Handelt es sich um eine Flotte? 1164 1164 if( shipd.getFleet() != null ) { 1165 sid = db.createQuery("from Ship as s where s.id>0 and s.fleet=? and s.battle =0and s.x=? and s.y=? and s.system=? and s.lock is null")1165 sid = db.createQuery("from Ship as s where s.id>0 and s.fleet=? and s.battle is null and s.x=? and s.y=? and s.system=? and s.lock is null") 1166 1166 .setEntity(0, shipd.getFleet()) 1167 1167 .setInteger(1, shipd.getX()) … … 1171 1171 } 1172 1172 else { 1173 sid = db.createQuery("from Ship as s where s.id>0 and s.id=? and s.battle =0and s.x=? and s.y=? and s.system=? and s.lock is null")1173 sid = db.createQuery("from Ship as s where s.id>0 and s.id=? and s.battle is null and s.x=? and s.y=? and s.system=? and s.lock is null") 1174 1174 .setInteger(0, shipd.getId()) 1175 1175 .setInteger(1, shipd.getX()) … … 1190 1190 1191 1191 // ggf. gedockte Schiffe auch beruecksichtigen 1192 List docked = db.createQuery("from Ship where id>0 and battle =0and docked in (?,?)")1192 List docked = db.createQuery("from Ship where id>0 and battle is null and docked in (?,?)") 1193 1193 .setString(0, Integer.toString(aship.getId())) 1194 1194 .setString(1, "l "+aship.getId()) … … 1287 1287 1288 1288 if( battledata.isEmpty() ) { 1289 db.createQuery("update Ship set battle= 0where id>0 and battle=?")1289 db.createQuery("update Ship set battle=null where id>0 and battle=?") 1290 1290 .setInteger(0, battleID) 1291 1291 .executeUpdate(); … … 1370 1370 long shipcount = ((Number)db.createQuery("select count(*) from Ship " + 1371 1371 "where owner= :user and x= :x and y= :y and system= :sys and " + 1372 "battle =0and shiptype.shipClass in (11,13)")1372 "battle is null and shiptype.shipClass in (11,13)") 1373 1373 .setEntity("user", auser) 1374 1374 .setInteger("x", this.x) … … 1877 1877 .setInteger(0, this.id) 1878 1878 .executeUpdate(); 1879 db.createQuery("update Ship set battle= 0,battleAction=0 where id>0 and battle=?")1879 db.createQuery("update Ship set battle=null,battleAction=0 where id>0 and battle=?") 1880 1880 .setInteger(0, this.id) 1881 1881 .executeUpdate(); … … 1888 1888 new File(Configuration.getSetting("LOXPATH")+"battles/battle_id"+this.id+".log").renameTo(new File(newlog)); 1889 1889 1890 db.createQuery("update ShipLost set battle= 0,battleLog=? where battle=?")1890 db.createQuery("update ShipLost set battle=null,battleLog=? where battle=?") 1891 1891 .setString(0, newlog) 1892 1892 .setInteger(1, this.id) … … 2010 2010 } 2011 2011 2012 if( ship.getShip().getBattle() == 0) {2012 if( ship.getShip().getBattle() == null ) { 2013 2013 // Es kann vorkommen, dass das Schiff bereits entfernt wurde (wegen einer dock-Beziehung) 2014 2014 return; … … 2047 2047 .iterate().next(); 2048 2048 2049 ship.getShip().setBattle( 0);2049 ship.getShip().setBattle(null); 2050 2050 ship.getShip().setX(loc.getX()); 2051 2051 ship.getShip().setY(loc.getY()); … … 2083 2083 dockcount--; 2084 2084 2085 aship.getShip().setBattle( 0);2085 aship.getShip().setBattle(null); 2086 2086 aship.getShip().setBattleAction(false); 2087 2087 aship.getShip().setX(loc.getX()); src/net/driftingsouls/ds2/server/modules/FleetMgntController.java
r734a9da r144f38e 520 520 List<Integer> idlist = new ArrayList<Integer>(); 521 521 522 List shiplist = db.createQuery("from Ship where fleet=? and battle =0" )522 List shiplist = db.createQuery("from Ship where fleet=? and battle is null" ) 523 523 .setInteger(0, this.fleet.getId()) 524 524 .list(); … … 571 571 StringBuilder message = new StringBuilder(100); 572 572 573 List ships = db.createQuery("from Ship as s where s.fleet=? and (s.shields < s.shiptype.shields or s.shields < s.modules.shields) and s.battle =0")573 List ships = db.createQuery("from Ship as s where s.fleet=? and (s.shields < s.shiptype.shields or s.shields < s.modules.shields) and s.battle is null") 574 574 .setEntity(0, this.fleet) 575 575 .list(); … … 612 612 StringBuilder message = new StringBuilder(100); 613 613 614 List ships = db.createQuery("from Ship as s WHERE s.fleet=? and (s.energy < s.shiptype.eps or s.eps < s.modules.eps) and s.battle =0")614 List ships = db.createQuery("from Ship as s WHERE s.fleet=? and (s.energy < s.shiptype.eps or s.eps < s.modules.eps) and s.battle is null") 615 615 .setEntity(0, this.fleet) 616 616 .list(); … … 654 654 StringBuilder message = new StringBuilder(100); 655 655 656 List ships = db.createQuery("from Ship as s WHERE s.fleet=? and s.battle =0")656 List ships = db.createQuery("from Ship as s WHERE s.fleet=? and s.battle is null") 657 657 .setEntity(0, this.fleet) 658 658 .list(); … … 719 719 org.hibernate.Session db = getDB(); 720 720 721 List ships = db.createQuery("from Ship where id>0 and fleet=? and battle =0")721 List ships = db.createQuery("from Ship where id>0 and fleet=? and battle is null") 722 722 .setEntity(0, this.fleet) 723 723 .list(); … … 743 743 User user = (User)getUser(); 744 744 745 List ships = db.createQuery("from Ship where id>0 and fleet=? and battle =0" )745 List ships = db.createQuery("from Ship where id>0 and fleet=? and battle is null" ) 746 746 .setEntity(0, this.fleet) 747 747 .list(); … … 763 763 List containers = db.createQuery("from Ship as s " + 764 764 "where s.owner=? and s.system=? and s.x=? and s.y=? and s.docked='' and " + 765 "s.shiptype.class=? and s.battle =0" +765 "s.shiptype.class=? and s.battle is null " + 766 766 "order by fleet,type ") 767 767 .setEntity(0, user) … … 802 802 org.hibernate.Session db = getDB(); 803 803 804 List ships = db.createQuery("from Ship where id>0 and fleet=? and battle =0")804 List ships = db.createQuery("from Ship where id>0 and fleet=? and battle is null") 805 805 .setEntity(0, this.fleet) 806 806 .list(); … … 829 829 int jaegertypeID = getInteger("jaegertype"); 830 830 831 List ships = db.createQuery("from Ship where id>0 and fleet=? and battle =0" )831 List ships = db.createQuery("from Ship where id>0 and fleet=? and battle is null" ) 832 832 .setEntity(0, this.fleet) 833 833 .list(); … … 848 848 List jaegerliste = db.createQuery("from Ship as s " + 849 849 "where "+(jaegertypeID > 0 ? "s.type="+jaegertypeID+" and " : "")+"s.owner=? and s.system=? and " + 850 "s.x=? and s.y=? and s.docked='' and (locate(?,s.shiptype.flags)!=0 or locate(?,s.modules.flags)!=0) and s.battle =0" +850 "s.x=? and s.y=? and s.docked='' and (locate(?,s.shiptype.flags)!=0 or locate(?,s.modules.flags)!=0) and s.battle is null " + 851 851 "order by fleet,type ") 852 852 .setEntity(0, user) src/net/driftingsouls/ds2/server/modules/KapernController.java
ra9d0954 r144f38e 183 183 184 184 //In einem Kampf? 185 if( (datan.getBattle() != 0) || (datas.getBattle() != 0) ) {185 if( (datan.getBattle() != null) || (datas.getBattle() != null) ) { 186 186 addError("Eines der Schiffe ist zur Zeit in einen Kampf verwickelt", errorurl); 187 187 … … 288 288 int shipcount = 0; 289 289 List shipList = db.createQuery("from Ship as s where s.x=? and s.y=? and s.system=? and " + 290 "s.owner in ("+Common.implode(",",ownerlist)+") and s.id>0 and s.battle =0and " +290 "s.owner in ("+Common.implode(",",ownerlist)+") and s.id>0 and s.battle is null and " + 291 291 "(locate('=',s.shiptype.weapons)!=0 or locate('=',s.modules.weapons)) and locate('nocrew',s.status)=0") 292 292 .setInteger(0, this.targetShip.getX()) src/net/driftingsouls/ds2/server/modules/PluendernController.java
r7375108 r144f38e 123 123 } 124 124 125 if( (shipFrom.getBattle() != 0) || (shipTo.getBattle() != 0) ) {125 if( (shipFrom.getBattle() != null) || (shipTo.getBattle() != null) ) { 126 126 addError("Eines der Schiffe ist in einen Kampf verwickelt", errorurl); 127 127 src/net/driftingsouls/ds2/server/modules/ScanController.java
r145b7b4 r144f38e 386 386 387 387 List shiplist = db.createQuery("from Ship s inner join fetch s.owner " + 388 "where s.id>0 and s.x= :x and s.y= :y and s.system= :sys and s.battle =0and " +388 "where s.id>0 and s.x= :x and s.y= :y and s.system= :sys and s.battle is null and " + 389 389 "((s.shiptype not in ("+Common.implode(",",verysmallshiptypes)+")) or locate('tblmodules',s.status)!=0) and " + 390 390 "(s.visibility is null or s.visibility= :user) and locate('l ',s.docked)=0 " + src/net/driftingsouls/ds2/server/modules/SchiffController.java
r16c162a r144f38e 138 138 } 139 139 140 if( ship.getBattle() > 0) {140 if( ship.getBattle() != null ) { 141 141 addError("Das Schiff ist in einen Kampf verwickelt (hier klicken um zu diesem zu gelangen)!", Common.buildUrl("default", "module", "angriff", "battle", ship.getBattle(), "ship", shipid) ); 142 142 return false; … … 1197 1197 shiptype = ship.getTypeData(); 1198 1198 1199 if( ship.getBattle() > 0) {1199 if( ship.getBattle() != null ) { 1200 1200 if( (scriptparser != null) && (scriptparser.getContext().getOutput().length() > 0) ) { 1201 1201 t.setVar("ship.scriptparseroutput", src/net/driftingsouls/ds2/server/modules/TCController.java
r7375108 r144f38e 81 81 } 82 82 83 if( ship.getBattle() != 0) {83 if( ship.getBattle() != null ) { 84 84 addError("Das angegebene Schiff befindet sich in einer Schlacht", Common.buildUrl("default", "module", "schiffe" ) ); 85 85 … … 158 158 } 159 159 160 if( tarShip.getBattle() != 0) {160 if( tarShip.getBattle() != null ) { 161 161 addError("Das Zielschiff befindet sich in einer Schlacht", Common.buildUrl("default","module", "schiffe" ) ); 162 162 src/net/driftingsouls/ds2/server/modules/TransportController.java
r7375108 r144f38e 308 308 super.create(role, ship.getId()); 309 309 310 if( ship.getBattle() != 0) {310 if( ship.getBattle() != null ) { 311 311 throw new Exception("Das Schiff (id:"+ship.getId()+") ist in einen Kampf verwickelt"); 312 312 } src/net/driftingsouls/ds2/server/modules/schiffplugins/SensorsDefault.java
ra5861df r144f38e 405 405 ships = db.createQuery("from Ship s inner join fetch s.owner " + 406 406 "where s.id!= :id and s.id>0 and s.x= :x and s.y= :y and s.system= :sys and " + 407 "s.battle =0and (s.visibility is null or s.visibility= :user) and " +407 "s.battle is null and (s.visibility is null or s.visibility= :user) and " + 408 408 "locate('l ',s.docked)=0 and s.shiptype= :showonly and s.owner= :showid and " + 409 409 "locate('disable_iff',s.status)=0 "+ … … 427 427 List typeList = db.createQuery("select count(*),s.shiptype,s.owner.id " + 428 428 "from Ship s " + 429 "where s.id!= :id and s.id>0 and s.x= :x and s.y= :y and s.system= :sys and s.battle =0and " +429 "where s.id!= :id and s.id>0 and s.x= :x and s.y= :y and s.system= :sys and s.battle is null and " + 430 430 "(s.visibility is null or s.visibility= :user ) and locate('disable_iff',s.status)=0 and " + 431 431 "locate('l ',s.docked)=0 " + … … 449 449 ships = db.createQuery("from Ship s inner join fetch s.owner " + 450 450 "where s.id!= :id and s.id>0 and s.x= :x and s.y=:y and s.system= :sys and " + 451 "s.battle =0and (s.visibility is null or s.visibility= :user ) and locate('l ',s.docked)=0 " +451 "s.battle is null and (s.visibility is null or s.visibility= :user ) and locate('l ',s.docked)=0 " + 452 452 "order by "+thisorder+",case when s.docked!='' then s.docked else s.id end, fleet") 453 453 .setInteger("id", ship.getId()) … … 621 621 622 622 //Angreifen 623 if( !disableIFF && (aship.getOwner().getID() != user.getID()) && (aship.getBattle()== 0) && shiptype.isMilitary() ) {623 if( !disableIFF && (aship.getOwner().getID() != user.getID()) && (aship.getBattle()==null) && shiptype.isMilitary() ) { 624 624 if( ( (user.getAlly() != null) && (aship.getOwner().getAlly() != user.getAlly()) ) || (user.getAlly() == null) ) { 625 625 t.setVar("sships.action.angriff",1); src/net/driftingsouls/ds2/server/scripting/ActionFunctions.java
refe50c3 r144f38e 352 352 353 353 Ship ship = scriptparser.getShip(); 354 Ship aship = (Ship)db.createQuery("from Ship where owner=? and system=? and x=? and y=? amd battle =0")354 Ship aship = (Ship)db.createQuery("from Ship where owner=? and system=? and x=? and y=? amd battle is null") 355 355 .setInteger(0, playerid) 356 356 .setInteger(1, ship.getSystem()) src/net/driftingsouls/ds2/server/ships/Ship.java
r21a765a r144f38e 135 135 private String destcom; 136 136 private boolean bookmark; 137 private intbattle;137 private Integer battle; 138 138 private boolean battleAction; 139 139 private String jumptarget; … … 335 335 336 336 /** 337 * Gibt die ID der Schlacht zurueck, in der dich das Schiff befindet ( 0bei keiner).338 * @return Die ID der Schlacht oder <code> 0</code>339 */ 340 public intgetBattle() {337 * Gibt die ID der Schlacht zurueck, in der dich das Schiff befindet (<code>null</code> bei keiner). 338 * @return Die ID der Schlacht oder <code>null</code> 339 */ 340 public Integer getBattle() { 341 341 return battle; 342 342 } … … 346 346 * @param battle Die Schlacht 347 347 */ 348 public void setBattle( intbattle) {348 public void setBattle(Integer battle) { 349 349 this.battle = battle; 350 350 } … … 1322 1322 "system=? and lock is null and docked='' and e>0 and " + 1323 1323 "owner in ("+Common.implode(",",attackers)+") and alarm=1 and " + 1324 "locate('nocrew',status)=0 and battle =0order by owner")1324 "locate('nocrew',status)=0 and battle is null order by owner") 1325 1325 .setInteger(0, this.x) 1326 1326 .setInteger(1, this.y) … … 1339 1339 "system=? and lock is null and docked='' and e>0 and " + 1340 1340 "owner in ("+Common.implode(",",attackers)+") and alarm=1 and " + 1341 "locate('nocrew',status)=0 and battle !=0order by owner")1341 "locate('nocrew',status)=0 and battle is not null order by owner") 1342 1342 .setInteger(0, this.x) 1343 1343 .setInteger(1, this.y) … … 1655 1655 List fleetships = db.createQuery("from Ship " + 1656 1656 "where id>0 and fleet=? AND x=? AND y=? and system=? and owner=? and " + 1657 "docked='' and id!=? and e>0 and battle =0")1657 "docked='' and id!=? and e>0 and battle is null") 1658 1658 .setEntity(0, this.fleet) 1659 1659 .setInteger(1, this.x) … … 1839 1839 } 1840 1840 1841 if( this.battle > 0) {1841 if( this.battle != null ) { 1842 1842 out.append("Fehler: Das Schiff ist in einen Kampf verwickelt\n"); 1843 1843 return true; src/net/driftingsouls/ds2/server/tick/regular/NPCScriptTick.java
rf034a00 r144f38e 76 76 77 77 this.log("+++++++++ User: "+user.getID()+" +++++++++"); 78 List ships = db.createQuery("from Ship where id>0 and owner=? and battle =0and script is not null")78 List ships = db.createQuery("from Ship where id>0 and owner=? and battle is null and script is not null") 79 79 .setEntity(0, user) 80 80 .list(); src/net/driftingsouls/ds2/server/tick/regular/SchiffsTick.java
r390f9f1 r144f38e 239 239 240 240 // Schiff bei Bedarf und falls moeglich reparieren 241 if( (shipd.getBattle() == 0) && (shipd.getStatus().indexOf("lowmoney") == -1) &&241 if( (shipd.getBattle() == null) && (shipd.getStatus().indexOf("lowmoney") == -1) && 242 242 ( (shipd.getEngine() < 100) || (shipd.getWeapons() < 100) || (shipd.getComm() < 100) || (shipd.getSensors() < 100) ) && 243 243 (Ships.getNebula(shipd.getLocation()) != 6) ) { … … 457 457 else { 458 458 this.calledByBattle = false; 459 battle = "s.battle =0";459 battle = "s.battle is null"; 460 460 } 461 461 … … 467 467 if( !this.calledByBattle ) { 468 468 db.createQuery("update Ship set heat=heat-(case when heat>=70 then 70 else heat end) " + 469 "where heat>0 and owner in (from User where vaccount=0 or wait4vac>0) and id>0 and system!=0 and battle =0")469 "where heat>0 and owner in (from User where vaccount=0 or wait4vac>0) and id>0 and system!=0 and battle is null") 470 470 .executeUpdate(); 471 471 } src/net/driftingsouls/ds2/server/werften/WerftGUI.java
r7375108 r144f38e 351 351 List ships = db.createQuery("from Ship s inner join fetch s.owner as u left join fetch s.modules " + 352 352 "where s.id>0 and (s.x between ? and ?) and (s.y between ? and ?) and s.system=? and " + 353 "locate('l ',s.docked)=0 and s.battle =0order by u.id,s.id")353 "locate('l ',s.docked)=0 and s.battle is null order by u.id,s.id") 354 354 .setInteger(0, werft.getX()-werft.getSize()) 355 355 .setInteger(1, werft.getX()+werft.getSize()) … … 558 558 } 559 559 560 if( ship.getBattle() != 0) {560 if( ship.getBattle() != null ) { 561 561 context.addError("Das Schiff befindet sich in einer Schlacht", werft.getUrlBase()+"&sess="+sess); 562 562 return;
