Inheritance: IComparable, IComparer
Exemplo n.º 1
0
		public ArtworkSupportAttribute(ClientVersion version, int[] oldItemIDs, int newItemID)
			: this(
				version,
				oldItemIDs != null && oldItemIDs.Length > 0
					? oldItemIDs.Select(id => Pair.Create(id, newItemID)).ToArray()
					: new Pair<int, int>[0])
		{ }
Exemplo n.º 2
0
		public ArtworkInfo(ClientVersion highVersion, ClientVersion lowVersion, int highItemID, int lowItemID)
		{
			HighVersion = highVersion ?? ArtworkSupport.DefaultHighVersion;
			LowVersion = lowVersion ?? ArtworkSupport.DefaultLowVersion;

			HighItemID = highItemID;
			LowItemID = lowItemID;
		}
Exemplo n.º 3
0
		public ExpansionInfo( int id, string name, ClientVersion requiredClient, int supportedFeatures, int charListFlags, int customHousingFlag )
		{
			m_Name = name;
			m_ID = id;
			m_SupportedFeatures = supportedFeatures;
			m_CharListFlags = charListFlags;
			m_CustomHousingFlag = customHousingFlag;
			m_RequiredClient = requiredClient;
		}
Exemplo n.º 4
0
 public ClientSettings(bool autoDetectClient = false, string clientPath = null,
     OldClientResponse oldClientResponse = OldClientResponse.LenientKick,
     ClientVersion requiredVersion = null, bool allowRegular = true, bool allowUOTD = true,
     bool allowGod = true, TimeSpan ageLeniency = TimeSpan.FromDays(10.0),
     TimeSpan gameTimeLeniency = TimeSpan.FromHours(25.0), TimeSpan kickDelay = TimeSpan.FromSeconds(30.0))
 {
     this._AutoDetectClient = autoDetectClient;
     this._ClientPath = clientPath;
     this._OldClientResponse = oldClientResponse;
     this._RequiredVersion = requiredVersion;
     this._AllowRegular = allowRegular;
     this._AllowUOTD = allowUOTD;
     this._AllowGod = allowGod;
     this._AgeLeniency = ageLeniency;
     this._GameTimeLeniency = gameTimeLeniency;
     this._KickDelay = kickDelay;
 }
Exemplo n.º 5
0
		public ClientSettings(
			TimeSpan ageLeniency,
			TimeSpan gameTimeLeniency,
			TimeSpan kickDelay,
			bool autoDetectClient = false,
			string clientPath = null,
			OldClientResponse oldClientResponse = OldClientResponse.LenientKick,
			ClientVersion requiredVersion = null,
			bool allowRegular = true,
			bool allowUOTD = true,
			bool allowGod = true)
		{
			AutoDetectClient = autoDetectClient;
			ClientPath = clientPath;
			OldClientResponse = oldClientResponse;
			RequiredClientVersion = requiredVersion;
			AllowRegular = allowRegular;
			AllowUOTD = allowUOTD;
			AllowGod = allowGod;
			AgeLeniency = ageLeniency;
			GameTimeLeniency = gameTimeLeniency;
			KickDelay = kickDelay;
		}
Exemplo n.º 6
0
		public ArtworkInfo(ClientVersion highVersion, int highItemID, int lowItemID)
			: this(highVersion, ArtworkSupport.DefaultLowVersion, highItemID, lowItemID)
		{ }
Exemplo n.º 7
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			var version = reader.GetVersion();

			switch (version)
			{
				case 0:
				{
					HighVersion = new ClientVersion(reader.ReadString());
					LowVersion = new ClientVersion(reader.ReadString());

					HighItemID = reader.ReadInt();
					LowItemID = reader.ReadInt();
				}
					break;
			}
		}
Exemplo n.º 8
0
		public bool CanSwitch(ClientVersion query)
		{
			return query < HighVersion && query >= LowVersion;
		}
Exemplo n.º 9
0
 public static ClientVersion GetSetting(string key, ClientVersion defaultValue) =>
 m_Settings.Settings.TryGetValue(key, out var value) ? new ClientVersion(value) : defaultValue;
