[Question]Jump

07/28/2010 15:43 teroareboss1#1
Who can tell me why the players jump so fast?
in 5165 :|

My jump.cs
Code:
               public static bool CanSee(int SeeX, int SeeY, int MyX, int MyY)
        {
            return (Math.Max(Math.Abs(SeeX - MyX), Math.Abs(SeeY - MyY)) <= 17);
        }

        public static void Handle(Main.GameClient GC, byte[] Data)
        {

            ushort Previos_X = BitConverter.ToUInt16(Data, 20);
            ushort Previos_y = BitConverter.ToUInt16(Data, 22);
            ushort new_X = (ushort)(BitConverter.ToUInt32(Data, 8) & 0xFFFF);
            ushort new_Y = (ushort)(BitConverter.ToUInt32(Data, 10) & 0xFFFF);//(ushort)(BitConverter.ToUInt32(Data, 8) >> 16);

          
           // Console.WriteLine("X {0} and Y{1}", new_X, new_Y);
           COPacket Jump = Packets.GeneralData(GC.MyChar.EntityID, new_X, new_Y, Previos_X, Previos_y, 0, 137);
            foreach (DictionaryEntry DE in Game.World.H_Chars)
            {
                Game.Character C = (Game.Character)DE.Value;
                {
                    if (GC.MyChar.Loc.Map == C.Loc.Map)
                    {
                        if (CanSee(GC.MyChar.Loc.X, GC.MyChar.Loc.Y, C.Loc.X, C.Loc.Y))
                            C.MyClient.SendPacket(Jump);
                       // C.MyClient.SendPacket(Packets.GeneralData(GC.MyChar.EntityID, new_X, new_Y, Previos_X, Previos_y, 0, 137));
                    }
                }
            }
           
            GC.MyChar.lastJumpDistance = GetDistance(new_X, new_Y, GC.MyChar.Loc.X, GC.MyChar.Loc.Y);
            GC.MyChar.lastJumpTime = DateTime.Now;
            GC.MyChar.Mining = false;
            GC.MyChar.AtkMem.Attacking = false;
            GC.MyChar.InvencibleTime = DateTime.Now;
            GC.MyChar.secondeimunity = 0;
            GC.MyChar.Action = (byte)Game.ConquerAction.Jump;
            GC.MyChar.Loc.PreviousX = Previos_X;
            GC.MyChar.Loc.PreviousY = Previos_y;
            GC.MyChar.Loc.X = new_X;
            GC.MyChar.Loc.Y = new_Y;
            Game.World.Spawns(GC.MyChar, true);
Send Packet whit:
Code:
public unsafe void SendPacket(COPacket Packet)
       {
           if (Soc.Connected)
           {
               byte[] P = Packet.Get;
               fixed (byte* p = P)
               {
                   string TQServer = "TQServer";
                   for (int i = 0; i < 8; i++)
                       *(p + i + P.Length - 8) = Convert.ToByte(TQServer[i]);

               }
               PacketGroup.Add(P);
               Monitor.Enter(this);
               try
               {
                   ArrayList Packets = new ArrayList();
                   for (int i = 0; i < PacketGroup.Count; i++)
                       Packets.Add(PacketGroup[i]);
                   int TotalLength = 0;
                   foreach (byte[] Pa in Packets)
                       if (Pa != null)
                           if (Pa.Length > 0)
                               TotalLength += Pa.Length;
                   byte[] Data = new byte[TotalLength];
                   int Pos = 0;
                   lock (Packets)
                   {
                       foreach (byte[] Pa in Packets)
                       {
                           if (Pa != null)
                           {
                               if (Pa.Length > 0)
                               {
                                   Buffer.BlockCopy(Pa, 0, Data, Pos, Pa.Length);
                                   Pos += Pa.Length;
                               }
                           }
                       }
                       try
                       {
                           Crypto.Encrypt(Data);
                           Soc.Send(Data, Data.Length, SocketFlags.None);
                       }
                       catch { }
                   }
                   Packets = null;
                   PacketGroup = new ArrayList();
               }
               catch (Exception c) { PacketGroup = new ArrayList(); Program.WriteLine(c.ToString()); }
               //Crypto.Encrypt(P);
               Monitor.Exit(this);

               //Soc.Send(P);

           }
           else
               Disconnect();
       }
07/28/2010 16:09 Fish*#2
The jump is normal lol.
If you want it slower, change to old jump.
07/28/2010 21:13 Adziunia#3
there can be few reasons like bots/cheats or they have 50 ping
07/28/2010 22:05 teroareboss1#4
Quote:
Originally Posted by Adziunia View Post
there can be few reasons like bots/cheats or they have 50 ping
Quote:
Originally Posted by grillmad View Post
The jump is normal lol.
If you want it slower, change to old jump.
This is not the problem,send the packet with 200miliseconds leater
if you jump again the character goes fast,like jumping with speed