Okay, so I'm making a online fighting game and the dialog where you input the server IP keeps popping up again and again even though the code only asks for it once. It's not in any kind of loop though, so I dunno what's going on.
public void connectAndInit(){
try{
String ip = JOptionPane.showInputDialog("Input server IP.");
players = new Player[MAX_PLAYERS];
players[0] = new Player(25,25,135);
players[1] = new Player(750,550,315);
ct = new ClientThread(ip, players);
ct.start();
ct.setPriority(Thread.MAX_PRIORITY);
playerNum = ct.playerNum;
init = false;
}
catch(Exception e){
e.printStackTrace();
}
}
@Override
public void update()
{
if(init)
connectAndInit();
}
Here is the game with the problem: http://prime.programming-designs.com/java/metaship-client.jnlp
And here is the server you need to start before you run the game: http://prime.programming-designs.com/java/metaship-server.jnlp