diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2019-11-27 15:46:01 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2019-11-27 15:46:01 +0100 |
commit | 85e24527c250eefbf3c82b8f3ef92af15db09bd0 (patch) | |
tree | 011358d775424bfe24e40bc03f63a7cd1c36a15d /android/src/ch/asynk/rustanddust | |
parent | cc037dad6333c3d538de0bc85ab9eea92a30ff82 (diff) | |
download | RustAndDust-master.zip RustAndDust-master.tar.gz |
Diffstat (limited to 'android/src/ch/asynk/rustanddust')
-rw-r--r-- | android/src/ch/asynk/rustanddust/android/AndroidBackend.java | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/android/src/ch/asynk/rustanddust/android/AndroidBackend.java b/android/src/ch/asynk/rustanddust/android/AndroidBackend.java index 6454dfb..f350742 100644 --- a/android/src/ch/asynk/rustanddust/android/AndroidBackend.java +++ b/android/src/ch/asynk/rustanddust/android/AndroidBackend.java @@ -29,48 +29,48 @@ public class AndroidBackend implements Backend public int getMyId() { return me; } public int getOpponentId() { return opponent; } - private void updateUsers(final RustAndDust game) - { - new Thread( new Runnable() { - @Override - public void run() { - Cursor ccs = app.getContentResolver().query( - ContactsContract.CommonDataKinds.Email.CONTENT_URI, - new String[] { - ContactsContract.Data.DISPLAY_NAME, - ContactsContract.CommonDataKinds.Email.DATA1, - }, - ContactsContract.CommonDataKinds.Email.DATA1 + " like '%gmail.com' and " + ContactsContract.CommonDataKinds.Email.DATA3 + " like 'Rustanddust'", - null, null); + // private void updateUsers(final RustAndDust game) + // { + // new Thread( new Runnable() { + // @Override + // public void run() { + // Cursor ccs = app.getContentResolver().query( + // ContactsContract.CommonDataKinds.Email.CONTENT_URI, + // new String[] { + // ContactsContract.Data.DISPLAY_NAME, + // ContactsContract.CommonDataKinds.Email.DATA1, + // }, + // ContactsContract.CommonDataKinds.Email.DATA1 + " like '%gmail.com' and " + ContactsContract.CommonDataKinds.Email.DATA3 + " like 'Rustanddust'", + // null, null); - if (ccs == null) { - RustAndDust.debug("No Contacts found"); - return; - } + // if (ccs == null) { + // RustAndDust.debug("No Contacts found"); + // return; + // } - PlayerRecord.clearList(); - RustAndDust.debug("Contacts :"); - while (ccs.moveToNext()) { - PlayerRecord r = PlayerRecord.get(); - r.name = ccs.getString(0); - r.email = ccs.getString(1); - PlayerRecord.list.add(r); - RustAndDust.debug( " " + r.toString()); - } + // PlayerRecord.clearList(); + // RustAndDust.debug("Contacts :"); + // while (ccs.moveToNext()) { + // PlayerRecord r = PlayerRecord.get(); + // r.name = ccs.getString(0); + // r.email = ccs.getString(1); + // PlayerRecord.list.add(r); + // RustAndDust.debug( " " + r.toString()); + // } - Gdx.app.postRunnable( new Runnable() { - @Override - public void run() { - for (ListElement e : PlayerRecord.list) { - PlayerRecord r = (PlayerRecord) e; - game.db.storePlayer(r.name, r.email); - } - PlayerRecord.clearList(); - } - }); - } - }).start(); - } + // Gdx.app.postRunnable( new Runnable() { + // @Override + // public void run() { + // for (ListElement e : PlayerRecord.list) { + // PlayerRecord r = (PlayerRecord) e; + // game.db.storePlayer(r.name, r.email); + // } + // PlayerRecord.clearList(); + // } + // }); + // } + // }).start(); + // } @Override public void init(final RustAndDust game) @@ -85,6 +85,6 @@ public class AndroidBackend implements Backend me = game.db.storePlayerGetId("me", "myself"); opponent = me; - updateUsers(game); + // updateUsers(game); } } |