trying to fix server ip to use outward ip
This commit is contained in:
		@@ -130,9 +130,7 @@ public void setJoin(String ip, int port) {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void leave() {
 | 
			
		||||
        LOGGER.log(Level.INFO, "leave");
 | 
			
		||||
        app.getAcousticHandler().playSound(MdgaSound.LEAVE);
 | 
			
		||||
        enter(MdgaState.MAIN);
 | 
			
		||||
        app.getGameLogic().selectLeave();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void enter(MdgaState state) {
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,7 @@
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.lang.System.Logger;
 | 
			
		||||
import java.lang.System.Logger.Level;
 | 
			
		||||
import java.net.InetAddress;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
import java.util.UUID;
 | 
			
		||||
import java.util.concurrent.BlockingQueue;
 | 
			
		||||
@@ -67,6 +68,9 @@ public void run() {
 | 
			
		||||
    private void startServer() {
 | 
			
		||||
        try {
 | 
			
		||||
            LOGGER.log(Level.INFO, "Starting server..."); //NON-NLS
 | 
			
		||||
            InetAddress localhost;
 | 
			
		||||
            localhost = InetAddress.getLocalHost();
 | 
			
		||||
            String ip = localhost.getHostAddress();
 | 
			
		||||
            myServer = Network.createServer(port);
 | 
			
		||||
            initializeSerializables();
 | 
			
		||||
            myServer.start();
 | 
			
		||||
@@ -190,6 +194,7 @@ private void messageReceived(HostedConnection source, ClientMessage message) {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void connectionAdded(Server server, HostedConnection hostedConnection) {
 | 
			
		||||
        System.out.println("new connection " + hostedConnection); //NON-NLS
 | 
			
		||||
        LOGGER.log(Level.DEBUG, "new connection {0}", hostedConnection); //NON-NLS
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -102,7 +102,6 @@ private void tryHost() {
 | 
			
		||||
 | 
			
		||||
            if(port >= 1 && port <= 65535) {
 | 
			
		||||
                app.getModelSynchronize().setName(startDialog.getName());
 | 
			
		||||
                hostDialog.setHostname(Inet4Address.getLocalHost().getHostAddress());
 | 
			
		||||
                hostDialog.hostServer();
 | 
			
		||||
                try {
 | 
			
		||||
                    Thread.sleep(1000);
 | 
			
		||||
@@ -117,10 +116,7 @@ private void tryHost() {
 | 
			
		||||
                //app.getAcousticHandler().playSound(MdgaSound.WRONG_INPUT);
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
        } catch (NumberFormatException e) {
 | 
			
		||||
            //nothing
 | 
			
		||||
        } catch (UnknownHostException e) {
 | 
			
		||||
            throw new RuntimeException(e);
 | 
			
		||||
        } catch (NumberFormatException ignored) {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        hostDialog.resetPort();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user