Changeset b50d1575022f578a3b75ab1678bbb3831fa23c19

Show
Ignore:
Timestamp:
04/29/07 10:25:54 (2 years ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1177835154 +0200
git-parent:

[5189e17e5be09531fd632abb60c1d4975cac20fa]

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

Ein paar KS-Bugs eliminiert

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/net/driftingsouls/ds2/server/battles/Battle.java

    r4be6f46 rb50d157  
    724724                Set<Integer> enemyUsers = new HashSet<Integer>();                
    725725 
    726                 SQLQuery aShipRow = db.query("SELECT s.*,u.name AS username,u.ally ", 
    727                                                                         "FROM ships s JOIN users u ON s.owner=u.id ", 
    728                                                                         "WHERE s.id>0 AND s.x=",tmpOwnShip.getInt("x")," AND s.y=",tmpOwnShip.getInt("y")," AND " , 
    729                                                                                 "s.system=",tmpOwnShip.getInt("system")," AND s.battle=0 AND " , 
    730                                                                                 "u.ally IN (",tmpOwnShip.getInt("ally"),",",tmpEnemyShip.getInt("ally"),") AND " , 
     726                SQLQuery aShipRow = db.query("SELECT s.*,u.name AS username,u.ally "+ 
     727                                                                        "FROM ships s JOIN users u ON s.owner=u.id "+ 
     728                                                                        "WHERE s.id>0 AND s.x="+tmpOwnShip.getInt("x")+" AND s.y="+tmpOwnShip.getInt("y")+" AND " + 
     729                                                                                "s.system="+tmpOwnShip.getInt("system")+" AND s.battle=0 AND " + 
     730                                                                                "u.ally IN ("+tmpOwnShip.getInt("ally")+","+tmpEnemyShip.getInt("ally")+") AND " + 
    731731                                                                                "!LOCATE('disable_iff',s.status) AND `lock` IS NULL AND (u.vaccount=0 OR u.wait4vac > 0)"); 
    732732                                                                         
     
    736736                                continue; 
    737737                        } 
    738                          
    739738                        User tmpUser = context.createUserObject( aShipRow.getInt("owner") ); 
    740                                                 
     739                                         
    741740                        if( tmpUser.isNoob() ) { 
    742741                                continue; 
     
    14931492                for( int i=0; i < 2; i++ ) { 
    14941493                        List<SQLResultRow> destroyList = new ArrayList<SQLResultRow>(); 
     1494                        List<SQLResultRow> fluchtList = new ArrayList<SQLResultRow>(); 
     1495                        List<SQLResultRow> fluchtReposList = new ArrayList<SQLResultRow>(); 
    14951496                         
    14961497                        List<SQLResultRow> shiplist = sides.get(i); 
     
    15321533                                if( (aship.getInt("action") & BS_FLUCHT) != 0 ) { 
    15331534                                        if( ashipType.getInt("cost") > 0 ) { 
    1534                                                 this.removeShip(aship, true); 
    1535                                         }  
     1535                                                fluchtReposList.add(aship); 
     1536                                        } 
    15361537                                        else { 
    1537                                                 this.removeShip(aship, false); 
     1538                                                fluchtList.add(aship); 
    15381539                                        } 
    15391540         
     
    15901591                        for( int key=0; key < destroyList.size(); key++ ) { 
    15911592                                this.destroyShip(destroyList.get(key)); 
     1593                        } 
     1594                         
     1595                        for( int key=0; key < fluchtList.size(); key++ ) { 
     1596                                this.removeShip(fluchtList.get(key), false); 
     1597                        } 
     1598                         
     1599                        for( int key=0; key < fluchtReposList.size(); key++ ) { 
     1600                                this.removeShip(fluchtReposList.get(key), true); 
    15921601                        } 
    15931602                         
  • src/net/driftingsouls/ds2/server/modules/ks/KSDischargeBatteriesAllAction.java

    r4be6f46 rb50d157  
    108108 
    109109                        db.update("UPDATE ships SET e="+aship.getInt("e")+",battleAction=1,cargo='"+mycargo.save()+"' " + 
    110                                         "WHERE id="+aship.getInt("e")+" AND cargo='"+mycargo.save(true)+"' AND e="+oldE); 
     110                                        "WHERE id="+aship.getInt("id")+" AND cargo='"+mycargo.save(true)+"' AND e="+oldE); 
    111111                         
    112112                        if( db.affectedRows() > 0 ) { 
  • src/net/driftingsouls/ds2/server/modules/ks/KSDischargeBatteriesSingleAction.java

    r4be6f46 rb50d157  
    8989                mycargo.addResource( Resources.LBATTERIEN, batterien ); 
    9090 
    91                 db.update("UPDATE ships SET e=",ownShip.getInt("e"),",battleAction=1,cargo='",mycargo.save(),"' WHERE id=",ownShip.getInt("e")," cargo='",mycargo.save(true),"' AND e=",oldE); 
     91                db.update("UPDATE ships SET e=",ownShip.getInt("e"),",battleAction=1,cargo='",mycargo.save(),"' WHERE id=",ownShip.getInt("id")," cargo='",mycargo.save(true),"' AND e=",oldE); 
    9292                 
    9393                if( db.affectedRows() > 0 ) { 
  • src/net/driftingsouls/ds2/server/modules/ks/KSMenuDefaultAction.java

    ra99e9fe rb50d157  
    5757                // Kampf beenden weil die eigene Streitmacht deutlich groesser ist? 
    5858                if( this.isPossible(battle, new KSEndBattleEqualAction()) == RESULT_OK ) { 
    59                         this.menuEntry("Kampf beenden (unentschieden)",  
     59                        this.menuEntryAsk("Kampf beenden (unentschieden)",  
    6060                                                                new Object[] {  "ship",         ownShip.getInt("id"), 
    6161                                                                                                "attack",       enemyShip.getInt("id"),