private void reportLocation(String newClient, LocalClient me) { // Suspend user input and random generator me.pause(); // Wait 100ms for all packets to be queued try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } // Clear queue Mazewar.actionQueue.clear(); Mazewar.ackTracker.clear(); // Get my location DirectedPoint myDp = new DirectedPoint(me.getPoint(), me.getOrientation()); // Prepare packet to report my location MazewarPacket outgoing = new MazewarPacket(); outgoing.type = MazewarPacket.REPORT_LOCATION; outgoing.owner = Mazewar.myName; outgoing.directedPoint = myDp; outgoing.score = me.getScore(); synchronized (Mazewar.connectedOuts) { logger.info("Reporting my location to: " + newClient); // Report my location to the new guy try { Mazewar.connectedOuts.get(newClient).writeObject(outgoing); } catch (IOException e) { e.printStackTrace(); } } }