/// <summary> /// Process a player's walk. /// </summary> /// <param name="player">The player doing the action.</param> /// <param name="world">A reference to the gameworld.</param> private void ProcessWalk(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 ProcessWalk()"); Log.WriteDebug("direction: " + direction); #endif world.HandleManualWalk(player, direction); /* p.SetTargetPosition(null); * * if (p.GetLastWalk().Elapsed()) //Enough time passed * world.SendCreatureWalk(p, direction);*/ }
/// <summary> /// Process a player's walk. /// </summary> /// <param name="player">The player doing the action.</param> /// <param name="world">A reference to the gameworld.</param> private void ProcessWalkWest(Player player, GameWorld world) { world.HandleManualWalk(player, Direction.WEST); }
/// <summary> /// Process a player's walk. /// </summary> /// <param name="player">The player doing the action.</param> /// <param name="world">A reference to the gameworld.</param> private void ProcessWalkSouth(Player player, GameWorld world) { world.HandleManualWalk(player, Direction.SOUTH); }
/// <summary> /// Process a player's walk. /// </summary> /// <param name="player">The player doing the action.</param> /// <param name="world">A reference to the gameworld.</param> private void ProcessWalkNorth(Player player, GameWorld world) { world.HandleManualWalk(player, Direction.NORTH); }
/// <summary> /// Process a player's walk. /// </summary> /// <param name="player">The player doing the action.</param> /// <param name="world">A reference to the gameworld.</param> private void ProcessWalk(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 ProcessWalk()"); Log.WriteDebug("direction: " + direction); #endif world.HandleManualWalk(player, direction); /* p.SetTargetPosition(null); if (p.GetLastWalk().Elapsed()) //Enough time passed world.SendCreatureWalk(p, direction);*/ }