Пример #1
0
        /// <summary>
        /// Handles deltaupdates send to the server
        /// </summary>
        /// <param name="peer">connected peer</param>
        /// <param name="reader">netpacket without the 1st byte</param>
        private void HandleDeltaUpdate(NetPeer peer, NetPacketReader reader)
        {
            DeltaUpdatePacket       packet = new DeltaUpdatePacket(reader);
            DeltaUpdateReceivedArgs args   = new DeltaUpdateReceivedArgs();

            args.PlayerFaction = packet.faction;
            args.FieldX        = packet.FieldX;
            args.FieldY        = packet.FieldY;
            args.Population    = packet.Population;
            OnDeltaUpdateReceived(args);
        }
Пример #2
0
 protected virtual void OnDeltaUpdateReceived(DeltaUpdateReceivedArgs e)
 {
     DeltaUpdateReceived?.Invoke(this, e);
 }