예제 #1
0
        private Event? Process(CSVCMsg_PacketEntities message) {
            log.Debug("svc_PacketEntities is_delta: "
                + message.is_delta
                + " baseline: " + message.baseline
                + " update_baseline: " + message.update_baseline
                + " delta: " + message.delta_from);

            using (var stream = Bitstream.CreateWith(message.entity_data)) {
                entityUpdater.Update(
                    stream,
                    (uint) message.baseline,
                    message.update_baseline,
                    (uint) message.updated_entries,
                    message.is_delta);
            }

            if (message.update_baseline) {
                client.Baseline = message.baseline;
                return Event.BASELINE;
            } else {
                return null;
            }
        }
예제 #2
0
        private Event? Process(CSVCMsg_PacketEntities message) {
            log.Debug("svc_PacketEntities is_delta: "
                + message.is_delta
                + " baseline: " + message.baseline
                + " update_baseline: " + message.update_baseline
                + " delta: " + message.delta_from);

            using (var stream = Bitstream.CreateWith(message.entity_data)) {
                entityUpdater.Update(
                    stream,
                    (uint) message.baseline,
                    message.update_baseline,
                    (uint) message.updated_entries,
                    message.is_delta);
            }

            if (message.update_baseline) {
                var ack = new CCLCMsg_BaselineAck();
                ack.baseline_nr = client.Baseline;
                ack.baseline_tick = (int) client.ServerTick;
                var ackMsg = Connection.ConvertProtoToMessage<CCLCMsg_BaselineAck>(
                    (uint) CLC_Messages.clc_BaselineAck,
                    ack);
                connection.SendReliably(ackMsg);
                return null;
            } else {
                return null;
            }
        }