本文整理汇总了C#中Framework.Network.Packets.PacketWriter.WriteUInt64方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteUInt64方法的具体用法?C# PacketWriter.WriteUInt64怎么用?C# PacketWriter.WriteUInt64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework.Network.Packets.PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteUInt64方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendMessageByType
public static void SendMessageByType(ref WorldClass session, MessageType type, int language, string chatMessage)
{
PacketWriter messageChat = new PacketWriter(LegacyMessage.MessageChat);
ulong guid = session.Character.Guid;
messageChat.WriteUInt8((byte)type);
messageChat.WriteInt32(language);
messageChat.WriteUInt64(guid);
messageChat.WriteUInt32(0);
messageChat.WriteUInt64(guid);
messageChat.WriteUInt32((uint)chatMessage.Length + 1);
messageChat.WriteCString(chatMessage);
messageChat.WriteUInt16(0);
session.Send(ref messageChat);
}
示例2: HandleObjectDestroy
public static PacketWriter HandleObjectDestroy(ref WorldClass session, ulong guid)
{
PacketWriter objectDestroy = new PacketWriter(LegacyMessage.ObjectDestroy);
objectDestroy.WriteUInt64(guid);
objectDestroy.WriteUInt8(0);
return objectDestroy;
}
示例3: HandleObjectDestroy
public static void HandleObjectDestroy(ref WorldClass session)
{
PacketWriter objectDestroy = new PacketWriter(LegacyMessage.ObjectDestroy);
objectDestroy.WriteUInt64(session.Character.Guid);
objectDestroy.WriteUInt8(0);
session.Send(objectDestroy);
}
示例4: HandleChatMessageSay
public static void HandleChatMessageSay(ref PacketReader packet, ref WorldClass session)
{
BitUnpack BitUnpack = new BitUnpack(packet);
int language = packet.ReadInt32();
uint messageLength = BitUnpack.GetBits<uint>(9);
string chatMessage = packet.ReadString(messageLength);
PacketWriter messageChat = new PacketWriter(LegacyMessage.MessageChat);
ulong guid = WorldMgr.Session.Character.Guid;
messageChat.WriteUInt8(1);
messageChat.WriteInt32(language);
messageChat.WriteUInt64(guid);
messageChat.WriteUInt32(0);
messageChat.WriteUInt64(guid);
messageChat.WriteUInt32(messageLength + 1);
messageChat.WriteCString(chatMessage);
messageChat.WriteUInt16(0);
session.Send(messageChat);
}
示例5: HandleLogoutComplete
public static void HandleLogoutComplete(ref PacketReader packet, ref WorldClass session)
{
var pChar = session.Character;
ObjectMgr.SavePositionToDB(pChar);
PacketWriter logoutComplete = new PacketWriter(LegacyMessage.LogoutComplete);
session.Send(ref logoutComplete);
// Destroy object after logout
PacketWriter objectDestroy = new PacketWriter(LegacyMessage.ObjectDestroy);
objectDestroy.WriteUInt64(pChar.Guid);
objectDestroy.WriteUInt8(0);
WorldMgr.SendToAllInMap(pChar.Guid, objectDestroy);
WorldMgr.DeleteSession(pChar.Guid);
}
示例6: SendMessageByType
public static void SendMessageByType(ref WorldClass session, MessageType type, int language, string chatMessage, bool Broadcast = false)
{
PacketWriter messageChat = new PacketWriter(LegacyMessage.MessageChat);
ulong guid = session.Character.Guid;
messageChat.WriteUInt8((byte)type);
messageChat.WriteInt32(language);
messageChat.WriteUInt64(guid);
messageChat.WriteUInt32(0);
messageChat.WriteUInt64(guid);
messageChat.WriteUInt32((uint)chatMessage.Length + 1);
messageChat.WriteCString(chatMessage);
messageChat.WriteUInt16(0);
if (Broadcast)
{
Globals.WorldMgr.SendToInRangeCharacter(session.Character, messageChat);
session.Send(ref messageChat);
}
else
session.Send(ref messageChat);
}
示例7: HandleTalkToGossip
public static void HandleTalkToGossip(ref PacketReader packet, ref WorldClass session)
{
var guid = packet.ReadUInt64();
var gossipData = GossipMgr.GetGossip<Creature>(ObjectGuid.GetGuid(guid));
if (gossipData != null)
{
PacketWriter gossipMessage = new PacketWriter(LegacyMessage.GossipMessage);
gossipMessage.WriteUInt64(guid);
gossipMessage.WriteInt32(gossipData.Id);
gossipMessage.WriteInt32(gossipData.FriendshipFactionID);
gossipMessage.WriteInt32(gossipData.TextID);
gossipMessage.WriteInt32(gossipData.OptionsCount);
gossipMessage.WriteInt32(gossipData.QuestsCount);
session.Send(ref gossipMessage);
}
}
示例8: HandleEquipError
public static void HandleEquipError(ref WorldClass session, InventoryResult msg)
{
PacketWriter inventoryFail = new PacketWriter(JAMCMessage.InventoryChangeFailure);
inventoryFail.WriteUInt8((byte)msg);
if (msg != InventoryResult.EQUIP_ERR_OK)
{
inventoryFail.WriteUInt64(0); // used for item1 guid
inventoryFail.WriteUInt64(0); // used for item2 guid
inventoryFail.WriteUInt8(0); // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2
}
session.Send(ref inventoryFail);
}