From fe4c9e4f73825d2bd9ad2930e5695086256b61aa Mon Sep 17 00:00:00 2001 From: mark Date: Fri, 29 Dec 2006 05:21:07 +0000 Subject: [PATCH] misc fixies --- Scripts/Engines/Chat/ChatUser.cs | 32 +++++++++++++-------------- Scripts/Items/Addons/BaseAddon.cs | 3 ++- Scripts/Items/Addons/BaseAddonDeed.cs | 2 +- Scripts/Multis/HouseFoundation.cs | 5 ++++- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Scripts/Engines/Chat/ChatUser.cs b/Scripts/Engines/Chat/ChatUser.cs index c82863a94..cce68835d 100644 --- a/Scripts/Engines/Chat/ChatUser.cs +++ b/Scripts/Engines/Chat/ChatUser.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server; using Server.Accounting; @@ -11,13 +11,13 @@ namespace Server.Engines.Chat private Channel m_Channel; private bool m_Anonymous; private bool m_IgnorePrivateMessage; - private ArrayList m_Ignored, m_Ignoring; + private List m_Ignored, m_Ignoring; public ChatUser( Mobile m ) { m_Mobile = m; - m_Ignored = new ArrayList(); - m_Ignoring = new ArrayList(); + m_Ignored = new List(); + m_Ignoring = new List(); } public Mobile Mobile @@ -28,7 +28,7 @@ namespace Server.Engines.Chat } } - public ArrayList Ignored + public List Ignored { get { @@ -36,7 +36,7 @@ namespace Server.Engines.Chat } } - public ArrayList Ignoring + public List Ignoring { get { @@ -200,8 +200,8 @@ namespace Server.Engines.Chat } } - private static ArrayList m_Users = new ArrayList(); - private static Hashtable m_Table = new Hashtable(); + private static List m_Users = new List(); + private static Dictionary m_Table = new Dictionary(); public static ChatUser AddChatUser( Mobile from ) { @@ -216,11 +216,11 @@ namespace Server.Engines.Chat Channel.SendChannelsTo( user ); - ArrayList list = Channel.Channels; + List list = Channel.Channels; for ( int i = 0; i < list.Count; ++i ) { - Channel c = (Channel)list[i]; + Channel c = list[i]; if ( c.AddUser( user ) ) break; @@ -238,7 +238,7 @@ namespace Server.Engines.Chat return; for ( int i = 0; i < user.m_Ignoring.Count; ++i ) - ((ChatUser)user.m_Ignoring[i]).RemoveIgnored( user ); + user.m_Ignoring[i].RemoveIgnored( user ); if ( m_Users.Contains( user ) ) { @@ -261,14 +261,16 @@ namespace Server.Engines.Chat public static ChatUser GetChatUser( Mobile from ) { - return (ChatUser)m_Table[from]; + ChatUser c; + m_Table.TryGetValue( from, out c ); + return c; } public static ChatUser GetChatUser( string username ) { for ( int i = 0; i < m_Users.Count; ++i ) { - ChatUser user = (ChatUser)m_Users[i]; + ChatUser user = m_Users[i]; if ( user.Username == username ) return user; @@ -306,15 +308,13 @@ namespace Server.Engines.Chat { for ( int i = 0; i < m_Users.Count; ++i ) { - ChatUser user = (ChatUser)m_Users[i]; + ChatUser user = m_Users[i]; if ( user == initiator ) continue; if ( user.CheckOnline() ) ChatSystem.SendCommandTo( user.m_Mobile, command, param1, param2 ); - else if ( !m_Users.Contains( i ) ) - --i; } } } diff --git a/Scripts/Items/Addons/BaseAddon.cs b/Scripts/Items/Addons/BaseAddon.cs index 0c45004dd..3d9b427f8 100644 --- a/Scripts/Items/Addons/BaseAddon.cs +++ b/Scripts/Items/Addons/BaseAddon.cs @@ -109,7 +109,8 @@ namespace Server.Items public bool CouldFit( IPoint3D p, Map map ) { - return ( CouldFit( p, map, null, null ) == AddonFitResult.Valid ); + BaseHouse h = null; + return ( CouldFit( p, map, null, ref h ) == AddonFitResult.Valid ); } public AddonFitResult CouldFit( IPoint3D p, Map map, Mobile from, ref BaseHouse house ) diff --git a/Scripts/Items/Addons/BaseAddonDeed.cs b/Scripts/Items/Addons/BaseAddonDeed.cs index bc938cbd2..176c13e58 100644 --- a/Scripts/Items/Addons/BaseAddonDeed.cs +++ b/Scripts/Items/Addons/BaseAddonDeed.cs @@ -73,7 +73,7 @@ namespace Server.Items Server.Spells.SpellHelper.GetSurfaceTop( ref p ); - List house; + BaseHouse house = null; AddonFitResult res = addon.CouldFit( p, map, from, ref house ); diff --git a/Scripts/Multis/HouseFoundation.cs b/Scripts/Multis/HouseFoundation.cs index d79a02f46..ff708e663 100644 --- a/Scripts/Multis/HouseFoundation.cs +++ b/Scripts/Multis/HouseFoundation.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.IO; using System.Threading; @@ -2408,8 +2409,10 @@ namespace Server.Multis while( count > 0 ) { + SendQueueEntry sqe = null; + lock ( m_SendQueueSyncRoot ) - SendQueueEntry sqe = m_SendQueue.Dequeue(); + sqe = m_SendQueue.Dequeue(); try {