Skip to content

Commit

Permalink
Exclude the bot from logging 'bank' messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rumour committed Apr 26, 2012
1 parent d0e27c4 commit 5e76dbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
16 changes: 3 additions & 13 deletions src/org/gamehost/jtrek/javatrek/TrekPropertyReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,23 @@
* User: jay
* Date: Aug 2, 2004
* Time: 10:31:30 PM
* To change this template use File | Settings | File Templates.
*/
public class TrekPropertyReader {
// for reading in any properties we want to define in a file
// i.e. jdbc connection parameters
private static String fileName = "./jtrek.properties";
private static Properties propertyPairs = null;
private static TrekPropertyReader tpr = null;

private TrekPropertyReader() {
String fileName = "./jtrek.properties";
File propertyFile = new File(fileName);
try {
FileInputStream pfInputStream = new FileInputStream(propertyFile);
// do the process of populating the Hashtable of properties pairs here
propertyPairs = new Properties();
propertyPairs.load(pfInputStream);

// test code
// propertyPairs.list(System.out);

} catch (FileNotFoundException fnfe) {
fnfe.printStackTrace();
} catch (IOException ioe) {
ioe.printStackTrace();
}

}

protected static TrekPropertyReader getInstance() {
Expand All @@ -74,13 +65,12 @@ protected Properties getProperties() {

protected String getValue(String s) {
String returnValue = "";
// do a look up in the Hashtable for the property defined by 's', and return the value

try {
returnValue = propertyPairs.getProperty(s);
} catch (Exception e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
e.printStackTrace();
}
return returnValue;
}
}
}
4 changes: 2 additions & 2 deletions src/org/gamehost/jtrek/javatrek/TrekShip.java
Original file line number Diff line number Diff line change
Expand Up @@ -3382,7 +3382,7 @@ public void beamGold() {
if (TrekUtilities.isObjectGold(lockTarget)) {
TrekGold goldTarget = (TrekGold) scanTarget;
this.gold += goldTarget.amount;
if (goldTarget.dbPlayerID == parent.dbPlayerID) {
if (goldTarget.dbPlayerID == parent.dbPlayerID && parent.dbPlayerID != TrekServer.botPlayerId) {
String outputString = "*** Poss Bank: " + parent.shipName + " / " + goldTarget.ownerName + " / " + goldTarget.amount +
", pID: " + parent.dbPlayerID;
TrekLog.logMessage(outputString);
Expand Down Expand Up @@ -3420,7 +3420,7 @@ public void beamGold() {
if (shipDebris.gold > 0) {
gold += shipDebris.gold;
parent.hud.sendMessage("Beamed aboard " + shipDebris.gold + " gold.");
if (parent.dbPlayerID == shipDebris.dbPlayerID) {
if (parent.dbPlayerID == shipDebris.dbPlayerID && parent.dbPlayerID != TrekServer.botPlayerId) {
String outputString = "*** Poss Bank: " + parent.shipName + " / " + shipDebris.whos + " (debris) / " + shipDebris.gold +
", pID: " + parent.dbPlayerID;
TrekLog.logMessage(outputString);
Expand Down

0 comments on commit 5e76dbf

Please sign in to comment.