Examples of ClientPacket


Examples of com.hazelcast.nio.ClientPacket

            buffer.clear();
        }
    }

    public Data read() throws IOException {
        ClientPacket packet = new ClientPacket(serializationService.getSerializationContext());
        while (true) {
            if (readFromSocket) {
                int readBytes = socketChannelWrapper.read(readBuffer);
                if (readBytes == -1) {
                    throw new EOFException("Remote socket closed!");
                }
                readBuffer.flip();
            }
            boolean complete = packet.readFrom(readBuffer);
            if (complete) {
                if (readBuffer.hasRemaining()) {
                    readFromSocket = false;
                } else {
                    readBuffer.compact();
                    readFromSocket = true;
                }
                return packet.getData();
            }
            readFromSocket = true;
            readBuffer.clear();
        }
    }
View Full Code Here

Examples of soc.qase.com.packet.ClientPacket

*  it contains and reacting accordingly. See the following methods
for a list of all valid message types. */
/*-------------------------------------------------------------------*/
  protected void processServerPacket(ServerPacket packet)
  {
    ClientPacket clientPacket = null;
    Message message = null;

    message = packet.getMessage();

    try
View Full Code Here

Examples of soc.qase.com.packet.ClientPacket

/*-------------------------------------------------------------------*/
/*-------------------------------------------------------------------*/
  private byte[] processIncomingPacket(byte[] data)
  {
    ClientPacket currentPacket;
    Sequence sequenceOne = null;
    Sequence sequenceTwo = null;
    int length = 0;

    sequenceOne = new Sequence(data);
View Full Code Here

Examples of soc.qase.com.packet.ClientPacket

*  recording the current game session; used by QASE when recording
*  multi-map demos*/
/*-------------------------------------------------------------------*/
  public synchronized void disconnect(boolean stopRecording)
  {
    ClientPacket packet = null;
    ClientCommand message = null;

    if(dm2Recorder.isRecording() && stopRecording)
      dm2Recorder.stopRecording();

    if(connected)
    {
      inGame = false;
      message = new ClientCommand(clientID, "disconnect");
      packet = new ClientPacket(message);
      communicator.sendUnreliable(packet);
      communicator.disconnect();
      connected = false;
    }
  }
View Full Code Here

Examples of soc.qase.com.packet.ClientPacket

*  Called by sendCommand and sendConsoleCommand.
@param command the command to send to the server */
/*-------------------------------------------------------------------*/
  protected ClientPacket buildCommandPacket(String command)
  {
    return new ClientPacket(new ClientCommand(clientID, command));
  }
View Full Code Here

Examples of soc.qase.com.packet.ClientPacket

*  to enter a game session.*/
/*-------------------------------------------------------------------*/
  private void sendBegin()
  {
    String command = null;
    ClientPacket packet = null;
    ClientCommand message = null;

    message = new ClientCommand(clientID, "begin " + server.getLevelKey());
    packet = new ClientPacket(message);
    communicator.sendReliable(packet);
  }
View Full Code Here

Examples of soc.qase.com.packet.ClientPacket

*  actually performs the transmission of the client's desired move.
@see #sendMovement(Angles, Velocity, Action) */
/*-------------------------------------------------------------------*/
  private void sendMove()
  {
    ClientPacket packet = null;
    ClientMove message = null;
   
    lastMove = previousMove;
    previousMove = currentMove;
    currentMove = new Move(angles, velocity, action, communicator.getPing());
    message = new ClientMove(clientID, world.getFrame(), currentMove, previousMove, lastMove, communicator.getNextSequence());
    packet = new ClientPacket(message);
    communicator.sendUnreliable(packet);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.