Example #1
0
		public AllianceInfo(GenericReader reader)
		{
			int version = reader.ReadInt();

			switch (version)
			{
				case 0:
					{
						m_Name = reader.ReadString();
						m_Leader = reader.ReadGuild() as Guild;

						m_Members = reader.ReadStrongGuildList<Guild>();
						m_PendingMembers = reader.ReadStrongGuildList<Guild>();

						break;
					}
			}
		}
Example #2
0
		public AllianceInfo( GenericReader reader )
		{
			int version = reader.ReadInt();

			switch( version )
			{
				case 0:
				{
					m_Name = reader.ReadString();
					m_Leader = reader.ReadGuild() as Guild;

					m_Members = reader.ReadStrongGuildList<Guild>();
					m_PendingMembers = reader.ReadStrongGuildList<Guild>();

					break;
				}
			}
		}
Example #3
0
		public override void Deserialize( GenericReader reader )
		{
			int version = reader.ReadInt();

			switch ( version )
			{
				case 5:
				{
					int count = reader.ReadInt();

					m_PendingWars = new List<WarDeclaration>();
					for( int i = 0; i < count; i++ )
					{
						m_PendingWars.Add( new WarDeclaration( reader ) );
					}

					count = reader.ReadInt();
					m_AcceptedWars = new List<WarDeclaration>();
					for( int i = 0; i < count; i++ )
					{
						m_AcceptedWars.Add( new WarDeclaration( reader ) );
					}

					bool isAllianceLeader = reader.ReadBool();

					if( isAllianceLeader )
						m_AllianceInfo = new AllianceInfo( reader );
					else
						m_AllianceLeader = reader.ReadGuild() as Guild;


					goto case 4;
				}
				case 4:
				{
					m_AllyDeclarations = reader.ReadStrongGuildList<Guild>();
					m_AllyInvitations = reader.ReadStrongGuildList<Guild>();

					goto case 3;
				}
				case 3:
				{
					m_TypeLastChange = reader.ReadDateTime();

					goto case 2;
				}
				case 2:
				{
					m_Type = (GuildType)reader.ReadInt();

					goto case 1;
				}
				case 1:
				{
					m_LastFealty = reader.ReadDateTime();

					goto case 0;
				}
				case 0:
				{
					m_Leader = reader.ReadMobile();

					if( m_Leader is PlayerMobile )
						((PlayerMobile)m_Leader).GuildRank = RankDefinition.Leader;

					m_Name = reader.ReadString();
					m_Abbreviation = reader.ReadString();

					m_Allies = reader.ReadStrongGuildList<Guild>();
					m_Enemies = reader.ReadStrongGuildList<Guild>();
					m_WarDeclarations = reader.ReadStrongGuildList<Guild>();
					m_WarInvitations = reader.ReadStrongGuildList<Guild>();

					m_Members = reader.ReadStrongMobileList();
					m_Candidates = reader.ReadStrongMobileList();
					m_Accepted = reader.ReadStrongMobileList(); 

					m_Guildstone = reader.ReadItem();
					m_Teleporter = reader.ReadItem();

					m_Charter = reader.ReadString();
					m_Website = reader.ReadString();

					break;
				}
			}

			if ( m_AllyDeclarations == null )
				m_AllyDeclarations = new List<Guild>();

			if ( m_AllyInvitations == null )
				m_AllyInvitations = new List<Guild>();


			if ( m_AcceptedWars == null )
				m_AcceptedWars = new List<WarDeclaration>();

			if ( m_PendingWars == null )
				m_PendingWars = new List<WarDeclaration>();


			/*
			if ( ( !NewGuildSystem && m_Guildstone == null )|| m_Members.Count == 0 )
				Disband();
			*/

			Timer.DelayCall( TimeSpan.Zero, new TimerCallback( VerifyGuild_Callback ) );
		}
