@Override
public void run() {
System.out.println("running client-thread");
StringMessage welcomeMessage = new StringMessage("Willkommen auf dem Server!");
UpdateUnitMessage updateMessage = new UpdateUnitMessage(4, new Vector3f(3.4f, 1.3f, 8.3f), new Vector3f(3.5f, 1.8f, 3.2f), 4.6f);
try {
System.out.println("Sending welcome Message");
outstream.writeObject(welcomeMessage);
outstream.flush();
outstream.writeObject(updateMessage);
outstream.flush();
} catch (IOException e) {
Logger.addEntry(LoggingLevel.WARN, "Could not send welcomeMessage");
}
while(!client.isClosed())
{
try {
//Benchmarktest
UpdateUnitMessage update = new UpdateUnitMessage((int)(Math.random()*100), new Vector3f((float)(Math.random()*100), (float)(Math.random()*100), (float)(Math.random()*100)), new Vector3f((float)(Math.random()*100), (float)(Math.random()*100), (float)(Math.random()*100)), (float)Math.random()*100);
outstream.writeObject(update);
outstream.flush();
//Thread.sleep(1);
//} catch (InterruptedException e) {
// TODO Auto-generated catch block