diff --git a/Scripts/Accounting/Account.cs b/Scripts/Accounting/Account.cs index b88733823..ea34bbf11 100644 --- a/Scripts/Accounting/Account.cs +++ b/Scripts/Accounting/Account.cs @@ -853,9 +853,10 @@ namespace Server.Accounting /// True if allowed, false if not. public bool HasAccess( NetState ns ) { - if ( ns == null ) - return false; + return ( ns != null && HasAccess( ns.Address ) ); + } + public bool HasAccess( IPAddress ipAddress ) { AccessLevel level = Misc.AccountHandler.LockdownLevel; if ( level > AccessLevel.Player ) @@ -881,8 +882,6 @@ namespace Server.Accounting return false; } - IPAddress ipAddress = ns.Address; - bool accessAllowed = ( m_IPRestrictions.Length == 0 || IPLimiter.IsExempt( ipAddress ) ); for ( int i = 0; !accessAllowed && i < m_IPRestrictions.Length; ++i ) @@ -897,19 +896,21 @@ namespace Server.Accounting /// NetState instance to record. public void LogAccess( NetState ns ) { - if ( ns == null ) - return; - - IPAddress ipAddress = ns.Address; + if ( ns != null ) { + LogAccess( ns.Address ); + } + } + public void LogAccess( IPAddress ipAddress ) { if ( IPLimiter.IsExempt( ipAddress ) ) return; - if ( m_LoginIPs.Length == 0 ) + if ( m_LoginIPs.Length == 0 ) { if ( AccountHandler.IPTable.ContainsKey( ipAddress ) ) AccountHandler.IPTable[ipAddress]++; else AccountHandler.IPTable[ipAddress] = 1; + } bool contains = false; @@ -935,11 +936,17 @@ namespace Server.Accounting /// True if allowed, false if not. public bool CheckAccess( NetState ns ) { - if ( !HasAccess( ns ) ) - return false; + return ( ns != null && CheckAccess( ns.Address ) ); + } - LogAccess( ns ); - return true; + public bool CheckAccess( IPAddress ipAddress ) { + bool hasAccess = this.HasAccess( ipAddress ); + + if ( hasAccess ) { + LogAccess( ipAddress ); + } + + return hasAccess; } /// diff --git a/Scripts/Misc/ProtocolExtensions.cs b/Scripts/Misc/ProtocolExtensions.cs index dac3cd138..5dbb6bea6 100644 --- a/Scripts/Misc/ProtocolExtensions.cs +++ b/Scripts/Misc/ProtocolExtensions.cs @@ -12,7 +12,7 @@ namespace Server.Misc public static void Initialize() { - PacketHandlers.Register( 0xF0, 0, true, new OnPacketReceive( DecodeBundledPacket ) ); + PacketHandlers.Register( 0xF0, 0, false, new OnPacketReceive( DecodeBundledPacket ) ); Register( 0x00, true, new OnPacketReceive( QueryPartyLocations ) ); } diff --git a/Scripts/Misc/Titles.cs b/Scripts/Misc/Titles.cs index a9325af3b..e52f902a2 100644 --- a/Scripts/Misc/Titles.cs +++ b/Scripts/Misc/Titles.cs @@ -214,23 +214,33 @@ namespace Server.Misc } else if ( showSkillTitle && beheld.Player ) { - Skill highest = GetHighestSkill( beheld );// beheld.Skills.Highest; + string skillTitle = GetSkillTitle( beheld ); - if ( highest != null && highest.BaseFixedPoint >= 300 ) - { - string skillLevel = GetSkillLevel( highest ); - string skillTitle = highest.Info.Title; - - if ( beheld.Female && skillTitle.EndsWith( "man" ) ) - skillTitle = skillTitle.Substring( 0, skillTitle.Length - 3 ) + "woman"; - - title.AppendFormat( ", {0} {1}", skillLevel, skillTitle ); + if ( skillTitle != null ) { + title.Append( ", " ).Append( skillTitle ); } } return title.ToString(); } + public static string GetSkillTitle( Mobile mob ) { + Skill highest = GetHighestSkill( mob );// beheld.Skills.Highest; + + if ( highest != null && highest.BaseFixedPoint >= 300 ) + { + string skillLevel = GetSkillLevel( highest ); + string skillTitle = highest.Info.Title; + + if ( mob.Female && skillTitle.EndsWith( "man" ) ) + skillTitle = skillTitle.Substring( 0, skillTitle.Length - 3 ) + "woman"; + + return String.Concat( skillLevel, " ", skillTitle ); + } + + return null; + } + private static Skill GetHighestSkill( Mobile m ) { Skills skills = m.Skills;