summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-05-07 17:42:29 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-05-07 17:42:29 +0200
commitff728d43ef5bd4c5e23240fc2eae360cec7b7d14 (patch)
treea911a05b1069f0d2d60dee85bdbcbc9cbbe66287 /core/src/ch/asynk/rustanddust
parent6674bc4913961a4811ca0bf825b4e84a366ac3b9 (diff)
downloadRustAndDust-ff728d43ef5bd4c5e23240fc2eae360cec7b7d14.zip
RustAndDust-ff728d43ef5bd4c5e23240fc2eae360cec7b7d14.tar.gz
DB: format sql before calling loadGame(...)
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-rw-r--r--core/src/ch/asynk/rustanddust/util/DB.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/ch/asynk/rustanddust/util/DB.java b/core/src/ch/asynk/rustanddust/util/DB.java
index c5c68c3..61e7161 100644
--- a/core/src/ch/asynk/rustanddust/util/DB.java
+++ b/core/src/ch/asynk/rustanddust/util/DB.java
@@ -349,7 +349,7 @@ public class DB
public GameRecord loadGame(int game)
{
RustAndDust.debug("loadGame");
- return loadGame(game, LOAD_GAME, "loadGAME");
+ return loadGame(game, String.format(LOAD_GAME, game), "loadGAME");
}
private static final String LOAD_LAST_TURN = "select g._id, g.mode, g.battle, g.opponent, g.turn, g.currentPlayer, g.ts, g.synched"
@@ -359,14 +359,14 @@ public class DB
public GameRecord loadLastTurn(int game)
{
RustAndDust.debug("loadLastTurn");
- return loadGame(game, LOAD_LAST_TURN, "loadLastTurn");
+ return loadGame(game, String.format(LOAD_LAST_TURN, game), "loadLastTurn");
}
private GameRecord loadGame(int game, String sql, String errMsg)
{
GameRecord r = null;
try {
- DatabaseCursor cursor = query(String.format(sql, game));
+ DatabaseCursor cursor = query(sql);
if (cursor.getCount() > 0) {
cursor.next();
r = gameRecordFrom(cursor);