當前位置: 首頁>>代碼示例>>C#>>正文


C# GameObject.CanBeUsedBy方法代碼示例

本文整理匯總了C#中WCell.RealmServer.Entities.GameObject.CanBeUsedBy方法的典型用法代碼示例。如果您正苦於以下問題:C# GameObject.CanBeUsedBy方法的具體用法?C# GameObject.CanBeUsedBy怎麽用?C# GameObject.CanBeUsedBy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WCell.RealmServer.Entities.GameObject的用法示例。


在下文中一共展示了GameObject.CanBeUsedBy方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetBankTabContent

        public static void GetBankTabContent(Character chr, GameObject bank, byte tabId)
        {
            if (bank == null) return;
            if (chr.Guild == null || chr.GuildMember == null) return;
            if (!bank.CanBeUsedBy(chr)) return;

            var bankTab = chr.Guild.Bank[tabId];
            if (bankTab == null) return;
            if (!chr.GuildMember.HasBankTabRight(tabId, GuildBankTabPrivileges.ViewTab)) return;


            SendMemberRemainingDailyWithdrawlAllowance(chr, chr.GuildMember.BankMoneyWithdrawlAllowance);

            SendGuildBankTabContents(chr, bank, tabId);
        }
開發者ID:remixod,項目名稱:netServer,代碼行數:15,代碼來源:GuildHandler.cs

示例2: CheckBankObj

        private static bool CheckBankObj(Character chr, GameObject bankObj)
        {
            chr.EnsureContext();
            if (bankObj == null) return false;
            bankObj.EnsureContext();
            if (!bankObj.CanBeUsedBy(chr)) return false;

            return true;
        }
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:9,代碼來源:GuildBank.cs

示例3: SendGuildBankList

        private static void SendGuildBankList(Character chr, GameObject bank, byte tabId, bool hasTabNames, bool hasItemInfo)
        {
            if (bank == null) return;
            if (chr.Guild == null || chr.GuildMember == null) return;
            if (!bank.CanBeUsedBy(chr)) return;

            var guild = chr.Guild;
            var gBank = guild.Bank;

            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_GUILD_BANK_LIST))
            {
                packet.Write(guild.Money);
                packet.Write(tabId);
                packet.Write(chr.GuildMember.Rank.BankTabRights[tabId].WithdrawlAllowance);
                var sendHasTabNames = tabId == 0 ? hasTabNames : false;
                packet.Write(sendHasTabNames);

                if (sendHasTabNames)
                {
                    packet.Write((byte)guild.PurchasedBankTabCount);
                    for (var i = 0; i < guild.PurchasedBankTabCount; ++i)
                    {
                        packet.Write(gBank[i].Name);
                        packet.Write(gBank[i].Icon);
                    }
                }

                if (!hasItemInfo)
                {
                    chr.Client.Send(packet);
                    return;
                }

                var bankTab = gBank[tabId];

                var bankTabItemCount = bankTab.ItemRecords.Where(record => record != null).Count();
                packet.Write((byte)bankTabItemCount);

                foreach (var item in bankTab.ItemRecords.Where(record => record != null))
                {
                    packet.Write((byte)item.Slot);

                    packet.Write(item.EntryId);

                    packet.Write((uint)0);                  // 3.3.0 (0x8000, 0x8020)
                    var randPropId = item.RandomProperty;
                    packet.Write(randPropId);
                    if (randPropId > 0)
                    {
                        packet.Write(item.RandomSuffix);
                    }

                    packet.Write(item.Amount);
                    packet.Write((uint)0);
                    packet.Write((byte)0);

                    if (item.EnchantIds == null)
                    {
                        packet.Write((byte)0);
                        continue;
                    }

                    var pos = packet.Position;
                    var count = 0;
                    for (var i = 0; i < 3; ++i)
                    {
                        if (item.EnchantIds[i] == 0) continue;
                        packet.Write((byte)i);
                        packet.Write(item.EnchantIds[i]);
                        count++;
                    }
                    packet.InsertByteAt((byte)count, pos, true);

                }

                chr.Client.Send(packet);
            }
        }
開發者ID:remixod,項目名稱:netServer,代碼行數:78,代碼來源:GuildHandler.cs


注:本文中的WCell.RealmServer.Entities.GameObject.CanBeUsedBy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。