Example #1
0
        /// <summary>
        /// Handles the contents of a network message.
        /// </summary>
        /// <param name="message">The message to handle.</param>
        /// <param name="connection">A reference to the connection from where this message is comming from, for context.</param>
        public override void HandleRequest(INetworkMessage message, IConnection connection)
        {
            var attackInfo = message.ReadAttackInfo();

            var player = this.Game.GetCreatureWithId(connection.PlayerId) as ICombatant;

            player?.SetAttackTarget(attackInfo.TargetCreatureId);
        }