Exemplo n.º 10
0
 public static bool operator <=(ClientVersion l, ClientVersion r)
 {
     return(ClientVersion.Compare(l, r) <= 0);
 }
Exemplo n.º 11
0
		public static void Initialize()
		{
			EventSink.ClientVersionReceived += new ClientVersionReceivedHandler( EventSink_ClientVersionReceived );

			Required = new ClientVersion( "6.0.1" );

			if( m_DetectClientRequirement )
			{
				string path = Core.FindDataFile( "client.exe" );

				if( File.Exists( path ) )
				{
					FileVersionInfo info = FileVersionInfo.GetVersionInfo( path );

					if( info.FileMajorPart != 0 || info.FileMinorPart != 0 || info.FileBuildPart != 0 || info.FilePrivatePart != 0 )
					{
						Required = new ClientVersion( info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart );
					}
				}
			}

			if( Required != null )
			{
				Utility.PushColor( ConsoleColor.DarkRed );
				Console.WriteLine( "Restricting client version to {0} - Action to be taken: {1}", Required, m_OldClientResponse );
				Utility.PopColor();
			}
		}
Exemplo n.º 12
0
        public static void Initialize()
        {
            EventSink.ClientVersionReceived += new ClientVersionReceivedHandler( EventSink_ClientVersionReceived );

            //ClientVersion.Required = null;
            //Required = new ClientVersion( "6.0.0.0" );

            if( m_DetectClientRequirement )
            {
                string path = Core.FindDataFile( "client.exe" );

                if( File.Exists( path ) )
                {
                    FileVersionInfo info = FileVersionInfo.GetVersionInfo( path );

                    if ( info.FileMajorPart != 0 || info.FileMinorPart != 0 || info.FileBuildPart != 0 || info.FilePrivatePart != 0 )
                    {
                        Required = new ClientVersion( info.FileMajorPart, info.FileMinorPart, info.FileBuildPart, info.FilePrivatePart );
                    }
                }
            }

            if( Required != null )
            {
                Utility.PushColor( ConsoleColor.White );
                Console.WriteLine( "Restringindo a versão do cliente para {0}. Ação a ser tomada: {1}", Required, m_OldClientResponse );
                Utility.PopColor();
            }
        }
Exemplo n.º 13
0
 public static void InvokeClientVersionReceived(NetState state, ClientVersion cv) =>
 ClientVersionReceived?.Invoke(state, cv);
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			switch (version)
			{
				case 0:
					int major = reader.ReadInt();
					int minor = reader.ReadInt();
					int revision = reader.ReadInt();
					int patch = reader.ReadInt();
					m_MinVersion = new ClientVersion(major, minor, revision, patch);
					
					major = reader.ReadInt();
					minor = reader.ReadInt();
					revision = reader.ReadInt();
					patch = reader.ReadInt();
					m_MaxVersion = new ClientVersion(major, minor, revision, patch);
					break;
			}
		}
Exemplo n.º 15
0
 public ExpansionInfo(
     int id,
     string name,
     ClientVersion requiredClient,
     FeatureFlags supportedFeatures,
     CharacterListFlags charListFlags,
     HousingFlags customHousingFlag)
     : this(id, name, supportedFeatures, charListFlags, customHousingFlag)
 {
     RequiredClient = requiredClient;
 }
Exemplo n.º 16
0
 public ExpansionInfo(int id, string name, ClientVersion requiredClient, FeatureFlags supportedFeatures, CharacterListFlags charListFlags, int customHousingFlag)
 {
     this.m_Name = name;
     this.m_ID = id;
     this.m_SupportedFeatures = supportedFeatures;
     this.m_CharListFlags = charListFlags;
     this.m_CustomHousingFlag = customHousingFlag;
     this.m_RequiredClient = requiredClient;
 }
