Beispiel #1
0
        public static void Identify(TargetAction action)
        {
            ServerTargetHandler targetHandler = Engine.TargetHandler as ServerTargetHandler;

            if (((targetHandler != null) && ((targetHandler.Creation + MarginOfError) > DateTime.Now)) && (targetHandler.Flags == GetFlags(action)))
            {
                targetHandler.Action = action;
            }
            m_Lookahead = TargetAction.Unknown;
        }
Beispiel #2
0
 public PTarget_Cancel(ServerTargetHandler handler)
     : base(0x6c, "Target Cancel", 0x13)
 {
     base.m_Stream.Write((byte) 0);
     base.m_Stream.Write(handler.TargetID);
     base.m_Stream.Write((byte) handler.Flags);
     base.m_Stream.Write(0);
     base.m_Stream.Write(-1);
     base.m_Stream.Write(0);
 }
Beispiel #3
0
 public static void Identify()
 {
     if (m_Lookahead != TargetAction.Unknown)
     {
         ServerTargetHandler targetHandler = Engine.TargetHandler as ServerTargetHandler;
         if ((((m_Creation + MarginOfError) > DateTime.Now) && (targetHandler != null)) && (targetHandler.Flags == GetFlags(m_Lookahead)))
         {
             targetHandler.Action = m_Lookahead;
         }
         m_Lookahead = TargetAction.Unknown;
     }
 }
Beispiel #4
0
 public PTarget_Response(int type, ServerTargetHandler handler, int serial, int x, int y, int z, int id)
     : base(0x6c, "Target Response", 0x13)
 {
     base.m_Stream.Write((byte) type);
     base.m_Stream.Write(handler.TargetID);
     base.m_Stream.Write((byte) handler.Flags);
     base.m_Stream.Write(serial);
     base.m_Stream.Write((short) x);
     base.m_Stream.Write((short) y);
     base.m_Stream.Write((short) z);
     base.m_Stream.Write((short) id);
 }
Beispiel #5
0
 private static void Target(PacketReader pvSrc)
 {
     byte num = pvSrc.ReadByte();
     int targetID = pvSrc.ReadInt32();
     byte num3 = pvSrc.ReadByte();
     int num4 = pvSrc.ReadInt32();
     short num5 = pvSrc.ReadInt16();
     short num6 = pvSrc.ReadInt16();
     byte num7 = pvSrc.ReadByte();
     sbyte num8 = pvSrc.ReadSByte();
     short num9 = pvSrc.ReadInt16();
     if (m_CancelTarget)
     {
         m_CancelTarget = false;
     }
     else if (num3 == 3)
     {
         if (Engine.TargetHandler is ServerTargetHandler)
         {
             Engine.TargetHandler.OnCancel(TargetCancelType.UserCancel);
             Engine.TargetHandler = null;
         }
     }
     else
     {
         ServerTargetHandler handler;
         m_TimeLastCast = DateTime.Now;
         Engine.m_LastTargetID = targetID;
         if ((num > 1) || (((num3 != 1) && (num3 != 2)) && (num3 != 0)))
         {
             pvSrc.Trace();
         }
         Engine.TargetHandler = handler = new ServerTargetHandler(targetID, num != 1, (ServerTargetFlags) num3);
         TargetActions.Identify();
         if (handler.Action != TargetAction.Unknown)
         {
             for (int i = 0; i < Engine.m_AutoTarget.Count; i++)
             {
                 AutoTargetSession session = (AutoTargetSession) Engine.m_AutoTarget[i];
                 if (session.m_Action == handler.Action)
                 {
                     session.m_Timer.Delete();
                     Engine.m_AutoTarget.RemoveAt(i);
                     Engine.Target(session.m_Entity);
                     break;
                 }
             }
         }
     }
 }
 public GCriminalTargetQuery(Mobile m, ServerTargetHandler handler)
     : base("This may flag\nyou criminal!", true, null)
 {
     this.m_Mobile = m;
     this.m_Handler = handler;
 }