diff --git a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/OtherPlayerCharactersModel.java b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/OtherPlayerCharactersModel.java index 31d9e40..9d26711 100644 --- a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/OtherPlayerCharactersModel.java +++ b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/OtherPlayerCharactersModel.java @@ -36,6 +36,8 @@ private int nextConnectRenaimdTime = 0; private int connectInterval = 300; private Map visibleCharacters = new HashMap<>(); + private String id; + private String playerId; public OtherPlayerCharactersModel(RealTime3DFragment fragment, Universe universe) { this.fragment = fragment; @@ -43,8 +45,11 @@ } public void setInstanceId(String id) { - con = new CharactersConnection(id); - con.setCallBack(this); + this.id = id; + } + + public void setPlayerId(String id) { + playerId = id; } /** @@ -56,10 +61,11 @@ @Override public void update(double interval) { nextConnectRenaimdTime -= interval; - if (nextConnectRenaimdTime <= 0 && con != null) { + if (nextConnectRenaimdTime <= 0) { nextConnectRenaimdTime = connectInterval; + con = new CharactersConnection(id); + con.setCallBack(this); con.doGet(); -// con.doAnything(); } } @@ -72,10 +78,13 @@ Map m = json.decode(response); for (Map.Entry entry: m.entrySet()) { visibleCharacters.put(entry.getKey(), 1); - ArrayList properties = new ArrayList<>(); Map player = entry.getValue(); + String[] accountUri = ((String)player.get("accountURI")).split("/"); + // 自分自身は無視する + if (accountUri[accountUri.length-1] == playerId) continue; + // 情報の取得 Map position = (Map)player.get("position"); Map angle = (Map)player.get("angle"); @@ -85,7 +94,6 @@ properties.add(quaProp); if (!universe.doHaveObj(entry.getKey())) { - OvergroundActor pocha; Appearance ap1 = new Appearance(); Material mat = new Material(); mat.setDiffuseColor(0.0f, 0.3f, 1.0f); @@ -96,10 +104,9 @@ ap1.setMaterial(mat); Object3D pochaBody = null; - Animation3D pochaAnimation = null; try { pochaBody = ModelFactory.loadModel(fragment.getResources(), "pocha.stl", ap1).createObject(); - pochaBody.scale(10.0); + pochaBody.scale(5.0); } catch (Exception e) { e.printStackTrace(); }