private static TimeSpan m_WalkFoot = TimeSpan.FromSeconds( 0.4 );
private static TimeSpan m_RunFoot = TimeSpan.FromSeconds( 0.2 );
private static TimeSpan m_WalkMount = TimeSpan.FromSeconds( 0.2 );
private static TimeSpan m_RunMount = TimeSpan.FromSeconds( 0.1 );
ya but thats permanant, i was under the impression that they wanted this to be turned on and off at times, which would mean you would need to send the wrong packet to the client that you were mounted, i could be wrong tho, maybe they want to run around fast like this all the time, who knows.tophyr said:In Server/Mobile.cs:
Code:private static TimeSpan m_WalkFoot = TimeSpan.FromSeconds( 0.4 ); private static TimeSpan m_RunFoot = TimeSpan.FromSeconds( 0.2 ); private static TimeSpan m_WalkMount = TimeSpan.FromSeconds( 0.2 ); private static TimeSpan m_RunMount = TimeSpan.FromSeconds( 0.1 );
That's what controls character walking/running speed. The client can send packets as fast as it wants (and sometimes does, that's how speedhacks work), but RunUO won't let anyone move any more often than what's set right there. A value of "0.2" means that every .2 seconds you can move a tile, so 5 tiles per second.
Sorious said:ya but thats permanant, i was under the impression that they wanted this to be turned on and off at times, which would mean you would need to send the wrong packet to the client that you were mounted, i could be wrong tho, maybe they want to run around fast like this all the time, who knows.
public class SetClientSpeed : Packet
{
public SetClientSpeed(byte value)
: base(0xBF)
{
EnsureCapacity(6);
m_Stream.Write((short)0x26);
m_Stream.Write(value);
}
}
mobile.Send( new SetClientSpeed( 1 ) );
tophyr said:Packets have almost no effect on walking speed, except in that if the client doesn't send a MovementReq packet, the Mobile will never move
The way it happens is...
1) Mobile (server side) keeps track of the last time he moved tiles (through normal means like walking/running).
2) Player (client side) moves somewhere, client sends a MovementReq packet to the server.
3) Server packethandlers pick up the packet, dish it out and eventually call Mobile.Move(), where it checks if the required amount of time has passed (ie 0.4 sec, 0.2 sec or 0.1 sec).
3a) If the delay has passed, Move allows the move and does all the work associated with moving a mobile, including sending a MovementAck packet back to the client with their new location.
3b) If the delay has NOT passed (ie, the player is trying to move too soon), Move queues the action and creates a FastWalkEvent. If there are enough FWE's piled up, the server flags the Mobile as FastWalking and logs a warning.
So, long story short, in order to change movement speed, you need to change those four variables (to change it for *everyone*) or you need to change Mobile.Move() to be more adaptable. If you go lower than (faster than) 0.1 seconds, you'll run into packet issues because the client probably won't send them any more than 10 per sec (doesn't expect you to move faster than that), but other than that, packets won't enter the picture at all.