Package serverMessages

Examples of serverMessages.NewConnectionEvent


    if( in.readByte()==0){
     
      out.writeInt(PlayerID); //send id
      out.flush();
      int i=in.readInt();
      ServerMain.logicalUnit.EventQue.add(new NewConnectionEvent(Id,0,i));
      System.out.print("Charater created! New player joined!!");
     
      //new player is there other players whats current game state!?!?!?
     
    }else{
View Full Code Here


  public void networkServerMessageOut(UdpBroadCast udp) {}
  public void networkServerMessageOut(UdpBroadCast udp,double x, double y) {
      udp.moveUnit(ID, x, y);
  }
  public void networkServerMessageIn(ClientEventOut in, GameState g) {
    NewConnectionEvent i=(NewConnectionEvent)in;
    g.getUnits().put(i.ID, new BasicTestUnit(i.ID,i.sourceId,new Point2D.Double(Math.random()*1350,Math.random()*1350)));
    System.out.print("player Created\n");
    g.udp.newUnit(i.ID, i.sourceId, i.type, g.getUnits().get(i.ID).getLoc().getX(),g.getUnits().get(i.ID).getLoc().getY());
  }
View Full Code Here

TOP

Related Classes of serverMessages.NewConnectionEvent

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.