Package org.menacheri.jetserver.event

Examples of org.menacheri.jetserver.event.NetworkEvent


  protected void onDataIn(Event event)
  {
    if (null != getSession())
    {
      PlayerSession pSession = (PlayerSession) getSession();
      NetworkEvent networkEvent = new DefaultNetworkEvent(event);
      if (pSession.isUDPEnabled())
      {
        networkEvent.setDeliveryGuaranty(FAST);
      }
      pSession.getGameRoom().sendBroadcast(networkEvent);
    }
  }
View Full Code Here


  {
    if(world.apocalypse())
    {
      // Send it to all players
      System.out.println("Apocalypse is here");
      NetworkEvent networkEvent = Events.networkEvent(Messages.apocalypse());
      room.sendBroadcast(networkEvent);
    }
    else
    {
      NetworkEvent networkEvent = null;
      if(room.getProtocol() instanceof WebSocketProtocol)
      {
        networkEvent = Events.networkEvent(world.getAlive());
      }
      else
View Full Code Here

      NettyMessageBuffer buffer = new NettyMessageBuffer();
      System.out.println("Command No: " + cmdCount);
      buffer.writeInt(cmdCount);
//      Event tcpEvent = Events.dataOutTcpEvent(buffer);
//      getSession().onEvent(tcpEvent);
      NetworkEvent udpEvent = null;
      if(isDefaultProtocol){
        udpEvent = Events.networkEvent(buffer, DeliveryGuarantyOptions.FAST);
      }else{
        udpEvent = Events.networkEvent(cmdCount);// for websocket protocol.
      }
View Full Code Here

TOP

Related Classes of org.menacheri.jetserver.event.NetworkEvent

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.