本文整理汇总了C#中RealmPacketIn.ReadByte方法的典型用法代码示例。如果您正苦于以下问题:C# RealmPacketIn.ReadByte方法的具体用法?C# RealmPacketIn.ReadByte怎么用?C# RealmPacketIn.ReadByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RealmPacketIn
的用法示例。
在下文中一共展示了RealmPacketIn.ReadByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleJoin
public static void HandleJoin(IRealmClient client, RealmPacketIn packet)
{
var roles = packet.ReadUInt32();
packet.SkipBytes(2);
var dungeonsCount = packet.ReadByte();
if (dungeonsCount == 0)
return;
for (byte i = 0; i < dungeonsCount; ++i)
{
// dungeons id/type
var packedDungeon = packet.ReadUInt32();
var id = packedDungeon & 0x00FFFFFF;
var type = packedDungeon & 0xFF000000;
}
byte counter2 = packet.ReadByte();
packet.SkipBytes(counter2); // lua: GetLFGInfoLocal
string comment = packet.ReadCString();
//SendLfgJoinResult();
//SendLfgUpdate();
}
示例2: HandleAutoEquip
public static void HandleAutoEquip(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var inv = chr.Inventory;
if (inv.CheckInteract() == InventoryError.OK)
{
var contSlot = (InventorySlot)packet.ReadByte();
var slot = packet.ReadByte();
inv.TryEquip(contSlot, slot);
}
}
示例3: HandleAutostoreBagItem
public static void HandleAutostoreBagItem(IRealmClient client, RealmPacketIn packet)
{
var inv = client.ActiveCharacter.Inventory;
if (inv.CheckInteract() == InventoryError.OK)
{
var srcCont = (InventorySlot)packet.ReadByte();
var srcSlot = packet.ReadByte();
var destCont = (InventorySlot)packet.ReadByte();
inv.TryMove(srcCont, srcSlot, destCont);
}
}
示例4: HandleSendMail
public static void HandleSendMail(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var mailboxId = packet.ReadEntityId();
if (!CheckMailBox(chr, chr.Region.GetObject(mailboxId) as GameObject))
{
return;
}
var recipientName = packet.ReadCString();
var subject = packet.ReadCString();
var msg = packet.ReadCString();
var stationary = (MailStationary)Enum.ToObject(typeof(MailStationary), packet.ReadUInt32());
var unkowwn1 = packet.ReadUInt32(); // 4 unknown bytes
var itemCount = packet.ReadByte();
if (itemCount > MailMgr.MaxStoredItems)
return;
var items = new List<Item>(itemCount);
for (var i = 0; i < itemCount; i++)
{
var slot = packet.ReadByte();
var itemId = packet.ReadEntityId();
var item = chr.Mail.GetItemToMail(itemId);
if (item != null)
{
items.Add(item);
}
else
{
// invalid item
return;
}
}
var money = packet.ReadUInt32();
var cod = packet.ReadUInt32();
var unknown2 = packet.ReadUInt32();
var unknown3 = packet.ReadUInt32();
var unknown4 = packet.ReadByte();
chr.Mail.SendMail(recipientName, subject, msg, stationary, items, money, cod);
}
示例5: HandleDestroyItem
public static void HandleDestroyItem(IRealmClient client, RealmPacketIn packet)
{
var inv = client.ActiveCharacter.Inventory;
if (inv.CheckInteract() == InventoryError.OK)
{
var contSlot = (InventorySlot)packet.ReadByte();
var slot = packet.ReadByte();
var cont = inv.GetContainer(contSlot, inv.IsBankOpen);
if (cont != null && cont.IsValidSlot(slot))
{
cont.TryDestroy(slot);
}
}
}
示例6: HandleCreateTicketPacket
public static void HandleCreateTicketPacket(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
if (chr.Ticket == null)
{
var map = (MapId)packet.ReadUInt32();
var x = packet.ReadFloat();
var y = packet.ReadFloat();
var z = packet.ReadFloat();
var msg = packet.ReadCString();
var type = (TicketType)packet.ReadUInt32(); // prev. unk0
var unk1 = packet.ReadByte(); // unk1, 1
var unk2 = packet.ReadUInt32(); // unk2, 0
var unk3 = packet.ReadUInt32(); // unk3, 0
var ticket = new Ticket(chr, msg, type);
TicketMgr.Instance.AddTicket(ticket);
chr.Ticket = ticket;
SendCreateResponse(client, TicketInfoResponse.Saved);
}
else
{
SendCreateResponse(client, TicketInfoResponse.Fail);
}
}
示例7: HandleAutoDeposit
public static void HandleAutoDeposit(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var inv = chr.Inventory;
if (inv.IsBankOpen)
{
var bagSlot = (InventorySlot)packet.ReadByte();
var slot = packet.ReadByte();
inv.Deposit(bagSlot, slot);
}
else
{
SendBankSlotResult(chr, BuyBankBagResponse.NotABanker);
}
}
示例8: HandleStoreLoot
public static void HandleStoreLoot(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var looter = chr.LooterEntry;
var loot = looter.Loot;
if (loot != null)
{
var itemIndex = packet.ReadByte();
var contSlot = (InventorySlot)packet.ReadByte();
var slot = packet.ReadByte();
loot.TakeItem(looter, itemIndex, chr.Inventory.GetContainer(contSlot, false), slot);
}
}
示例9: 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++;
}
示例10: HandleJoinChannel
public static void HandleJoinChannel(IRealmClient client, RealmPacketIn packet)
{
//int channelNumber = packet.ReadInt32();
uint channelId = packet.ReadUInt32(); // used for lookup in dbc for flags
byte unk = packet.ReadByte(); // Unknown
byte unk2 = packet.ReadByte(); // Unknown
string channelName = packet.ReadCString();
string password = packet.ReadCString();
var group = ChatChannelGroup.GetGroup(client.ActiveCharacter.Faction.Group);
if (group == null)
return;
if (string.IsNullOrEmpty(channelName))
return;
var chan = group.GetChannel(channelName, channelId, true);
chan.TryJoin(client.ActiveCharacter, password, false);
}
示例11: HandleAutoLoot
public static void HandleAutoLoot(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var looter = chr.LooterEntry;
var loot = looter.Loot;
if (loot != null)
{
var itemIndex = packet.ReadByte();
loot.TakeItem(looter, itemIndex, chr.Inventory, BaseInventory.INVALID_SLOT);
}
}
示例12: HandleChangeSeatsOnControlledVehicle
public static void HandleChangeSeatsOnControlledVehicle(IRealmClient client, RealmPacketIn packet)
{
var guid = packet.ReadPackedEntityId();
var oldVehicle = client.ActiveCharacter.Map.GetObject(guid) as Vehicle;
if (oldVehicle == null)
return;
uint clientTime;
MovementHandler.ReadMovementInfo(packet, client.ActiveCharacter, oldVehicle, out clientTime);
var newVehicleGuid = packet.ReadPackedEntityId();
var newVehicle = client.ActiveCharacter.Map.GetObject(newVehicleGuid) as Vehicle;
if (newVehicle == null)
return;
var passenger = client.ActiveCharacter;
var oldSeat = passenger.m_vehicleSeat;
//shouldnt need this, but fall back just in case
if (oldSeat == null)
oldVehicle.FindSeatOccupiedBy(passenger);
//uh oh!
if(oldSeat == null)
return;
var seatId = packet.ReadByte();
var newSeat = newVehicle.Seats[seatId];
//something went wrong
if(newSeat == null)
return;
//cheater?!
if(newSeat.Passenger != null)
return;
oldSeat.ClearSeat();
newSeat.Enter(passenger);
}
示例13: HandleQuestPushResult
public static void HandleQuestPushResult(IRealmClient client, RealmPacketIn packet)
{
var guid = packet.ReadEntityId(); // who to send packet to
var result = packet.ReadByte(); // status
var sharer = client.ActiveCharacter.Map.GetObject(guid) as Character;
if (sharer != null && client.ActiveCharacter.Group != null)
{
if (client.ActiveCharacter.Group == sharer.Group)
{
SendQuestPushResult(client.ActiveCharacter, (QuestPushResponse)result, sharer);
}
}
}
示例14: HandleGroupUninviteByGUID
public static void HandleGroupUninviteByGUID(IRealmClient client, RealmPacketIn packet)
{
var uninviteeId = packet.ReadEntityId();
packet.ReadByte(); // 3.3.3a
var uninviter = client.ActiveCharacter;
var member = uninviter.GroupMember;
if (member == null || !member.IsLeader)
{
return;
}
var group = member.Group;
var uninvitee = group[uninviteeId.Low];
if (uninvitee != null)
{
var uninviteeGroup = uninvitee.SubGroup.Group;
if (uninviteeGroup != group)
return;
group.RemoveMember(uninvitee);
}
}
示例15: HandleQuestLogRemoveQuest
public static void HandleQuestLogRemoveQuest(IRealmClient client, RealmPacketIn packet)
{
var slot = packet.ReadByte();
var quest = client.ActiveCharacter.QuestLog.GetQuestBySlot(slot);
if (quest != null)
{
quest.Cancel(false);
}
}