Example #4
0
		public override void Deserialize(GenericReader reader)
		{
			int version = reader.ReadInt();

			switch (version)
			{
				case 5:
					{
						int count = reader.ReadInt();

						m_PendingWars = new List<WarDeclaration>();
						for (int i = 0; i < count; i++)
						{
							m_PendingWars.Add(new WarDeclaration(reader));
						}

						count = reader.ReadInt();
						m_AcceptedWars = new List<WarDeclaration>();
						for (int i = 0; i < count; i++)
						{
							m_AcceptedWars.Add(new WarDeclaration(reader));
						}

						bool isAllianceLeader = reader.ReadBool();

						if (isAllianceLeader)
						{
							m_AllianceInfo = new AllianceInfo(reader);
						}
						else
						{
							m_AllianceLeader = reader.ReadGuild() as Guild;
						}

						goto case 4;
					}
				case 4:
					{
						m_AllyDeclarations = reader.ReadStrongGuildList<Guild>();
						m_AllyInvitations = reader.ReadStrongGuildList<Guild>();

						goto case 3;
					}
				case 3:
					{
						m_TypeLastChange = reader.ReadDateTime();

						goto case 2;
					}
				case 2:
					{
						m_Type = (GuildType)reader.ReadInt();

						goto case 1;
					}
				case 1:
					{
						m_LastFealty = reader.ReadDateTime();

						goto case 0;
					}
				case 0:
					{
						m_Leader = reader.ReadMobile();

						if (m_Leader is PlayerMobile)
						{
							((PlayerMobile)m_Leader).GuildRank = RankDefinition.Leader;
						}

						m_Name = reader.ReadString();
						m_Abbreviation = reader.ReadString();

						m_Allies = reader.ReadStrongGuildList<Guild>();
						m_Enemies = reader.ReadStrongGuildList<Guild>();
						m_WarDeclarations = reader.ReadStrongGuildList<Guild>();
						m_WarInvitations = reader.ReadStrongGuildList<Guild>();

						m_Members = reader.ReadStrongMobileList();
						m_Candidates = reader.ReadStrongMobileList();
						m_Accepted = reader.ReadStrongMobileList();

						m_Guildstone = reader.ReadItem();
						m_Teleporter = reader.ReadItem();

						m_Charter = reader.ReadString();
						m_Website = reader.ReadString();

						break;
					}
			}

			if (m_AllyDeclarations == null)
			{
				m_AllyDeclarations = new List<Guild>();
			}

			if (m_AllyInvitations == null)
			{
				m_AllyInvitations = new List<Guild>();
			}

			if (m_AcceptedWars == null)
			{
				m_AcceptedWars = new List<WarDeclaration>();
			}

			if (m_PendingWars == null)
			{
				m_PendingWars = new List<WarDeclaration>();
			}

			/*
            if ( ( !NewGuildSystem && m_Guildstone == null )|| m_Members.Count == 0 )
            Disband();
            */

			Timer.DelayCall(TimeSpan.Zero, VerifyGuild_Callback);
		}
