mirror of
https://github.com/ServUO/ServUO
synced 2026-08-11 20:23:04 -04:00
-Fixed issue where client helpers could bypass the container gump and add items directly to the seed box -SearedFireAntGoo is no longer stackable -Blue NPC's (mainly vendors, not initial innocent) can no longer be attacked on trammel maps -Aggressors/Aggressed from pet masters now works properly. This was suspected to crated large numbers to redundant aggressor/aggressed added to a mobiles aggressor/aggressed lists -Aggressive action for healing a mobile while fighting another mobile has been re-enabled -AuraDamage is now a harmful act, ie those affected will aggro on your pet! -MLDryads should no longer attack other wild creatures during Blackthorn Invasion Instance -More code cleanup
54 lines
1.2 KiB
C#
54 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Reflection;
|
|
|
|
namespace Server
|
|
{
|
|
public delegate void ValidationEventHandler();
|
|
|
|
public static class ValidationQueue
|
|
{
|
|
public static event ValidationEventHandler StartValidation;
|
|
public static void Initialize()
|
|
{
|
|
if (StartValidation != null)
|
|
StartValidation();
|
|
|
|
StartValidation = null;
|
|
}
|
|
}
|
|
|
|
public static class ValidationQueue<T>
|
|
{
|
|
private static List<T> m_Queue;
|
|
static ValidationQueue()
|
|
{
|
|
m_Queue = new List<T>();
|
|
ValidationQueue.StartValidation += ValidateAll;
|
|
}
|
|
|
|
public static void Add(T obj)
|
|
{
|
|
m_Queue.Add(obj);
|
|
}
|
|
|
|
private static void ValidateAll()
|
|
{
|
|
Type type = typeof(T);
|
|
|
|
if (type != null)
|
|
{
|
|
MethodInfo m = type.GetMethod("Validate", BindingFlags.Instance | BindingFlags.Public);
|
|
|
|
if (m != null)
|
|
{
|
|
for (int i = 0; i < m_Queue.Count; ++i)
|
|
m.Invoke(m_Queue[i], null);
|
|
}
|
|
}
|
|
|
|
m_Queue.Clear();
|
|
m_Queue = null;
|
|
}
|
|
}
|
|
}
|