Example #1
0
        /// <summary>
        /// Proccess a player's change direction.
        /// </summary>
        /// <param name="player">The player doing the action.</param>
        /// <param name="world">A reference to the gameworld.</param>
        private void ProcessChangeDirection(Player player, GameWorld world)
        {
            byte rawDirection = netmsg.GetByte();

            //Validate direction
            if (!IsDirectionValid(rawDirection))
            {
                return;
            }

            Direction direction; //direction to move

            direction = (Direction)rawDirection;
#if DEBUG
            Log.WriteDebug("In ProcessChangeDirection()");
            Log.WriteDebug("direction: " + direction);
#endif
            world.HandleChangeDirection(player, direction);
        }
Example #2
0
        /// <summary>
        /// Proccess a player's change direction.
        /// </summary>
        /// <param name="player">The player doing the action.</param>
        /// <param name="world">A reference to the gameworld.</param>
        private void ProcessChangeDirection(Player player, GameWorld world)
        {
            byte rawDirection = netmsg.GetByte();

            //Validate direction
            if (!IsDirectionValid(rawDirection))
                return;

            Direction direction; //direction to move

            direction = (Direction)rawDirection;
            #if DEBUG
            Log.WriteDebug("In ProcessChangeDirection()");
            Log.WriteDebug("direction: " + direction);
            #endif
            world.HandleChangeDirection(player, direction);
        }