()
| 85 | } |
| 86 | |
| 87 | public void run() |
| 88 | { |
| 89 | running = true; |
| 90 | |
| 91 | while(running) |
| 92 | { |
| 93 | try |
| 94 | { |
| 95 | String message = connection.readMessage(); |
| 96 | |
| 97 | if(message == null) |
| 98 | { |
| 99 | gameData.kickFromGame(); |
| 100 | disconnect(); |
| 101 | } |
| 102 | else |
| 103 | { |
| 104 | gameData.handleMessage(message); |
| 105 | |
| 106 | if(checkStayAliveTime()) |
| 107 | { |
| 108 | sendKeepAlive(); |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | catch (SocketTimeoutException e) |
| 113 | { |
| 114 | //e.printStackTrace(); |
| 115 | |
| 116 | if(checkTimeout()) |
| 117 | { |
| 118 | gameData.kickFromGame(); |
| 119 | disconnect(); |
| 120 | } |
| 121 | else |
| 122 | { |
| 123 | sendKeepAlive(); |
| 124 | } |
| 125 | } |
| 126 | catch (IOException e) |
| 127 | { |
| 128 | e.printStackTrace(); |
| 129 | |
| 130 | gameData.kickFromGame(); |
| 131 | disconnect(); |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | } |
nothing calls this directly
no test coverage detected