Exemplo n.º 17
0
		public override void Deserialize(GenericReader reader)
		{
			int version = reader.ReadInt();

			switch (version)
			{
				case 0:
					{
						AutoDetectClient = reader.ReadBool();
						ClientPath = reader.ReadString();
						OldClientResponse = (OldClientResponse)reader.ReadByte();

						RequiredClientVersion = new ClientVersion(reader.ReadInt(), reader.ReadInt(), reader.ReadInt(), reader.ReadInt());

						AllowRegular = reader.ReadBool();
						AllowUOTD = reader.ReadBool();
						AllowGod = reader.ReadBool();
						AgeLeniency = reader.ReadTimeSpan();
						GameTimeLeniency = reader.ReadTimeSpan();
						KickDelay = reader.ReadTimeSpan();
					}
					break;
			}
		}
Exemplo n.º 18
0
		public ArtworkSupportAttribute(ClientVersion version, int oldItemID, int newItemID)
			: this(version, new[] {Pair.Create(oldItemID, newItemID)})
		{ }
Exemplo n.º 19
0
 public ClientVersionReceivedArgs( GameClient state, ClientVersion cv )
 {
     m_State = state;
     m_Version = cv;
 }
Exemplo n.º 20
0
		public ArtworkInfo(ClientVersion version, int oldItemID, int newItemID)
		{
			Version = version ?? ArtworkSupport.DefaultVersion;
			ItemID = Pair.Create(oldItemID, newItemID);
		}
Exemplo n.º 21
0
        public GameClient( NetState state )
        {
            m_NetState = state;

            m_Seeded = false;
            m_Gumps = new List<Gump>();
            m_HuePickers = new HashSet<HuePicker>();
            m_Menus = new HashSet<IMenu>();
            m_Trades = new HashSet<SecureTrade>();

            // Ensure client version is NEVER null.
            m_Version = new ClientVersion( 0, 0, 0, 0, ClientType.Classic );

            m_Running = true;
        }
Exemplo n.º 22
0
		public static int Compare( ClientVersion a, ClientVersion b )
		{
			if ( IsNull( a ) && IsNull( b ) )
				return 0;
			else if ( IsNull( a ) )
				return -1;
			else if ( IsNull( b ) )
				return 1;

			return a.CompareTo( b );
		}
Exemplo n.º 23
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.GetVersion();

			switch(version)
			{
				case 0:
					{
						Version = new ClientVersion(reader.ReadString());

						int left = reader.ReadInt();
						int right = reader.ReadInt();

						ItemID = Pair.Create(left, right);
					}
					break;
			}
		}
Exemplo n.º 24
0
        public sealed override void Deserialize(GenericReader reader)
        {
            int version = reader.ReadInt();

            switch (version)
            {
                case 0:
                    {
                        this._AutoDetectClient = reader.ReadBool();
                        this._ClientPath = reader.ReadString();
                        this._OldClientResponse = (OldClientResponse)reader.ReadByte();

                        this._RequiredVersion = new ClientVersion(reader.ReadInt(), reader.ReadInt(), reader.ReadInt(), reader.ReadInt());

                        this._AllowRegular = reader.ReadBool();
                        this._AllowUOTD = reader.ReadBool();
                        this._AllowGod = reader.ReadBool();
                        this._AgeLeniency = reader.ReadTimeSpan();
                        this._GameTimeLeniency = reader.ReadTimeSpan();
                        this._KickDelay = reader.ReadTimeSpan();
                        break;
                    }
            }
        }
Exemplo n.º 25
0
 public ClientVersionReceivedArgs( NetState state, ClientVersion cv )
 {
     m_State = state;
     m_Version = cv;
 }
Exemplo n.º 26
0
		private ArtworkSupportAttribute(ClientVersion version, Pair<int, int>[] itemIDs)
		{
			Version = version ?? ArtworkSupport.DefaultVersion;
			ItemIDs = itemIDs ?? new Pair<int, int>[0];
		}
Exemplo n.º 27
0
 public ClientVersionReceivedArgs(NetState state, ClientVersion cv)
 {
     m_State   = state;
     m_Version = cv;
 }
Exemplo n.º 28
0
 public AuthIDPersistence( ClientVersion v )
 {
     Age = DateTime.Now;
     Version = v;
 }