-print "starting listener ...\n";
-Msg->new_server("$clusteraddr", $clusterport, \&login);
+dbg("starting listeners ...");
+my $conn = IntMsg->new_server($clusteraddr, $clusterport, \&login);
+$conn->conns("Server $clusteraddr/$clusterport using IntMsg");
+push @listeners, $conn;
+dbg("Internal port: $clusteraddr $clusterport using IntMsg");
+foreach my $l (@main::listen) {
+ no strict 'refs';
+ my $pkg = $l->[2] || 'ExtMsg';
+ my $login = $l->[3] || 'login';
+
+ $conn = $pkg->new_server($l->[0], $l->[1], \&{"${pkg}::${login}"});
+ $conn->conns("Server $l->[0]/$l->[1] using ${pkg}::${login}");
+ push @listeners, $conn;
+ dbg("External Port: $l->[0] $l->[1] using ${pkg}::${login}");
+}
+
+dbg("AGW Listener") if $AGWMsg::enable;
+AGWrestart();
+
+dbg("BPQ Listener") if $BPQMsg::enable;
+BPQMsg::init(\&new_channel);
+
+dbg("UDP Listener") if $UDPMsg::enable;
+UDPMsg::init(\&new_channel);
+
+# load bad words
+dbg("load badwords: " . (BadWords::load or "Ok"));