本文整理汇总了C#中RealmPacketIn.ReadBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# RealmPacketIn.ReadBoolean方法的具体用法?C# RealmPacketIn.ReadBoolean怎么用?C# RealmPacketIn.ReadBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RealmPacketIn
的用法示例。
在下文中一共展示了RealmPacketIn.ReadBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleStopWatchingFaction
public static void HandleStopWatchingFaction(IRealmClient client, RealmPacketIn packet)
{
var reputationIndex = (FactionReputationIndex)packet.ReadInt32();
bool isInactive = packet.ReadBoolean();
client.ActiveCharacter.Reputations.SetInactive(reputationIndex, isInactive);
}
示例2: HandleAddFriend
public static void HandleAddFriend(IRealmClient client, RealmPacketIn packet)
{
Assert.AreEqual(packet.ReadBoolean(), true);
Assert.AreEqual(packet.ReadCString(), "abc");
Assert.AreEqual(packet.ReadUInt32(), (uint)345);
Assert.AreEqual(packet.ReadByte(), 0xFF);
sentPackets++;
}
示例3: HandleTogglePvP
public static void HandleTogglePvP(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
if (packet.ContentLength > 0)
{
var pvpFlagState = packet.ReadBoolean();
chr.SetPvPFlag(pvpFlagState);
return;
}
chr.TogglePvPFlag();
}
示例4: HandleBattlemasterJoin
public static void HandleBattlemasterJoin(IRealmClient client, RealmPacketIn packet)
{
var battlemasterGuid = packet.ReadEntityId();
var bgId = (BattlegroundId)packet.ReadUInt32();
var instanceId = packet.ReadUInt32();
var asGroup = packet.ReadBoolean();
// check to make sure bg id was valid
if (bgId <= BattlegroundId.None || bgId >= BattlegroundId.End)
return;
var chr = client.ActiveCharacter;
BattlegroundMgr.EnqueuePlayers(chr, bgId, instanceId, asGroup);
}
示例5: HandleSetAllowLowLevelRaid1
public static void HandleSetAllowLowLevelRaid1(IRealmClient client, RealmPacketIn packet)
{
Character character = client.ActiveCharacter;
bool allow = packet.ReadBoolean();
character.IsAllowedLowLevelRaid = allow;
}
示例6: GroupPromoteFlagRequest
public static void GroupPromoteFlagRequest(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var member = chr.GroupMember;
if (member == null)
return;
var group = member.Group as RaidGroup;
if (group == null)
return;
byte promotionType = packet.ReadByte();
bool add = packet.ReadBoolean();
EntityId targetGuid = packet.ReadEntityId();
var targetMember = group[targetGuid.Low];
if (group.CheckAction(member, targetMember, targetMember != null ? targetMember.Name : String.Empty, GroupPrivs.Leader) ==
GroupResult.NoError)
{
if (promotionType == 0)
{
// group.SetMainTank(promotedMember, add);
}
else
{
group.MainAssistant = targetMember;
}
group.SendUpdate();
}
}
示例7: ChangeAssistantFlagRequest
public static void ChangeAssistantFlagRequest(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var member = chr.GroupMember;
if (member == null)
return;
var group = member.Group as RaidGroup;
if (group == null)
return;
EntityId targetGuid = packet.ReadEntityId();
var targetMember = group[targetGuid.Low];
if (group.CheckAction(member, targetMember, targetMember != null ? targetMember.Name : String.Empty, GroupPrivs.Leader)
== GroupResult.NoError)
{
bool isSet = packet.ReadBoolean();
targetMember.IsAssistant = isSet;
group.SendUpdate();
}
}
示例8: HandleRepair
public static void HandleRepair(IRealmClient client, RealmPacketIn packet)
{
var armorerId = packet.ReadEntityId();
var itemId = packet.ReadEntityId();
var useGuildFunds = packet.ReadBoolean();
var armorer = client.ActiveCharacter.Region.GetObject(armorerId) as NPC;
ArmorerMgr.RepairItem(client, armorer, itemId, useGuildFunds);
}
示例9: HandleSummonResponse
public static void HandleSummonResponse(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var request = chr.SummonRequest;
if (request != null)
{
if (request.ExpiryTime > DateTime.Now && chr.MayTeleport)
{
var guid = packet.ReadEntityId();
var accept = packet.ReadBoolean();
if (accept)
{
chr.TeleportTo(request.TargetMap, request.TargetPos);
chr.Zone = request.TargetZone;
}
}
chr.CancelSummon(false);
chr.m_summonRequest = null;
}
}
示例10: HandleTeleport
public static void HandleTeleport(IRealmClient client, RealmPacketIn packet)
{
var isTeleportingOut = packet.ReadBoolean();
}
示例11: HandleAuctionListItems
public static void HandleAuctionListItems(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var auctioneerId = packet.ReadEntityId();
var auctioneer = chr.Map.GetObject(auctioneerId) as NPC;
var searcher = new AuctionSearch()
{
StartIndex = packet.ReadUInt32(),
Name = packet.ReadCString(),
LevelRange1 = packet.ReadByte(),
LevelRange2 = packet.ReadByte(),
InventoryType = (InventorySlotType)packet.ReadUInt32(),
ItemClass = (ItemClass)packet.ReadUInt32(),
ItemSubClass = (ItemSubClass)packet.ReadUInt32(),
Quality = packet.ReadInt32(),
IsUsable = packet.ReadBoolean()
};
AuctionMgr.Instance.AuctionListItems(chr, auctioneer, searcher);
}
示例12: HandleStatusUpdate
public static void HandleStatusUpdate(IRealmClient client, RealmPacketIn packet)
{
var voiceEnabled = packet.ReadBoolean();
var micEnabled = packet.ReadBoolean();
}
示例13: HandleGuildBankSwapItems
public static void HandleGuildBankSwapItems(IRealmClient client, RealmPacketIn packet)
{
var bankEntityId = packet.ReadEntityId();
var isBankToBank = packet.ReadBoolean();
var toBankTab = (byte)1;
var toTabSlot = (byte)1;
var isAutoStore = false;
var autoStoreCount = (byte)0;
var bagSlot = (byte)0;
var slot = (byte)0;
var unknown1 = (uint)1;
var fromBankTab = (byte)0;
var fromTabSlot = (byte)0;
var itemEntryId = (uint)0;
var unknown2 = (byte)1;
var isBankToChar = true;
var amount = (byte)0;
if (isBankToBank)
{
toBankTab = packet.ReadByte();
toTabSlot = packet.ReadByte();
unknown1 = packet.ReadUInt32();
fromBankTab = packet.ReadByte();
fromTabSlot = packet.ReadByte();
itemEntryId = packet.ReadUInt32();
unknown2 = packet.ReadByte();
amount = packet.ReadByte();
if (toTabSlot >= GuildMgr.MAX_BANK_TAB_SLOTS) return;
if ((toBankTab == fromBankTab) && (toTabSlot == fromTabSlot)) return;
}
else
{
fromBankTab = packet.ReadByte();
fromTabSlot = packet.ReadByte();
itemEntryId = packet.ReadUInt32();
isAutoStore = packet.ReadBoolean();
autoStoreCount = (byte)0;
if (isAutoStore)
{
autoStoreCount = packet.ReadByte();
packet.SkipBytes(5);
}
else
{
bagSlot = packet.ReadByte();
slot = packet.ReadByte();
}
isBankToChar = packet.ReadBoolean();
amount = packet.ReadByte();
if ((fromTabSlot >= GuildMgr.MAX_BANK_TAB_SLOTS) && fromTabSlot != 0xFF) return;
}
var chr = client.ActiveCharacter;
var bank = chr.Map.GetObject(bankEntityId) as GameObject;
var guild = chr.Guild;
if (isBankToBank)
{
guild.Bank.SwapItemsManualBankToBank(chr, bank, fromBankTab, fromTabSlot, toBankTab,
toTabSlot, itemEntryId, amount);
}
else if (isBankToChar)
{
if (isAutoStore)
{
guild.Bank.SwapItemsAutoStoreBankToChar(chr, bank, fromBankTab, fromTabSlot, itemEntryId,
autoStoreCount);
}
else
{
guild.Bank.SwapItemsManualBankToChar(chr, bank, fromBankTab, fromTabSlot, bagSlot, slot,
itemEntryId, amount);
}
}
else
{
if (isAutoStore)
{
guild.Bank.SwapItemsAutoStoreCharToBank(chr, bank, fromBankTab, bagSlot, slot, itemEntryId, autoStoreCount);
}
else
{
guild.Bank.SwapItemsManualCharToBank(chr, bank, bagSlot, slot, itemEntryId, fromBankTab,
fromTabSlot, amount);
}
}
}
示例14: HandlePort
public static void HandlePort(IRealmClient client, RealmPacketIn packet)
{
// Start 64-bit BGID
var unk1 = packet.ReadInt16();
var bgId = (BattlegroundId)packet.ReadUInt32();
var unk2 = packet.ReadInt16();
// End BGID
var join = packet.ReadBoolean(); // whether to join or cancel
var chr = client.ActiveCharacter;
if (join)
{
var invitation = chr.Battlegrounds.Invitation;
if (invitation != null && invitation.Team.Battleground != null)
{
var bg = invitation.Team.Battleground;
//if (bg.GetTeam(chr).IsFull)
//{
// // already full
// chr.Battlegrounds.Cancel(invitation);
// chr.SendBattlegroundError(BattlegroundJoinError.);
//}
if (bg.Template.Id == bgId)
{
// valid request
bg.TeleportInside(chr);
}
}
}
else
{
chr.Battlegrounds.CancelRelation(bgId);
}
}
示例15: HandleProposalResponse
public static void HandleProposalResponse(IRealmClient client, RealmPacketIn packet)
{
var lfgGroupId = packet.ReadUInt32();
var accept = packet.ReadBoolean();
}