this commit either improves reliability or does nothing at all

This commit is contained in:
Chipmunk 2023-02-22 23:20:57 -05:00
parent 56ae0d364a
commit cdd5b3dc5f
2 changed files with 3 additions and 3 deletions

View file

@ -29,8 +29,6 @@ public class Client {
final Session session = new TcpClientSession(options.host(), options.port(), options.protocol(), options.proxy()); final Session session = new TcpClientSession(options.host(), options.port(), options.protocol(), options.proxy());
this.session = session; this.session = session;
session.connect();
session.addListener(new SessionAdapter () { session.addListener(new SessionAdapter () {
@Override public void packetReceived(Session session, Packet packet) { for (SessionListener listener : listeners) listener.packetReceived(session, packet); } @Override public void packetReceived(Session session, Packet packet) { for (SessionListener listener : listeners) listener.packetReceived(session, packet); }
@Override public void packetSending (PacketSendingEvent event) { for (SessionListener listener : listeners) listener.packetSending(event); } @Override public void packetSending (PacketSendingEvent event) { for (SessionListener listener : listeners) listener.packetSending(event); }
@ -55,6 +53,8 @@ public class Client {
new Timer().schedule(task, options.reconnectDelay()); new Timer().schedule(task, options.reconnectDelay());
} }
}); });
session.connect();
} }
public long reconnectDelay () { return options.reconnectDelay(); } public long reconnectDelay () { return options.reconnectDelay(); }

View file

@ -164,7 +164,7 @@ public class NBSConverter {
if (index >= customInstruments.size()) continue; if (index >= customInstruments.size()) continue;
NBSCustomInstrument customInstrument = customInstruments.get(index); NBSCustomInstrument customInstrument = customInstruments.get(index);
instrument = Instrument.of(customInstrument.name); instrument = Instrument.of(customInstrument.name);
key += customInstrument.pitch; // key += customInstrument.pitch;
} }
if (key < 33 || key > 57) { if (key < 33 || key > 57) {