예제 #1
0
  public void sendGlobalServerMsg(String msg) {
    int i;
    connection you;

    for (i = 0; i < connections.size(); i++) {
      you = (connection) connections.elementAt(i);
      you.sendServerMsg(msg);
    }
  }
예제 #2
0
  public boolean userExists(String name) {
    int i;
    connection you;

    for (i = 0; i < connections.size(); i++) {
      you = (connection) connections.elementAt(i);
      if (you.getNickname().equals(name)) {
        return true;
      }
    }
    return false;
  }
예제 #3
0
 public void removeConnection(connection c) {
   connections.removeElement(c);
   sendGlobalServerMsg("Benutzer " + c.getNickname() + " hat den Server verlassen");
 }