From 83bf81b7eed62d25aad3ff0c29f1e1b098a4a7bb Mon Sep 17 00:00:00 2001 From: Mark Sturgill Date: Tue, 25 Feb 2014 14:00:32 -0700 Subject: [PATCH] synchronize Server/Scripts project properties whitespace/comment changes in Serialization.cs and ScriptCompiler.cs proper dispose pattern for Listener remove IDisposable from FileLogger --- Server/AssemblyInfo.cs | 6 +++--- Server/Main.cs | 2 +- Server/Network/Listener.cs | 18 ++++++++++++++---- Server/ScriptCompiler.cs | 3 +-- Server/Serialization.cs | 1 - Server/Server.csproj | 3 ++- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Server/AssemblyInfo.cs b/Server/AssemblyInfo.cs index d5c2d76c2..5969c278c 100644 --- a/Server/AssemblyInfo.cs +++ b/Server/AssemblyInfo.cs @@ -30,9 +30,9 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("RunUO Server Core")] //Having just RunUO there is reundant, ie, RunUO.exe with the word 'RunUO' under it [assembly: AssemblyDescription("UO Server Software")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("The RunUO Team")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] +[assembly: AssemblyCompany("RunUO")] +[assembly: AssemblyProduct("RunUO")] +[assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/Server/Main.cs b/Server/Main.cs index e90614325..419112a6c 100644 --- a/Server/Main.cs +++ b/Server/Main.cs @@ -735,7 +735,7 @@ namespace Server } } - public class FileLogger : TextWriter, IDisposable + public class FileLogger : TextWriter { private string m_FileName; private bool m_NewLine; diff --git a/Server/Network/Listener.cs b/Server/Network/Listener.cs index 0666ff4c7..fee1b6f29 100644 --- a/Server/Network/Listener.cs +++ b/Server/Network/Listener.cs @@ -267,12 +267,22 @@ namespace Server.Network return array; } - public void Dispose() { - Socket socket = Interlocked.Exchange( ref m_Listener, null ); + public void Dispose(bool disposing) + { + if (disposing) + { + Socket socket = Interlocked.Exchange(ref m_Listener, null); - if ( socket != null ) { - socket.Close(); + if (socket != null) + { + socket.Close(); + } } } + + public void Dispose() { + Dispose(true); + GC.SuppressFinalize(this); + } } } \ No newline at end of file diff --git a/Server/ScriptCompiler.cs b/Server/ScriptCompiler.cs index ea184a411..ec975318f 100644 --- a/Server/ScriptCompiler.cs +++ b/Server/ScriptCompiler.cs @@ -89,12 +89,11 @@ namespace Server AppendCompilerOption( ref sb, "/d:MONO" ); #endif - //These three defines are legacy, ie, depreciated. + //These three defines are deprecated if( Core.Is64Bit ) AppendCompilerOption( ref sb, "/d:x64" ); AppendCompilerOption( ref sb, "/d:Framework_2_0" ); - AppendCompilerOption( ref sb, "/d:Framework_4_0" ); return (sb == null ? null : sb.ToString()); diff --git a/Server/Serialization.cs b/Server/Serialization.cs index 9ec13f114..5d0bf8916 100644 --- a/Server/Serialization.cs +++ b/Server/Serialization.cs @@ -1394,7 +1394,6 @@ namespace Server private static int m_ThreadCount = 0; public static int ThreadCount { get { return m_ThreadCount; } } - private int BufferSize; private long m_LastPos, m_CurPos; diff --git a/Server/Server.csproj b/Server/Server.csproj index 1b4c1e926..6ddcb8dc3 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -8,7 +8,8 @@ false RunUO v4.0 - Client + + 512 publish\ true