public byte[] getFinalData(ClientData playerData) { // TODO: Sim Time with Client (not real time) on every 4 Local SSEQ we send playerData.IncrementSseq(); this.neededAckSSeq = playerData.getSseq(); if ((NumericalUtils.ByteArrayToUint32(TimeUtils.getCurrentSimTime(), 1) - playerData.lastSimTimeUpdate) > 3) { timed = true; playerData.lastSimTimeUpdate = NumericalUtils.ByteArrayToUint32(TimeUtils.getCurrentSimTime(), 1); } playerData.getRPCShutDown(); if (timed) { if (playerData.waitForRPCShutDown == true) { content.append((byte)0xc2); } else { content.append((byte)0x82); } content.append(TimeUtils.getCurrentSimTime()); } else { if (playerData.waitForRPCShutDown == true) { content.append((byte)0x42); } else { content.append((byte)0x02); } } // Merge all Message together and generate the Final Packet Header generateObjectMessageData(); generateRpcMessageData(); Output.WriteDebugLog("PACKET DATA (getFinalData):" + StringUtils.bytesToString(content.getBytes())); return(content.getBytes()); }
public byte[] getFinalData(ClientData playerData) { // TODO: Sim Time with Client (not real time) on every 4 Local SSEQ we send playerData.IncrementSseq(); this.neededAckSSeq = playerData.getSseq(); if ((playerData.getSseq() - playerData.lastSimTimeSEQ) >= 4) { timed = true; } playerData.getRPCShutDown(); if (timed) { if (playerData.waitForRPCShutDown == true) { content.append((byte)0xc2); } else { content.append((byte)0x82); } content.append(TimeUtils.getCurrentSimTime(2000)); } else { if (playerData.waitForRPCShutDown == true) { content.append((byte)0x42); } else { content.append((byte)0x02); } } // Merge all Message together and generate the Final Packet Header generateObjectMessageData(); generateRpcMessageData(); return(content.getBytes()); }
public byte[] getFinalData(ClientData playerData) { // TODO: Sim Time with Client (not real time) on every 4 Local SSEQ we send playerData.IncrementSseq(); this.neededAckSSeq = playerData.getSseq(); if ((NumericalUtils.ByteArrayToUint32(TimeUtils.getCurrentSimTime(), 1) - playerData.lastSimTimeUpdate) > 3) { timed = true; playerData.lastSimTimeUpdate = NumericalUtils.ByteArrayToUint32(TimeUtils.getCurrentSimTime(),1); } playerData.getRPCShutDown(); if (timed) { if (playerData.waitForRPCShutDown==true) { content.append((byte)0xc2); } else { content.append((byte)0x82); } content.append(TimeUtils.getCurrentSimTime()); } else { if (playerData.waitForRPCShutDown == true) { content.append((byte)0x42); } else { content.append((byte)0x02); } } // Merge all Message together and generate the Final Packet Header generateObjectMessageData(); generateRpcMessageData(); Output.WriteDebugLog("PACKET DATA (getFinalData):" + StringUtils.bytesToString(content.getBytes())); return content.getBytes(); }