Skip to content

Commit

Permalink
Continuing work on enabling postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
rumour committed Apr 25, 2012
1 parent d2fe719 commit aa268a1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
54 changes: 27 additions & 27 deletions jtrek_tables.sql-postgresql
Expand Up @@ -40,13 +40,13 @@ CREATE TABLE ctfships (
ship_class text NOT NULL DEFAULT '',
ship_quadrant text NOT NULL DEFAULT '',
ship_docktarget text NOT NULL DEFAULT '',
ship_transwarp smallint NOT NULL DEFAULT 0,
ship_xmitter smallint NOT NULL DEFAULT 0,
ship_transwarp boolean NOT NULL DEFAULT false,
ship_xmitter boolean NOT NULL DEFAULT false,
ship_shields smallint NOT NULL DEFAULT 0,
ship_raisingshields smallint NOT NULL DEFAULT 0,
ship_raisingshields boolean NOT NULL DEFAULT false,
ship_warpenused integer NOT NULL DEFAULT 0,
ship_lifesupportfailing smallint NOT NULL DEFAULT 0,
ship_docked smallint NOT NULL DEFAULT 0,
ship_lifesupportfailing boolean NOT NULL DEFAULT false,
ship_docked boolean NOT NULL DEFAULT false,
ship_currentcrystalcount smallint NOT NULL DEFAULT 0,
ship_damagecontrol smallint NOT NULL DEFAULT 0,
ship_warpenergy smallint NOT NULL DEFAULT 0,
Expand All @@ -61,7 +61,7 @@ CREATE TABLE ctfships (
ship_torpedotype smallint NOT NULL DEFAULT 0,
ship_torpedocount smallint NOT NULL DEFAULT 0,
ship_torpedowarpspeed smallint NOT NULL DEFAULT 0,
ship_torpedowarpspeedauto smallint NOT NULL DEFAULT 0,
ship_torpedowarpspeedauto boolean NOT NULL DEFAULT false,
ship_torpedofiretimeout smallint NOT NULL DEFAULT 0,
ship_phasers smallint NOT NULL DEFAULT 0,
ship_phasertype smallint NOT NULL DEFAULT 0,
Expand All @@ -72,18 +72,18 @@ CREATE TABLE ctfships (
ship_dronefiretimeout smallint NOT NULL DEFAULT 0,
ship_minecount smallint NOT NULL DEFAULT 0,
ship_minefiretimeout smallint NOT NULL DEFAULT 0,
ship_cloak smallint NOT NULL DEFAULT 0,
ship_cloak boolean NOT NULL DEFAULT false,
ship_cloaktimecurrent smallint NOT NULL DEFAULT 0,
ship_cloakburnt smallint NOT NULL DEFAULT 0,
ship_cloakburnt boolean NOT NULL DEFAULT false,
ship_cloakfiretimeout smallint NOT NULL DEFAULT 0,
ship_ramtimeout smallint NOT NULL DEFAULT 0,
ship_buoytimeout smallint NOT NULL DEFAULT 0,
ship_corbomite smallint NOT NULL DEFAULT 0,
ship_corbomite boolean NOT NULL DEFAULT false,
ship_corbomitetimeout smallint NOT NULL DEFAULT 0,
ship_iridium smallint NOT NULL DEFAULT 0,
ship_magnabuoy smallint NOT NULL DEFAULT 0,
ship_iridium boolean NOT NULL DEFAULT false,
ship_magnabuoy boolean NOT NULL DEFAULT false,
ship_magnabuoytimeout smallint NOT NULL DEFAULT 0,
ship_neutron smallint NOT NULL DEFAULT 0,
ship_neutron boolean NOT NULL DEFAULT false,
ship_gold integer NOT NULL DEFAULT 0,
ship_damagegiven integer NOT NULL DEFAULT 0,
ship_temp_dmggvn integer NOT NULL DEFAULT 0,
Expand Down Expand Up @@ -203,19 +203,19 @@ CREATE SEQUENCE ships_seq;
CREATE TABLE ships (
ship_id integer NOT NULL DEFAULT nextval('ships_seq'),
player_id integer NOT NULL DEFAULT 0,
ship_alive smallint NOT NULL DEFAULT '1',
ship_alive smallint NOT NULL DEFAULT 1,
ship_preservePwd timestamp without time zone NOT NULL DEFAULT '1000-01-01 00:00:00',
ship_name text NOT NULL DEFAULT '',
ship_class text NOT NULL DEFAULT '',
ship_quadrant text NOT NULL DEFAULT '',
ship_docktarget text NOT NULL DEFAULT '',
ship_transwarp smallint NOT NULL DEFAULT 0,
ship_xmitter smallint NOT NULL DEFAULT 0,
ship_transwarp boolean NOT NULL DEFAULT false,
ship_xmitter boolean NOT NULL DEFAULT false,
ship_shields smallint NOT NULL DEFAULT 0,
ship_raisingshields smallint NOT NULL DEFAULT 0,
ship_raisingshields boolean NOT NULL DEFAULT false,
ship_warpenused integer NOT NULL DEFAULT 0,
ship_lifesupportfailing smallint NOT NULL DEFAULT 0,
ship_docked smallint NOT NULL DEFAULT 0,
ship_lifesupportfailing boolean NOT NULL DEFAULT false,
ship_docked boolean NOT NULL DEFAULT false,
ship_currentcrystalcount smallint NOT NULL DEFAULT 0,
ship_damagecontrol smallint NOT NULL DEFAULT 0,
ship_warpenergy smallint NOT NULL DEFAULT 0,
Expand All @@ -230,7 +230,7 @@ CREATE TABLE ships (
ship_torpedotype smallint NOT NULL DEFAULT 0,
ship_torpedocount smallint NOT NULL DEFAULT 0,
ship_torpedowarpspeed smallint NOT NULL DEFAULT 0,
ship_torpedowarpspeedauto smallint NOT NULL DEFAULT 0,
ship_torpedowarpspeedauto boolean NOT NULL DEFAULT false,
ship_torpedofiretimeout smallint NOT NULL DEFAULT 0,
ship_phasers smallint NOT NULL DEFAULT 0,
ship_phasertype smallint NOT NULL DEFAULT 0,
Expand All @@ -241,21 +241,21 @@ CREATE TABLE ships (
ship_dronefiretimeout smallint NOT NULL DEFAULT 0,
ship_minecount smallint NOT NULL DEFAULT 0,
ship_minefiretimeout smallint NOT NULL DEFAULT 0,
ship_cloak smallint NOT NULL DEFAULT 0,
ship_cloak boolean NOT NULL DEFAULT false,
ship_cloaktimecurrent smallint NOT NULL DEFAULT 0,
ship_cloakburnt smallint NOT NULL DEFAULT 0,
ship_cloakburnt boolean NOT NULL DEFAULT false,
ship_cloakfiretimeout smallint NOT NULL DEFAULT 0,
ship_ramtimeout smallint NOT NULL DEFAULT 0,
ship_buoytimeout smallint NOT NULL DEFAULT 0,
ship_corbomite smallint NOT NULL DEFAULT 0,
ship_corbomite boolean NOT NULL DEFAULT false,
ship_corbomitetimeout smallint NOT NULL DEFAULT 0,
ship_iridium smallint NOT NULL DEFAULT 0,
ship_lithium smallint NOT NULL DEFAULT 0,
ship_iridium boolean NOT NULL DEFAULT false,
ship_lithium boolean NOT NULL DEFAULT false,
ship_lithiumtimeout smallint NOT NULL DEFAULT 0,
ship_magnabuoy smallint NOT NULL DEFAULT 0,
ship_magnabuoy boolean NOT NULL DEFAULT false,
ship_magnabuoytimeout smallint NOT NULL DEFAULT 0,
ship_neutron smallint NOT NULL DEFAULT 0,
ship_seeker smallint NOT NULL DEFAULT 0,
ship_neutron boolean NOT NULL DEFAULT false,
ship_seeker boolean NOT NULL DEFAULT false,
ship_seekertimeout smallint NOT NULL DEFAULT 0,
ship_gold integer NOT NULL DEFAULT 0,
ship_damagegiven integer NOT NULL DEFAULT 0,
Expand Down
6 changes: 3 additions & 3 deletions src/org/gamehost/jtrek/javatrek/TrekJDBCInterface.java
Expand Up @@ -91,7 +91,7 @@ public boolean doesShipExist(String shipName) {
}
rs.close();
} catch (SQLException SQLe) {
TrekLog.logError("*** ERROR *** Exception checking for ship existance: " + shipName);
TrekLog.logError("*** ERROR *** Exception checking for ship existence: " + shipName);
TrekLog.logException(SQLe);
}
return returnFlag;
Expand Down Expand Up @@ -431,7 +431,7 @@ public boolean saveNewShipRecord(TrekShip ship) {
sb.append("macro=").append(key).append("~").append(macro).append("\n\r");
}
writeNewShipStmt.setBytes(77, sb.toString().getBytes());
writeNewShipStmt.setBoolean(78, ship.dbShipAlive);
writeNewShipStmt.setInt(78, ship.dbShipAlive ? 1 : 0);
saveSuccess = writeNewShipStmt.execute();
} catch (SQLException SQLe) {
TrekLog.logError("*** ERROR *** Problem saving new ship: " + ship.parent.shipName);
Expand Down Expand Up @@ -558,7 +558,7 @@ public boolean updateShipRecord(TrekShip ship) {
sb.append("macro=").append(key).append("~").append(macro).append("\n\r");
}
writeUpdatedShipStmt.setBytes(69, sb.toString().getBytes());
writeUpdatedShipStmt.setBoolean(70, ship.dbShipAlive);
writeUpdatedShipStmt.setInt(70, ship.dbShipAlive ? 1 : 0);
writeUpdatedShipStmt.setBoolean(71, ship.lithium);
writeUpdatedShipStmt.setInt(72, ship.lithiumTimeout);
writeUpdatedShipStmt.setBoolean(73, ship.seeker);
Expand Down

0 comments on commit aa268a1

Please sign in to comment.