Beispiel #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);
    }
  }
Beispiel #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;
  }
Beispiel #3
0
 public void removeConnection(connection c) {
   connections.removeElement(c);
   sendGlobalServerMsg("Benutzer " + c.getNickname() + " hat den Server verlassen");
 }