@Override
	public void run() {
		while (Server.run) {
			try {
				stream.ping();
				if (stream.isEOF()) {
					break;
				}
				while (stream.getAvailable() > 0) {
					Packet packet = Packet.readPacket(stream);
					if (packet != null) {
						packet.handle();
						if (packet instanceof Packet_Login) {
							Packet_Login p = (Packet_Login) packet;
							if (p.getResponseCode() == Packet_Login.RESPONSE_ACCEPT) {
								verifyed = true;
								return;
							}
						}
					}
				}
			} catch (Exception e) {
				break;
			}
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
			}
			
		}
		Server.getServer().getNetworkManager().getLogger().info("Lost connection [" + stream.getIP() + "]");
	}