Esempio n. 1
0
 /// <summary>
 ///
 /// </summary>
 internal GuildBank(Guild guild, bool isNew)
 {
     Guild   = guild;
     BankLog = new GuildBankLog(this);
     if (isNew)
     {
         bankTabs = new [] {
             new GuildBankTab(this)
             {
                 BankSlot = 0,
                 Icon     = "",
                 Name     = "Slot 0",
                 Text     = ""
             }
         };
     }
     else
     {
         // load an existing guild bank
         bankTabs = GuildBankTab.FindAllByProperty("_guildId", (int)guild.Id);
         BankLog.LoadLogs();
     }
 }
Esempio n. 2
0
		/// <summary>
		/// 
		/// </summary>
		internal GuildBank(Guild guild, bool isNew)
		{
			Guild = guild;
			BankLog = new GuildBankLog(this);
			if (isNew)
			{
				bankTabs = new [] {
					new GuildBankTab(this)
					{
						BankSlot = 0,
						Icon = "",
						Name = "Slot 0",
						Text = ""
					}
				};
			}
			else
			{
				// load an existing guild bank
				bankTabs = GuildBankTab.FindAllByProperty("_guildId", (int)guild.Id);
				BankLog.LoadLogs();
			}
		}
Esempio n. 3
0
		/// <summary>
		/// 
		/// </summary>
		internal GuildBank(Guild guild, bool isNew)
		{
			Guild = guild;
			BankLog = new GuildBankLog(this);
			if (isNew)
			{
				bankTabs = new[] {
					new GuildBankTab(this)
					{
						BankSlot = 0,
						Icon = "",
						Name = "Slot 0",
						Text = ""
					}
				};
			}
			else
			{
				// load an existing guild bank
				bankTabs = RealmWorldDBMgr.DatabaseProvider.Query<GuildBankTab>().Where(tab => tab.Guild == guild).ToArray(); //.FindAllByProperty("_guildId", (int)guild.Id); //TODO: Check this gets all guild bank tabs as intended
				BankLog.LoadLogs();
			}
		}
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        internal GuildBank(Guild guild, bool isNew)
        {
            Guild   = guild;
            BankLog = new GuildBankLog(this);
            if (isNew)
            {
                bankTabs = new GuildBankTab[1]
                {
                    new GuildBankTab(this)
                    {
                        BankSlot = 0,
                        Icon     = "",
                        Name     = "Slot 0",
                        Text     = ""
                    }
                };
            }
            else
            {
                bankTabs = ActiveRecordBase <GuildBankTab> .FindAllByProperty("_guildId", (int)guild.Id);

                BankLog.LoadLogs();
            }
        }
Esempio n. 5
0
		public GuildBank()
		{
			BankTabs = new List<GuildBankTab>();
			BankLog = new GuildBankLog();
		}
Esempio n. 6
0
		public static void SendGuildBankLog(Character chr, GuildBankLog log, byte tabId)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_GUILD_BANK_LOG_QUERY))
			{
				var entries = log.GetBankLogEntries(tabId);

				packet.Write(tabId);
				packet.Write((byte)entries.Count);
				foreach (var entry in entries)
				{
					packet.Write((byte)entry.Type);
					packet.Write(entry.Actor.EntityId);
					if (entry.Type == GuildBankLogEntryType.DepositMoney ||
						entry.Type == GuildBankLogEntryType.WithdrawMoney ||
						entry.Type == GuildBankLogEntryType.MoneyUsedForRepairs ||
						entry.Type == GuildBankLogEntryType.Unknown1 ||
						entry.Type == GuildBankLogEntryType.Unknown2)
					{
						packet.Write(entry.Money);
					}
					else
					{
						packet.Write(entry.ItemEntryId);
						packet.Write(entry.ItemStackCount);
						if (entry.Type == GuildBankLogEntryType.MoveItem ||
							entry.Type == GuildBankLogEntryType.MoveItem_2)
						{
							packet.Write((byte)entry.DestinationTabId);
						}
					}
					var time = Utility.GetDateTimeToGameTime(DateTime.Now) -
							   Utility.GetDateTimeToGameTime(entry.TimeStamp);
					packet.Write(time);
				}

				chr.Client.Send(packet);
			}
		}