325 } |
325 } |
326 } |
326 } |
327 |
327 |
328 static int recvmove(GameState *gamestate, GameInfo *gameinfo, int opponent) { |
328 static int recvmove(GameState *gamestate, GameInfo *gameinfo, int opponent) { |
329 |
329 |
330 if (net_setnonblocking(opponent, 1)) { |
|
331 printw("Cannot setup nonblocking IO on network socket"); |
|
332 cbreak(); getch(); |
|
333 exit(EXIT_FAILURE); |
|
334 } |
|
335 |
|
336 struct timeval timeout; |
330 struct timeval timeout; |
337 while (1) { |
331 while (1) { |
338 timecontrol(gamestate, gameinfo); |
332 timecontrol(gamestate, gameinfo); |
339 |
333 |
340 move(inputy, 0); |
334 move(inputy, 0); |