Package general.messages

Examples of general.messages.UpdateUnitMessage


 
  @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
View Full Code Here


          String message = ((StringMessage) received).Message;
          System.out.println("Received message from server: "+message);
        }
       
        if (received instanceof UpdateUnitMessage) {
          UpdateUnitMessage unitUpdate = ((UpdateUnitMessage) received);
          receiveCount++;
         
          if(receiveCount % 5000 == 0)
          {
            newtime = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of general.messages.UpdateUnitMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.