add pubkey auth
This commit is contained in:
parent
bdf67a89f7
commit
5a394749bf
24 changed files with 822 additions and 107 deletions
|
@ -41,6 +41,7 @@ import client.audio.Volume;
|
|||
import client.gui.FileCallback;
|
||||
import client.gui.Font;
|
||||
import client.gui.Gui;
|
||||
import client.gui.GuiConnect.ServerInfo;
|
||||
import client.gui.GuiConsole;
|
||||
import client.gui.GuiInfo;
|
||||
import client.gui.GuiLoading;
|
||||
|
@ -513,14 +514,14 @@ public class Client implements IThreadListener {
|
|||
return networkmanager;
|
||||
}
|
||||
|
||||
public void connect(String address, int port, String user, String pass, String access) {
|
||||
this.displayGuiScreen(GuiLoading.makeWaitTask("Verbinde zu " + (address == null ? "localhost" : address) + ":" + port + " ..."));
|
||||
Log.NETWORK.info("Verbinde zu " + (address == null ? "localhost" : address) + ":" + port);
|
||||
public void connect(ServerInfo server) {
|
||||
this.displayGuiScreen(GuiLoading.makeWaitTask("Verbinde zu " + (server.getAddress() == null ? "localhost" : server.getAddress()) + ":" + server.getPort() + " ..."));
|
||||
Log.NETWORK.info("Verbinde zu " + (server.getAddress() == null ? "localhost" : server.getAddress()) + ":" + server.getPort());
|
||||
final NetConnection connection;
|
||||
try
|
||||
{
|
||||
connection = createNetworkManagerAndConnect(address == null ? InetAddress.getLoopbackAddress() : InetAddress.getByName(IDN.toASCII(address)), port);
|
||||
connection.setNetHandler(new ClientLoginHandler(connection, this, user, access, pass));
|
||||
connection = createNetworkManagerAndConnect(server.getAddress() == null ? InetAddress.getLoopbackAddress() : InetAddress.getByName(IDN.toASCII(server.getAddress())), server.getPort());
|
||||
connection.setNetHandler(new ClientLoginHandler(connection, this, server));
|
||||
connection.sendPacket(new HPacketHandshake(Util.PROTOCOL), new GenericFutureListener<Future<? super Void>>() {
|
||||
public void operationComplete(Future<? super Void> u) throws Exception {
|
||||
connection.setConnectionState(PacketRegistry.LOGIN);
|
||||
|
@ -530,7 +531,7 @@ public class Client implements IThreadListener {
|
|||
catch (UnknownHostException u)
|
||||
{
|
||||
Log.NETWORK.error(u, "Konnte nicht zu Server verbinden");
|
||||
this.disconnected("Unbekannter Hostname: " + (address == null ? "localhost" : address));
|
||||
this.disconnected("Unbekannter Hostname: " + (server.getAddress() == null ? "localhost" : server.getAddress()));
|
||||
return;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue