diff --git a/src/main/java/com/ntlab/irisserver/entities/DrawingController.java b/src/main/java/com/ntlab/irisserver/entities/DrawingController.java index 6c5c48d..13a7222 100644 --- a/src/main/java/com/ntlab/irisserver/entities/DrawingController.java +++ b/src/main/java/com/ntlab/irisserver/entities/DrawingController.java @@ -22,7 +22,7 @@ private int drawingTime; //お絵描きのタイムリミット private int countdown; //あと何秒でタイムリミットになるか private boolean isDrawingTimer; //タイマーを使うかどうか - + //描いている最中にタイムリミット(countdown==0)がくれば、描いている途中のものをputさせる。既に描き終わっている人は何もしない //時間が0になったときに、描き終わっていない人は「描いている最中の絵をput」する。(クライアントサイド) デバッグがしにくい assingmentのgetで見れるようにする //getdnoの番号が変わっていたら、「新しい絵を描く」 @@ -45,7 +45,7 @@ //お絵描きのタイムリミットを記録 Settings setting = game.getSettings(); - startTime = System.nanoTime(); + startTime = System.currentTimeMillis(); this.drawingTime = setting.getDrawingTimerTimes(); this.isDrawingTimer = setting.isDrawingTimer(); @@ -73,7 +73,7 @@ stage += 1; //タイマーをリセット - startTime = System.nanoTime(); + startTime = System.currentTimeMillis(); countdown = drawingTime; //ゲームに必要な枚数がそろうと、roomのstateを「お絵描き中2」から「ゲーム中3」に変更 @@ -86,7 +86,7 @@ //お絵描き中のタイマーを更新 private void updateTimer(){ //経過した時間を計算(秒) - nowTime = System.nanoTime(); + nowTime = System.currentTimeMillis(); int count = ((int)nowTime - (int)startTime)/1000; if(drawingTime - count > 0){ @@ -111,12 +111,13 @@ return dno; } - public int getCountdown(){ + //これはどこのRESTで使う? assignmentでもいいけど、名前と機能が一致しない assignmentの下にtimerを作ってもいい + public Integer getCountdown(){ if(isDrawingTimer){ updateTimer(); return countdown; }else{ - return 1; + return null; } }