示例#1
0
文件: Server.java 项目: w4-pwr/studia
 public synchronized void sendClientData(String name, ObjectOutputStream out) throws IOException {
   for (ClientData cd : clientList)
     if (cd.getName().equals(name)) {
       out.writeObject(cd);
       return;
     }
 }
示例#2
0
  public void set(ClientData cd) {
    // System.out.println(cd);
    if (cd.left()) toggleRotate(-1);
    else if (cd.right()) toggleRotate(1);
    else toggleRotate(0);
    if (cd.forward()) toggleMove(1);
    else if (cd.backward()) toggleMove(-1);
    else toggleMove(0);
    // if(cd.mouseLoc()!=null)//i have no idea why this is null sometimes, but this works
    //	{
    if (cd.shoot()) shoot(cd.mouseLoc());
    else if (cd.specialShoot()) specialShoot(cd.mouseLoc());
    lookAt(cd.mouseLoc());
    //	}

  }