summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-rw-r--r--core/src/ch/asynk/rustanddust/util/DB.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/util/DB.java b/core/src/ch/asynk/rustanddust/util/DB.java
index 2e108ca..f143585 100644
--- a/core/src/ch/asynk/rustanddust/util/DB.java
+++ b/core/src/ch/asynk/rustanddust/util/DB.java
@@ -247,6 +247,19 @@ public class DB
return getGameId(opponent, battle, mode);
}
+ private static final String COPY_TURN = "insert into turns(game,turn,player,hash,payload) select _id, turn, player, hash, payload from games where _id=%d;";
+
+ public boolean storeTurn(int game)
+ {
+ try {
+ exec(String.format(COPY_TURN, game));
+ } catch (SQLiteGdxException e) {
+ RustAndDust.error("storeTurn");
+ return false;
+ }
+ return true;
+ }
+
private static final String INSERT_TURN = "insert into turns(game,turn,player,hash,payload) values (%d,%d,%d,'%s','%s');";
public boolean storeTurn(int game, int turn, int player, String payload)