Exemple #1
0
  // Events
  public void onPlayerLogin(ChatPlayer cp) {
    ((ChatChannel) getDefaultChannel()).connectWithoutBroadcast(cp.getPlayer().getName());

    if (cp.hasAutoJoin()) {
      if (cp.isJoinAllAvailableEnabled()) {
        ISMain.getChannelManager().joinAllAvailableChannels(cp);
      } else {
        List<String> channelNames = cp.getAutoJoinList();

        for (String channelName : channelNames) {
          List<Channel> l = matchChannel(channelName);

          if ((l.size() == 1) && (cp.canConnect((Channel) l.get(0), ""))) {
            ((ChatChannel) l.get(0)).connectWithoutBroadcast(cp.getPlayer().getName());
          }
        }
      }
    }

    getDefaultChannel().assignFocus(cp.getPlayer().getName(), true);

    if ((cp.getPlayer().isOp())
        && (cp.canConnect(ISMain.getChannelManager().getHelpOpChannel(), ""))) {
      getHelpOpChannel().addListener(cp.getPlayer().getName(), false);
    }
  }
Exemple #2
0
  private void joinAllAvailableChannels(ChatPlayer cp) {
    for (Map.Entry channel : getMap().entrySet()) {
      if (cp.canConnect((Channel) channel.getKey(), "")) {
        ChatChannel c = (ChatChannel) channel.getKey();
        c.connectWithoutBroadcast(cp.getPlayer().getName());
      }
    }

    getDefaultChannel().assignFocus(cp.getPlayer().getName(), true);
  }
Exemple #3
0
 private void disconnectFromAllChannels(ChatPlayer cp) {
   for (Map.Entry entry : getMap().entrySet()) {
     ChatChannel c = (ChatChannel) entry.getKey();
     c.silentDisconnect(cp.getPlayer().getName());
   }
 }