本文整理汇总了C#中BitUnpack.GetGuid方法的典型用法代码示例。如果您正苦于以下问题:C# BitUnpack.GetGuid方法的具体用法?C# BitUnpack.GetGuid怎么用?C# BitUnpack.GetGuid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitUnpack
的用法示例。
在下文中一共展示了BitUnpack.GetGuid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleObjectUpdateFailed
public static void HandleObjectUpdateFailed(ref PacketReader packet, ref WorldClass session)
{
byte[] guidMask = { 6, 1, 7, 5, 0, 4, 2, 3 };
byte[] guidBytes = { 2, 3, 7, 4, 5, 1, 0, 6 };
BitUnpack GuidUnpacker = new BitUnpack(packet);
ulong guid = GuidUnpacker.GetGuid(guidMask, guidBytes);
Log.Message(LogType.DEBUG, "ObjectUpdate failed for object with Guid {0}", guid);
}
示例2: HandleSetSelection
public static void HandleSetSelection(ref PacketReader packet, ref WorldClass session)
{
byte[] guidMask = { 3, 1, 7, 2, 6, 4, 0, 5 };
byte[] guidBytes = { 4, 1, 5, 2, 6, 7, 0, 3 };
BitUnpack GuidUnpacker = new BitUnpack(packet);
ulong fullGuid = GuidUnpacker.GetGuid(guidMask, guidBytes);
ulong guid = ObjectGuid.GetGuid(fullGuid);
var sess = WorldMgr.GetSession(session.Character.Guid);
sess.Character.TargetGuid = fullGuid;
if (guid == 0)
Log.Message(LogType.DEBUG, "Character (Guid: {0}) removed current selection.", session.Character.Guid);
else
Log.Message(LogType.DEBUG, "Character (Guid: {0}) selected a {1} (Guid: {2}, Id: {3}).", session.Character.Guid, ObjectGuid.GetGuidType(fullGuid), guid, ObjectGuid.GetId(fullGuid));
}
示例3: HandlePlayerLogin
public static void HandlePlayerLogin(ref PacketReader packet, ref WorldClass session)
{
byte[] guidMask = { 5, 7, 6, 1, 2, 3, 4, 0 };
byte[] guidBytes = { 6, 4, 3, 5, 0, 2, 7, 1 };
BitUnpack GuidUnpacker = new BitUnpack(packet);
ulong guid = GuidUnpacker.GetGuid(guidMask, guidBytes);
Log.Message(LogType.DEBUG, "Character with Guid: {0}, AccountId: {1} tried to enter the world.", guid, session.Account.Id);
session.Character = new Character(guid);
if (!WorldMgr.AddSession(guid, ref session))
{
Log.Message(LogType.ERROR, "A Character with Guid: {0} is already logged in", guid);
return;
}
WorldMgr.WriteAccountData(AccountDataMasks.CharacterCacheMask, ref session);
MiscHandler.HandleMessageOfTheDay(ref session);
TimeHandler.HandleSendNewTimeSpeed(ref session);
SpecializationHandler.HandleTalentUpdate(ref session);
SpellHandler.HandleSendKnownSpells(ref session);
MiscHandler.HandleUpdateActionButtons(ref session);
if (session.Character.LoginCinematic)
CinematicHandler.HandleStartCinematic(ref session);
ObjectHandler.HandleUpdateObjectCreate(ref session);
}
示例4: HandlePlayerLogin
public static void HandlePlayerLogin(ref PacketReader packet, ref WorldClass session)
{
byte[] guidMask = { 5, 7, 6, 1, 2, 3, 4, 0 };
byte[] guidBytes = { 6, 4, 3, 5, 0, 2, 7, 1 };
BitUnpack GuidUnpacker = new BitUnpack(packet);
ulong guid = GuidUnpacker.GetGuid(guidMask, guidBytes);
Log.Message(LogType.DEBUG, "Character with Guid: {0}, AccountId: {1} tried to enter the world.", guid, session.Account.Id);
session.Character = new Character(guid);
WorldMgr.Sessions.Add(session.Character.Guid, session);
WorldMgr.WriteAccountData(AccountDataMasks.CharacterCacheMask, ref session);
MiscHandler.HandleMessageOfTheDay(ref session);
SpellHandler.HandleSendKnownSpells(ref session);
if (session.Character.LoginCinematic)
CinematicHandler.HandleStartCinematic(ref session);
ObjectHandler.HandleUpdateObject(ref session);
}
示例5: HandlePlayerLogin
public static void HandlePlayerLogin(ref PacketReader packet, ref WorldClass session)
{
byte[] guidMask = { 6, 3, 0, 5, 7, 2, 1, 4 };
byte[] guidBytes = { 1, 0, 3, 2, 4, 7, 5, 6 };
BitUnpack GuidUnpacker = new BitUnpack(packet);
ulong guid = GuidUnpacker.GetGuid(guidMask, guidBytes);
Log.Message(LogType.DEBUG, "Character with Guid: {0}, AccountId: {1} tried to enter the world.", guid, session.Account.Id);
session.Character = new Character(guid, ref session);
WorldMgr.Session = session;
SpellMgr.LoadSpells();
WorldMgr.WriteAccountData(AccountDataMasks.CharacterCacheMask, ref session);
PacketWriter motd = new PacketWriter(LegacyMessage.MessageOfTheDay);
motd.WriteUInt32(3);
motd.WriteCString("Arctium MoP test");
motd.WriteCString("Welcome to our MoP server test.");
motd.WriteCString("Your development team =)");
session.Send(motd);
SpellHandler.SendSendKnownSpells();
UpdateHandler.HandleUpdateObject(ref packet, ref session);
}