mirror of
https://github.com/ServUO/ServUO
synced 2026-08-11 20:23:04 -04:00
+ Add MONO to Makefile compile definitions. + Update Ultima SDK to support MONO compile definition. + Rename Properties Gump parent directory to prevent VS issues. + Console error messages will now use red instead of dark red font. + Add crash state handler function to Core. + AI optimizations and housekeeping. + Context Menu optimizations and housekeeping. + Add ability to drop throttled packets. + Add string parsing support to Rectangle3D. + Optimize guild messages and chat. + IAddon implements IChopable. + Add more flexibility for altering Mobile names. + Add ability to enable or disable OPL for individual mobiles. + Optimize damaging regions and ensure timers are removed properly. + Update Welcome Timer with more intuitive message groups. + Normalize all virtue related objects to the Server.Services.Virtues namespace. + Add ability for ISpawner to append OPL and Context Menus to their spawn. + Add EventSink events for obtaining items, equipping items, context menus, and world broadcasts. + Add ability to lock a creature's direction and movement regardless of AI manipulation. + Add ability to dynamically change a creature's approach range and wait state. + Add extended enumeration features for AOS attributes. + Add ability to control whether creatures have blood, and its color. + Expose corpse flag manipulation methods. + Add ability to prevent criminal action when looting a corpse. + Corpse will now be permanently tagged as murderer at time of death if owner is a murderer. + Add TextDefinition support for Commodity Deed descriptions. + House add-on and component optimizations and housekeeping. + Item light is no longer backed by the direction property. + ITool implements IEntity. + Prevent trading of Siege Bless items. + Guards are naturally be immune to guards. + Siege Shard initialization housekeeping. + Character Creation housekeeping. + Generic commands housekeeping. + Add Mark command for staff.
185 lines
No EOL
4 KiB
C#
185 lines
No EOL
4 KiB
C#
#region References
|
|
using System;
|
|
using System.IO;
|
|
using System.Text;
|
|
|
|
using Server.Network;
|
|
#endregion
|
|
|
|
namespace Server
|
|
{
|
|
public sealed class ObjectPropertyList : Packet
|
|
{
|
|
private readonly IEntity m_Entity;
|
|
private int m_Hash;
|
|
private int m_Header;
|
|
private int m_Strings;
|
|
private string m_HeaderArgs;
|
|
|
|
public IEntity Entity { get { return m_Entity; } }
|
|
public int Hash { get { return 0x40000000 + m_Hash; } }
|
|
|
|
public int Header { get { return m_Header; } set { m_Header = value; } }
|
|
public string HeaderArgs { get { return m_HeaderArgs; } set { m_HeaderArgs = value; } }
|
|
|
|
public static bool Enabled { get; set; }
|
|
|
|
public ObjectPropertyList(IEntity e)
|
|
: base(0xD6)
|
|
{
|
|
EnsureCapacity(128);
|
|
|
|
m_Entity = e;
|
|
|
|
m_Stream.Write((short)1);
|
|
m_Stream.Write(e.Serial);
|
|
m_Stream.Write((byte)0);
|
|
m_Stream.Write((byte)0);
|
|
m_Stream.Write(e.Serial);
|
|
}
|
|
|
|
public void Add(int number)
|
|
{
|
|
if (number == 0)
|
|
{
|
|
return;
|
|
}
|
|
|
|
AddHash(number);
|
|
|
|
if (m_Header == 0)
|
|
{
|
|
m_Header = number;
|
|
m_HeaderArgs = "";
|
|
}
|
|
|
|
m_Stream.Write(number);
|
|
m_Stream.Write((short)0);
|
|
}
|
|
|
|
public void Terminate()
|
|
{
|
|
m_Stream.Write(0);
|
|
|
|
m_Stream.Seek(11, SeekOrigin.Begin);
|
|
m_Stream.Write(m_Hash);
|
|
}
|
|
|
|
private static byte[] m_Buffer = new byte[1024];
|
|
private static readonly Encoding m_Encoding = Encoding.Unicode;
|
|
|
|
public void AddHash(int val)
|
|
{
|
|
m_Hash ^= (val & 0x3FFFFFF);
|
|
m_Hash ^= (val >> 26) & 0x3F;
|
|
}
|
|
|
|
public void Add(int number, string arguments)
|
|
{
|
|
if (number == 0)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (arguments == null)
|
|
{
|
|
arguments = "";
|
|
}
|
|
|
|
if (m_Header == 0)
|
|
{
|
|
m_Header = number;
|
|
m_HeaderArgs = arguments;
|
|
}
|
|
|
|
AddHash(number);
|
|
AddHash(arguments.GetHashCode());
|
|
|
|
m_Stream.Write(number);
|
|
|
|
int byteCount = m_Encoding.GetByteCount(arguments);
|
|
|
|
if (byteCount > m_Buffer.Length)
|
|
{
|
|
m_Buffer = new byte[byteCount];
|
|
}
|
|
|
|
byteCount = m_Encoding.GetBytes(arguments, 0, arguments.Length, m_Buffer, 0);
|
|
|
|
m_Stream.Write((short)byteCount);
|
|
m_Stream.Write(m_Buffer, 0, byteCount);
|
|
}
|
|
|
|
public void Add(int number, string format, object arg0)
|
|
{
|
|
Add(number, String.Format(format, arg0));
|
|
}
|
|
|
|
public void Add(int number, string format, object arg0, object arg1)
|
|
{
|
|
Add(number, String.Format(format, arg0, arg1));
|
|
}
|
|
|
|
public void Add(int number, string format, object arg0, object arg1, object arg2)
|
|
{
|
|
Add(number, String.Format(format, arg0, arg1, arg2));
|
|
}
|
|
|
|
public void Add(int number, string format, params object[] args)
|
|
{
|
|
Add(number, String.Format(format, args));
|
|
}
|
|
|
|
// Each of these are localized to "~1_NOTHING~" which allows the string argument to be used
|
|
private static readonly int[] m_StringNumbers = new[] {1042971, 1070722};
|
|
|
|
private int GetStringNumber()
|
|
{
|
|
return m_StringNumbers[m_Strings++ % m_StringNumbers.Length];
|
|
}
|
|
|
|
public void Add(string text)
|
|
{
|
|
Add(GetStringNumber(), text);
|
|
}
|
|
|
|
public void Add(string format, string arg0)
|
|
{
|
|
Add(GetStringNumber(), String.Format(format, arg0));
|
|
}
|
|
|
|
public void Add(string format, string arg0, string arg1)
|
|
{
|
|
Add(GetStringNumber(), String.Format(format, arg0, arg1));
|
|
}
|
|
|
|
public void Add(string format, string arg0, string arg1, string arg2)
|
|
{
|
|
Add(GetStringNumber(), String.Format(format, arg0, arg1, arg2));
|
|
}
|
|
|
|
public void Add(string format, params object[] args)
|
|
{
|
|
Add(GetStringNumber(), String.Format(format, args));
|
|
}
|
|
}
|
|
|
|
public sealed class OPLInfo : Packet
|
|
{
|
|
/*public OPLInfo( ObjectPropertyList list ) : base( 0xBF )
|
|
{
|
|
EnsureCapacity( 13 );
|
|
|
|
m_Stream.Write( (short) 0x10 );
|
|
m_Stream.Write( (int) list.Entity.Serial );
|
|
m_Stream.Write( (int) list.Hash );
|
|
}*/
|
|
|
|
public OPLInfo(ObjectPropertyList list)
|
|
: base(0xDC, 9)
|
|
{
|
|
m_Stream.Write(list.Entity.Serial);
|
|
m_Stream.Write(list.Hash);
|
|
}
|
|
}
|
|
} |