Example #5
0
        public override void Deserialize(GenericReader reader)
        {
            int version = reader.ReadInt();

            switch (version)
            {
            case 7:
            case 6:
            case 5:
            {
                int count = reader.ReadInt();

                PendingWars = new List <WarDeclaration>();
                for (int i = 0; i < count; i++)
                {
                    PendingWars.Add(new WarDeclaration(reader));
                }

                count        = reader.ReadInt();
                AcceptedWars = new List <WarDeclaration>();
                for (int i = 0; i < count; i++)
                {
                    AcceptedWars.Add(new WarDeclaration(reader));
                }

                bool isAllianceLeader = reader.ReadBool();

                if (isAllianceLeader)
                {
                    m_AllianceInfo = new AllianceInfo(reader);
                }
                else
                {
                    m_AllianceLeader = reader.ReadGuild() as Guild;
                }

                goto case 4;
            }

            case 4:
            {
                AllyDeclarations = reader.ReadStrongGuildList <Guild>();
                AllyInvitations  = reader.ReadStrongGuildList <Guild>();

                goto case 3;
            }

            case 3:
            {
                m_TypeLastChange = reader.ReadDateTime();

                goto case 2;
            }

            case 2:
            {
                if (version < 6)
                {
                    reader.ReadInt();
                }

                goto case 1;
            }

            case 1:
            {
                LastFealty = reader.ReadDateTime();

                goto case 0;
            }

            case 0:
            {
                m_Leader = reader.ReadMobile();

                if (m_Leader is PlayerMobile)
                {
                    ((PlayerMobile)m_Leader).GuildRank = RankDefinition.Leader;
                }

                m_Name         = reader.ReadString();
                m_Abbreviation = reader.ReadString();

                Allies          = reader.ReadStrongGuildList <Guild>();
                Enemies         = reader.ReadStrongGuildList <Guild>();
                WarDeclarations = reader.ReadStrongGuildList <Guild>();
                WarInvitations  = reader.ReadStrongGuildList <Guild>();

                Members    = reader.ReadStrongMobileList();
                Candidates = reader.ReadStrongMobileList();
                Accepted   = reader.ReadStrongMobileList();

                if (version < 7)
                {
                    reader.ReadItem();
                    reader.ReadItem();
                }

                Charter = reader.ReadString();
                Website = reader.ReadString();

                break;
            }
            }

            if (AllyDeclarations == null)
            {
                AllyDeclarations = new List <Guild>();
            }

            if (AllyInvitations == null)
            {
                AllyInvitations = new List <Guild>();
            }

            if (AcceptedWars == null)
            {
                AcceptedWars = new List <WarDeclaration>();
            }

            if (PendingWars == null)
            {
                PendingWars = new List <WarDeclaration>();
            }

            Timer.DelayCall(TimeSpan.Zero, VerifyGuild_Callback);
        }
Example #6
0
        public override void Deserialize(GenericReader reader)
        {
            int version = reader.ReadInt();

            switch (version)
            {
            case 5:
            case 4:
            {
                m_AllyDeclarations = reader.ReadStrongGuildList <Guild>();
                m_AllyInvitations  = reader.ReadStrongGuildList <Guild>();

                goto case 3;
            }

            case 3:
            {
                m_TypeLastChange = reader.ReadDateTime();

                goto case 2;
            }

            case 2:
            {
                m_Type = (GuildType)reader.ReadInt();

                goto case 1;
            }

            case 1:
            {
                m_LastFealty = reader.ReadDateTime();

                goto case 0;
            }

            case 0:
            {
                m_Leader = reader.ReadMobile();

                if (m_Leader is PlayerMobile)
                {
                    ((PlayerMobile)m_Leader).GuildRank = RankDefinition.Leader;
                }

                m_Name         = reader.ReadString();
                m_Abbreviation = reader.ReadString();

                m_Allies          = reader.ReadStrongGuildList <Guild>();
                m_Enemies         = reader.ReadStrongGuildList <Guild>();
                m_WarDeclarations = reader.ReadStrongGuildList <Guild>();
                m_WarInvitations  = reader.ReadStrongGuildList <Guild>();

                m_Members    = reader.ReadStrongMobileList();
                m_Candidates = reader.ReadStrongMobileList();
                m_Accepted   = reader.ReadStrongMobileList();

                m_Guildstone = reader.ReadItem();
                m_Teleporter = reader.ReadItem();

                m_Charter = reader.ReadString();
                m_Website = reader.ReadString();

                break;
            }
            }

            if (m_AllyDeclarations == null)
            {
                m_AllyDeclarations = new List <Guild>();
            }

            if (m_AllyInvitations == null)
            {
                m_AllyInvitations = new List <Guild>();
            }

            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(VerifyGuild_Callback));
        }
Example #7
0
        public AllianceInfo( GenericReader reader )
        {
            int version = reader.ReadInt();

            switch( version )
            {
                case 0:
                    {
                        m_Name = reader.ReadString();
                        m_Leader = reader.ReadGuild() as Guild;

                        m_Members = reader.ReadStrongGuildList<Guild>();
                        m_PendingMembers = reader.ReadStrongGuildList<Guild>();

                        break;
                    }
            }

            if( !m_Alliances.ContainsKey(m_Name.ToLower()) )
                m_Alliances.Add(m_Name.ToLower(), this);
        }
Example #8
0
 public override void DeserializeRefList(GenericReader reader)
 {
     RefList.AddRange(reader.ReadStrongGuildList());
 }