diff --git a/Scripts/Mobiles/BaseCreature.cs b/Scripts/Mobiles/BaseCreature.cs index fa2214a9f..50e2c3137 100644 --- a/Scripts/Mobiles/BaseCreature.cs +++ b/Scripts/Mobiles/BaseCreature.cs @@ -256,7 +256,7 @@ namespace Server.Mobiles { get { - if (NameMod == null && Name == null) + if (NameMod == null && base.Name == null) return DefaultName; return base.Name; diff --git a/Scripts/Mobiles/Monsters/ML/Twisted Weald/Changeling.cs b/Scripts/Mobiles/Monsters/ML/Twisted Weald/Changeling.cs index 51816b304..594cd6360 100644 --- a/Scripts/Mobiles/Monsters/ML/Twisted Weald/Changeling.cs +++ b/Scripts/Mobiles/Monsters/ML/Twisted Weald/Changeling.cs @@ -195,7 +195,7 @@ namespace Server.Mobiles Body = 264; Hue = ( IsParagon && DefaultHue == 0 ) ? Paragon.Hue : DefaultHue; Female = false; - Name = DefaultName; + Name = null; NameHue = -1; Title = null; Kills = 0; diff --git a/Server/Main.cs b/Server/Main.cs index 87b5fe5b5..16c41186d 100644 --- a/Server/Main.cs +++ b/Server/Main.cs @@ -519,7 +519,7 @@ namespace Server try { - long now, last = TickCount; + long last = TickCount; const int sampleInterval = 100; const float ticksPerSecond = 1000.0f * sampleInterval; @@ -530,24 +530,25 @@ namespace Server { m_Signal.WaitOne(); - Mobile.ProcessDeltaQueue(); - Item.ProcessDeltaQueue(); + Task.WaitAll( + Task.Run(() => Mobile.ProcessDeltaQueue()), + Task.Run(() => Item.ProcessDeltaQueue()), + Task.Run(() => Timer.Slice()), + Task.Run(() => messagePump.Slice()) + ); - Timer.Slice(); - messagePump.Slice(); NetState.FlushAll(); NetState.ProcessDisposedQueue(); - if ( Slice != null ) - Slice(); + Slice?.Invoke(); if (sample++ % sampleInterval != 0) { continue; } - now = TickCount; + long now = TickCount; m_CyclesPerSecond[m_CycleIndex++ % m_CyclesPerSecond.Length] = ticksPerSecond / (now - last); last = now; } diff --git a/Server/Network/PacketHandlers.cs b/Server/Network/PacketHandlers.cs index 90c0c971e..e4a1aa7b6 100644 --- a/Server/Network/PacketHandlers.cs +++ b/Server/Network/PacketHandlers.cs @@ -441,7 +441,7 @@ namespace Server.Network byte layer = pvSrc.ReadByte(); Serial serial = pvSrc.ReadInt32(); int amount = pvSrc.ReadInt16(); - + buyList.Add( new BuyItemResponse( serial, amount ) ); } @@ -2028,11 +2028,11 @@ namespace Server.Network public static PlayCharCallback ThirdPartyAuthCallback = null, ThirdPartyHackedCallback = null; - private static byte[] m_ThirdPartyAuthKey = new byte[] - { - 0x9, 0x11, 0x83, (byte)'+', 0x4, 0x17, 0x83, - 0x5, 0x24, 0x85, - 0x7, 0x17, 0x87, + private static byte[] m_ThirdPartyAuthKey = new byte[] + { + 0x9, 0x11, 0x83, (byte)'+', 0x4, 0x17, 0x83, + 0x5, 0x24, 0x85, + 0x7, 0x17, 0x87, 0x6, 0x19, 0x88, }; @@ -2080,7 +2080,7 @@ namespace Server.Network bool match = true; for ( int i=0; match && i < m_ThirdPartyAuthKey.Length; i++ ) match = match && pvSrc.ReadByte() == m_ThirdPartyAuthKey[i]; - + if ( match ) authOK = true; } @@ -2308,7 +2308,7 @@ namespace Server.Network race = Race.Races[(byte)(genderRace / 2)]; } - if ( race == null ) + if( race == null ) race = Race.DefaultRace; CityInfo[] info = state.CityInfo; @@ -2427,8 +2427,8 @@ namespace Server.Network byte raceID = (byte)(genderRace < 4 ? 0 : ((genderRace / 2) - 1)); race = Race.Races[raceID]; - - if ( race == null ) + + if( race == null ) race = Race.DefaultRace; CityInfo[] info = state.CityInfo; @@ -2518,7 +2518,7 @@ namespace Server.Network private static Dictionary m_AuthIDWindow = new Dictionary( m_AuthIDWindowSize ); private static int GenerateAuthID( NetState state ) - { + { if ( m_AuthIDWindow.Count == m_AuthIDWindowSize ) { int oldestID = 0; DateTime oldest = DateTime.MaxValue; @@ -2532,7 +2532,7 @@ namespace Server.Network m_AuthIDWindow.Remove( oldestID ); } - + int authID; do { @@ -2543,7 +2543,7 @@ namespace Server.Network } while ( m_AuthIDWindow.ContainsKey( authID ) ); m_AuthIDWindow[authID] = new AuthIDPersistence( state.Version ); - + return authID; } @@ -2569,7 +2569,7 @@ namespace Server.Network state.Dispose(); return; } - + if ( state.m_AuthID != 0 && authID != state.m_AuthID ) { Console.WriteLine( "Login: {0}: Invalid client detected, disconnecting", state ); diff --git a/Server/Server.csproj b/Server/Server.csproj index d8b69159e..ed5babfbd 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -42,7 +42,7 @@ true ..\ - TRACE;DEBUG;NEWTIMERS;NEWPARENT + TRACE;DEBUG;NEWTIMERS;NEWPARENT;NewAsyncSockets true full AnyCPU @@ -53,7 +53,7 @@ ..\ - TRACE;NEWTIMERS;NEWPARENT + TRACE;NEWTIMERS;NEWPARENT;NewAsyncSockets true true pdbonly @@ -66,7 +66,7 @@ true ..\ - TRACE;DEBUG;NEWTIMERS, NEWPARENT + TRACE;DEBUG;NEWTIMERS,NEWPARENT;NewAsyncSockets true full x64 @@ -77,7 +77,7 @@ ..\ - TRACE;NEWTIMERS, NEWPARENT + TRACE;NEWTIMERS,NEWPARENT;NewAsyncSockets true true pdbonly