Logging of staff crafting items, Fixes for the OSI client changes The potion stacking stuff BaseWeapon fix, so that damage increase things don't multiply themselves. admin gump fixes for Firewall Various display tweaks for weight SoS no longer spawn in Tokuno Hiryu hues happified to OSI standards staff now see alliance chat correctly Play barkeeper text increased per OSI Various other OSI skill requirement changes Various unimplemented features of the SE moves EventSink for when the client version is received from client. Client validation moved out of the core. Client version validation now has options to ignore/kick/warn/annoy. Automagically tries to detect current client. Reverted the delayeddamagecontext back to OSI standards. Can no longer use bags of sending in jail. MagerySpell implemented. Now only Magery spells have a circle, and various other properties of 'em. TransformationSpellHelper now implemented. Things moved around for this. Spells now need a Timespan for the cast delay, instead of arbitrarily based on Circle. Circle doesn't make sense for non-Magery spells! Alot of the spellweaving spells added to OSI standards.
59 lines
No EOL
1.2 KiB
C#
59 lines
No EOL
1.2 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Net;
|
|
using System.Net.Sockets;
|
|
using Server;
|
|
using Server.Network;
|
|
|
|
namespace Server.Misc
|
|
{
|
|
public class IPLimiter
|
|
{
|
|
public static bool Enabled = true;
|
|
public static bool SocketBlock = true; // true to block at connection, false to block at login request
|
|
|
|
public const int MaxAddresses = 10;
|
|
|
|
public static IPAddress[] Exemptions = new IPAddress[] //For hosting services where there are cases where IPs can be proxied
|
|
{
|
|
//IPAddress.Parse( "127.0.0.1" ),
|
|
};
|
|
|
|
public static bool IsExempt( IPAddress ip )
|
|
{
|
|
for ( int i = 0; i < Exemptions.Length; i++ )
|
|
{
|
|
if ( ip.Equals( Exemptions[i] ) )
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public static bool Verify( IPAddress ourAddress )
|
|
{
|
|
if ( !Enabled || IsExempt( ourAddress ) )
|
|
return true;
|
|
|
|
List<NetState> netStates = NetState.Instances;
|
|
|
|
int count = 0;
|
|
|
|
for ( int i = 0; i < netStates.Count; ++i )
|
|
{
|
|
NetState compState = (NetState)netStates[i];
|
|
|
|
if ( ourAddress.Equals( compState.Address ) )
|
|
{
|
|
++count;
|
|
|
|
if ( count >= MaxAddresses )
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
} |