mono fixes, tweaking service mode

This commit is contained in:
mark 2009-08-07 07:07:15 +00:00
parent 59a86c7a7d
commit 0f73c81a6a
6 changed files with 53 additions and 32 deletions

View file

@ -2535,12 +2535,14 @@ namespace Server.Commands
*/
public static bool DontLink( Type type )
{
// MONO: type.Namespace is null/empty for generic arguments
if ( type.Name == "T" || String.IsNullOrEmpty( type.Namespace ) || m_Namespaces == null )
return true;
if( type.Namespace.StartsWith( "Server" ) )
return false;
if( m_Namespaces == null )
return false; //sanity
return !m_Namespaces.ContainsKey( type.Namespace );
}
}

View file

@ -45,7 +45,7 @@ namespace Server.Misc
if ( pathTD != null )
Core.DataDirectories.Add( pathTD );
if ( Core.DataDirectories.Count == 0 )
if ( Core.DataDirectories.Count == 0 && !Core.Service )
{
Console.WriteLine( "Enter the Ultima Online directory:" );
Console.Write( "> " );

View file

@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using Server;
using Server.Network;
@ -113,6 +114,23 @@ namespace Server.Misc
private static bool HasPublicIPAddress()
{
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
foreach ( NetworkInterface adapter in adapters ) {
IPInterfaceProperties properties = adapter.GetIPProperties();
foreach ( IPAddressInformation unicast in properties.UnicastAddresses ) {
IPAddress ip = unicast.Address;
if ( !IPAddress.IsLoopback( ip ) && ip.AddressFamily != AddressFamily.InterNetworkV6 && !IsPrivateNetwork( ip ) )
return true;
}
}
return false;
/*
IPHostEntry iphe = Dns.GetHostEntry( Dns.GetHostName() );
IPAddress[] ips = iphe.AddressList;
@ -124,6 +142,7 @@ namespace Server.Misc
}
return false;
*/
}
private static bool IsPrivateNetwork( IPAddress ip )