This commit is contained in:
mark 2008-05-29 03:57:42 +00:00
parent e41632fe95
commit 9c5abc3b0d
48 changed files with 261 additions and 70 deletions

View file

@ -108,7 +108,9 @@ namespace Server.Misc
if( map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
return true; // In felucca, anything goes
if( !from.Player && !(from is BaseCreature && (((BaseCreature)from).Controlled || ((BaseCreature)from).Summoned)) )
BaseCreature bc = from as BaseCreature;
if( !from.Player && !(bc != null && bc.GetMaster() != null && bc.GetMaster().AccessLevel == AccessLevel.Player ) )
{
if( !CheckAggressor( from.Aggressors, target ) && !CheckAggressed( from.Aggressed, target ) && target is PlayerMobile && ((PlayerMobile)target).CheckYoungProtection( from ) )
return false;
@ -273,6 +275,11 @@ namespace Server.Misc
{
BaseCreature bc = (BaseCreature)target;
Mobile master = bc.GetMaster();
if ( master != null && master.AccessLevel > AccessLevel.Player )
return Notoriety.CanBeAttacked;
if( !bc.Summoned && !bc.Controlled && ((PlayerMobile)source).EnemyOfOneType == target.GetType() )
return Notoriety.Enemy;
}

View file

@ -66,8 +66,8 @@ namespace Server.Misc
IPEndPoint ipep = (IPEndPoint)s.LocalEndPoint;
IPAddress localAddress = ipep.Address;
int localPort = ipep.Port;
IPAddress localAddress = ipep.Address;
int localPort = ipep.Port;
if ( IsPrivateNetwork( localAddress ) ) {
ipep = (IPEndPoint)s.RemoteEndPoint;
@ -88,7 +88,7 @@ namespace Server.Misc
if ( !HasPublicIPAddress() ) {
Console.Write( "ServerList: Auto-detecting public IP address..." );
m_PublicAddress = FindPublicAddress();
if ( m_PublicAddress != null )
Console.WriteLine( "done ({0})", m_PublicAddress.ToString() );
else
@ -118,8 +118,10 @@ namespace Server.Misc
IPAddress[] ips = iphe.AddressList;
for ( int i = 0; i < ips.Length; ++i )
if ( !IsPrivateNetwork( ips[i] ) )
{
if ( ips[i].AddressFamily != AddressFamily.InterNetworkV6 && !IsPrivateNetwork( ips[i] ) )
return true;
}
return false;
}
@ -130,6 +132,9 @@ namespace Server.Misc
// 172.16.0.0/12
// 192.168.0.0/16
if ( ip.AddressFamily == AddressFamily.InterNetworkV6 )
return false;
if ( Utility.IPMatch( "192.168.*", ip ) )
return true;
else if ( Utility.IPMatch( "10.*", ip ) )
@ -150,7 +155,7 @@ namespace Server.Misc
Stream s = res.GetResponseStream();
StreamReader sr = new StreamReader( s );
StreamReader sr = new StreamReader( s );
IPAddress ip = IPAddress.Parse( sr.ReadLine() );