本文整理汇总了C#中RealmPacketIn.ReadUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# RealmPacketIn.ReadUInt32方法的具体用法?C# RealmPacketIn.ReadUInt32怎么用?C# RealmPacketIn.ReadUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RealmPacketIn
的用法示例。
在下文中一共展示了RealmPacketIn.ReadUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: HandleGossipSelectOption
public static void HandleGossipSelectOption(IRealmClient client, RealmPacketIn packet)
{
var targetEntityId = packet.ReadEntityId();
var unknown = packet.ReadUInt32(); // usually Zero, sometimes in the thousands for quest givers, Same as the first int sent in SMSG_GOSSIP_MESSAGE
var selectedOption = packet.ReadUInt32();
string extra = string.Empty;
if (packet.Position < packet.Length)
{
extra = packet.ReadCString();
}
var chr = client.ActiveCharacter;
var worldObject = chr.Region.GetObject(targetEntityId);
if (worldObject == null)
return;
var conversation = chr.GossipConversation;
if (conversation == null || conversation.Speaker != worldObject)
return;
conversation.HandleSelectedItem(selectedOption, extra);
}
示例3: 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();
}
示例4: HandleReportLagTicket
public static void HandleReportLagTicket(IRealmClient client, RealmPacketIn packet)
{
var type = (TicketReportLagType)packet.ReadUInt32();
var unk0 = packet.ReadUInt32(); // Seems to be always 0
var posX = packet.ReadFloat();
var posY = packet.ReadFloat();
var posZ = packet.ReadFloat();
}
示例5: HandleQuestPOIQuery
public static void HandleQuestPOIQuery(IRealmClient client, RealmPacketIn packet)
{
uint count = packet.ReadUInt32();
var questIds = new List<uint>();
for (var i = 0; i < count; i++)
questIds.Add(packet.ReadUInt32());
SendQuestPOIResponse(client, count, questIds);
}
示例6: HandleAuctionPlaceBid
public static void HandleAuctionPlaceBid(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var auctioneerId = packet.ReadEntityId();
var auctionId = packet.ReadUInt32();
var bid = packet.ReadUInt32();
var auctioneer = chr.Map.GetObject(auctioneerId) as NPC;
AuctionMgr.Instance.AuctionPlaceBid(chr, auctioneer, auctionId, bid);
}
示例7: HandleAuctionSellItem
public static void HandleAuctionSellItem(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var auctioneerId = packet.ReadEntityId();
var itemId = packet.ReadEntityId();
var bid = packet.ReadUInt32();
var buyout = packet.ReadUInt32();
var time = packet.ReadUInt32();
var auctioneer = chr.Region.GetObject(auctioneerId) as NPC;
AuctionMgr.Instance.AuctionSellItem(chr, auctioneer, itemId, bid, buyout, time);
}
示例8: HandleTaxiActivate
public static void HandleTaxiActivate(IRealmClient client, RealmPacketIn packet)
{
var vendorId = packet.ReadEntityId();
var from = packet.ReadUInt32();
var to = packet.ReadUInt32();
var vendor = client.ActiveCharacter.Region.GetObject(vendorId) as NPC;
var destinations = new PathNode[2];
destinations[0] = TaxiMgr.PathNodesById.Get(from);
destinations[1] = TaxiMgr.PathNodesById.Get(to);
TaxiMgr.TryFly(client.ActiveCharacter, vendor, destinations);
}
示例9: HandleWorldTeleport
public static void HandleWorldTeleport(IRealmClient client, RealmPacketIn packet)
{
uint time = packet.ReadUInt32();
MapId mapId = (MapId)packet.ReadUInt32();
var pos = packet.ReadVector3();
float orientation = packet.ReadFloat(); // in client specified as degrees
var region = World.GetRegion(mapId);
if (region != null)
{
client.ActiveCharacter.TeleportTo(region, ref pos);
}
}
示例10: 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);
}
示例11: HandleTaxiActivateFar
public static void HandleTaxiActivateFar(IRealmClient client, RealmPacketIn packet)
{
var vendorId = packet.ReadEntityId();
//var totalCost = packet.ReadUInt32(); // removed, 3.2.2
var numNodes = packet.ReadUInt32();
var destinations = new PathNode[numNodes];
for (int i = 0; i < numNodes; ++i)
{
destinations[i] = TaxiMgr.PathNodesById.Get(packet.ReadUInt32());
}
var vendor = client.ActiveCharacter.Map.GetObject(vendorId) as NPC;
TaxiMgr.TryFly(client.ActiveCharacter, vendor, destinations);
}
示例12: HandleSendMail
public static void HandleSendMail(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
var mailboxId = packet.ReadEntityId();
if (!CheckMailBox(chr, chr.Map.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.MaxItemsPerMail)
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.MailAccount.GetItemToMail(itemId);
if (item != null)
{
items.Add(item);
}
else
{
// invalid item
return;
}
}
var money = packet.ReadUInt32();
var cod = packet.ReadUInt32();
var unknown2 = packet.ReadUInt64();
var unknown4 = packet.ReadByte();
chr.MailAccount.SendMail(recipientName, subject, msg, stationary, items, money, cod);
}
示例13: HandleRemoveGlyph
public static void HandleRemoveGlyph(IRealmClient client, RealmPacketIn packet)
{
var slot = packet.ReadUInt32();
var chr = client.ActiveCharacter;
chr.RemoveGlyph((byte)slot);
SendTalentGroupList(chr.Talents);
}
示例14: HandleDungeonDifficulty
public static void HandleDungeonDifficulty(IRealmClient client, RealmPacketIn packet)
{
var chr = client.ActiveCharacter;
if (chr.Map.IsInstance)
{
// Cannot change difficulty while in instance
return;
}
var difficultyIndex = packet.ReadUInt32();
var group = chr.Group;
if (group != null)
{
if (group.Leader.Character != chr)
{
// Only leader can change difficulty
return;
}
}
var instances = chr.Instances;
if (instances.TryResetInstances())
{
if (group != null)
{
group.DungeonDifficulty = difficultyIndex;
}
else
{
chr.DungeonDifficulty = (DungeonDifficulty)difficultyIndex;
}
}
}
示例15: HandleAction
public static void HandleAction(IRealmClient client, RealmPacketIn packet)
{
var entityId = packet.ReadEntityId();
var chr = client.ActiveCharacter;
var pet = chr.Map.GetObject(entityId) as NPC;
if (pet != null && pet == chr.ActivePet && pet.IsAlive)
{
var record = pet.PetRecord;
if (record != null)
{
var data = (PetActionEntry)packet.ReadUInt32();
switch (data.Type)
{
case PetActionType.SetMode:
// mode
pet.SetPetAttackMode(data.AttackMode);
break;
case PetActionType.SetAction:
// action
var targetAction = data.Action;
pet.SetPetAction(targetAction);
break;
default:
// spell cast
var target = chr.Map.GetObject(packet.ReadEntityId());
pet.CastPetSpell(data.SpellId, target);
break;
}
}
}
}