本文整理汇总了C#中Packet.PutBit方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.PutBit方法的具体用法?C# Packet.PutBit怎么用?C# Packet.PutBit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.PutBit方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public void Write(Packet packet)
{
packet.Write(VirtualRealmAddress);
packet.Write(VirtualRealms.Count);
packet.Write(TimeRemain);
packet.Write(TimeOptions);
packet.Write(TimeRested);
packet.Write(ActiveExpansionLevel);
packet.Write(AccountExpansionLevel);
packet.Write(TimeSecondsUntilPCKick);
packet.Write(AvailableRaces.Count);
packet.Write(AvailableClasses.Count);
packet.Write(Templates.Count);
packet.Write(CurrencyID);
VirtualRealms.ForEach(vr => vr.Write(packet));
AvailableRaces.ForEach(ar => ar.Write(packet));
AvailableClasses.ForEach(ac => ac.Write(packet));
Templates.ForEach(t => t.Write(packet));
packet.PutBit(IsExpansionTrial);
packet.PutBit(ForceCharacterTemplate);
packet.PutBit(NumPlayersHorde);
packet.PutBit(NumPlayersAlliance);
packet.PutBit(IsVeteranTrial);
packet.FlushBits();
}
示例2: Write
public void Write(Packet packet)
{
packet.Write(Status);
packet.PutBit(InfoProvided);
packet.PutBit(KeyProvided);
packet.PutBit(UrlProvided);
if (UrlProvided)
{
packet.PutBits(Url.Length, 8);
packet.FlushBits();
packet.WriteString(Url);
}
packet.FlushBits();
if (InfoProvided)
{
packet.Write(KeyVersion);
packet.Write(Revision);
}
if (KeyProvided)
packet.WriteBytes(KeyData);
}
示例3: HandleEnumCharactersResult
public static void HandleEnumCharactersResult(RealmSession session)
{
var enumCharactersResult = new Packet(ServerMessages.EnumCharactersResult);
enumCharactersResult.PutBit(1);
enumCharactersResult.PutBit(0);
enumCharactersResult.Flush();
enumCharactersResult.Write(0);
enumCharactersResult.Write(0);
session.Send(enumCharactersResult);
}
示例4: Write
public void Write(Packet packet)
{
packet.PutBit(IsLocal);
packet.PutBits(RealmNameActual.Length, 8);
packet.PutBits(RealmNameNormalized.Length, 8);
packet.FlushBits();
packet.WriteString(RealmNameActual);
packet.WriteString(RealmNameNormalized);
}
示例5: Write
public void Write(Packet packet)
{
packet.Write(MoverGUID);
packet.Write(MoveTime);
packet.Write(Position);
packet.Write(Facing);
packet.Write<float>(0);
packet.Write<float>(0);
packet.Write(0);
packet.Write(0);
packet.PutBits(0, 30);
packet.PutBits(0, 15);
packet.PutBit(false);
packet.PutBit(false);
packet.PutBit(false);
packet.PutBit(false);
packet.PutBit(false);
packet.FlushBits();
}
示例6: Write
public void Write(Packet packet)
{
InventoryItems.Initialize();
packet.Write(Guid);
packet.Write(ListPosition);
packet.Write(RaceID);
packet.Write(ClassID);
packet.Write(SexID);
packet.Write(SkinID);
packet.Write(FaceID);
packet.Write(HairStyle);
packet.Write(HairColor);
packet.Write(FacialHairStyle);
packet.Write(ExperienceLevel);
packet.Write(ZoneID);
packet.Write(MapID);
packet.Write(PreloadPos);
packet.Write(GuildGUID);
packet.Write(Flags);
packet.Write(Flags2);
packet.Write(Flags3);
packet.Write(PetCreatureDisplayID);
packet.Write(PetExperienceLevel);
packet.Write(PetCreatureFamilyID);
foreach (var professionID in ProfessionIDs)
packet.Write(professionID);
foreach (var inventoryItem in InventoryItems)
inventoryItem.Write(packet);
packet.PutBits(Name.Length, 6);
packet.PutBit(FirstLogin);
packet.PutBit(BoostInProgress);
packet.PutBits(0, 5);
packet.FlushBits();
packet.WriteString(Name);
}
示例7: HandleAuthResponse
public static void HandleAuthResponse(AuthResults result, RealmSession session)
{
var authResponse = new Packet(ServerMessages.AuthResponse);
var hasSuccessInfo = result == AuthResults.Ok;
var hasWaitInfo = result == AuthResults.WaitQueue;
authResponse.Write(result);
authResponse.PutBit(hasSuccessInfo);
authResponse.PutBit(hasWaitInfo);
if (hasSuccessInfo)
{
}
if (hasWaitInfo)
{
}
session.Send(authResponse);
}
示例8: Write
public void Write(Packet packet)
{
Status.Write(packet);
packet.Write(WalkSpeed);
packet.Write(RunSpeed);
packet.Write(RunBackSpeed);
packet.Write(SwimSpeed);
packet.Write(SwimBackSpeed);
packet.Write(FlightSpeed);
packet.Write(FlightBackSpeed);
packet.Write(TurnRate);
packet.Write(PitchRate);
packet.Write(0);
packet.PutBit(false);
packet.FlushBits();
}
示例9: HandleEnumCharactersResult
public static void HandleEnumCharactersResult(CharacterSession session)
{
var gameAccount = session.GameAccount;
var charList = DB.Character.Where<Character>(c => c.GameAccountId == gameAccount.Id);
var enumCharactersResult = new Packet(ServerMessage.EnumCharactersResult);
enumCharactersResult.PutBit(1);
enumCharactersResult.PutBit(0);
enumCharactersResult.Flush();
enumCharactersResult.Write(charList.Count);
enumCharactersResult.Write(0);
foreach (var c in charList)
{
var guid = new SmartGuid { Type = GuidType.Player, MapId = (ushort)c.Map, CreationBits = c.Guid };
var guildGuid = new SmartGuid { Type = GuidType.Guild, CreationBits = c.GuildGuid };
enumCharactersResult.Write(guid);
enumCharactersResult.Write(c.ListPosition);
enumCharactersResult.Write(c.Race);
enumCharactersResult.Write(c.Class);
enumCharactersResult.Write(c.Sex);
enumCharactersResult.Write(c.Skin);
enumCharactersResult.Write(c.Face);
enumCharactersResult.Write(c.HairStyle);
enumCharactersResult.Write(c.HairColor);
enumCharactersResult.Write(c.FacialHairStyle);
enumCharactersResult.Write(c.Level);
enumCharactersResult.Write(c.Zone);
enumCharactersResult.Write(c.Map);
enumCharactersResult.Write(c.X);
enumCharactersResult.Write(c.Y);
enumCharactersResult.Write(c.Z);
enumCharactersResult.Write(guildGuid);
enumCharactersResult.Write(c.CharacterFlags);
enumCharactersResult.Write(c.CustomizeFlags);
enumCharactersResult.Write(c.Flags3);
enumCharactersResult.Write(c.PetCreatureDisplayId);
enumCharactersResult.Write(c.PetLevel);
enumCharactersResult.Write(c.PetCreatureFamily);
enumCharactersResult.Write(0);
enumCharactersResult.Write(0);
for (var i = 0; i < 23; i++)
{
enumCharactersResult.Write(0);
enumCharactersResult.Write(0);
enumCharactersResult.Write<byte>(0);
}
enumCharactersResult.PutBits(c.Name.Length, 6);
enumCharactersResult.PutBit(1);
enumCharactersResult.PutBit(0);
enumCharactersResult.Write(c.Name);
}
session.Send(enumCharactersResult);
}
示例10: Write
public void Write(Packet packet)
{
packet.PutBit(NoBirthAnim);
packet.PutBit(false);
packet.PutBit(false);
packet.PutBit(false);
packet.PutBit(Move != null);
packet.PutBit(false);
packet.PutBit(Stationary != null);
packet.PutBit(false);
packet.PutBit(false);
packet.PutBit(false);
packet.PutBit(false);
packet.PutBit(HasRotation);
packet.PutBit(false);
packet.PutBit(false);
packet.PutBit(ThisIsYou);
packet.PutBit(false);
packet.PutBit(false);
packet.PutBit(false);
packet.FlushBits();
packet.Write(0);
if (Move != null)
Move.Write(packet);
if (Stationary != null)
Stationary.Write(packet);
if (HasRotation)
packet.Write(Rotation);
}
示例11: Write
public void Write(Packet packet)
{
packet.Write(WaitCount);
packet.PutBit(HasFCM);
packet.FlushBits();
}
示例12: HandleAuthResponse
public static void HandleAuthResponse(AuthResults result, RealmSession session)
{
var gameAccount = session.GameAccount;
var realm = session.Realm;
var authResponse = new Packet(ServerMessages.AuthResponse);
var hasSuccessInfo = result == AuthResults.Ok;
var hasWaitInfo = result == AuthResults.WaitQueue;
authResponse.Write(result);
authResponse.PutBit(hasSuccessInfo);
authResponse.PutBit(hasWaitInfo);
authResponse.Flush();
if (hasSuccessInfo)
{
var allowedRaces = Manager.GameAccountMgr.GetAvailableRaces(gameAccount, realm);
var allowedClasses = Manager.GameAccountMgr.GetAvailableClasses(gameAccount, realm);
var charTemplates = Manager.GameAccountMgr.GetAvailableCharacterTemplates(gameAccount, realm);
authResponse.Write<uint>(0);
authResponse.Write<uint>(0);
authResponse.Write<uint>(0);
authResponse.Write<uint>(0);
authResponse.Write<uint>(0);
authResponse.Write(gameAccount.BoxLevel);
authResponse.Write(gameAccount.BoxLevel);
authResponse.Write<uint>(0);
authResponse.Write(allowedRaces.Count);
authResponse.Write(allowedClasses.Count);
authResponse.Write(charTemplates.Count);
authResponse.Write<uint>(0);
foreach (var r in allowedRaces)
{
authResponse.Write(r.Key);
authResponse.Write(r.Value);
}
foreach (var c in allowedClasses)
{
authResponse.Write(c.Key);
authResponse.Write(c.Value);
}
foreach (var set in charTemplates)
{
authResponse.Write(set.Id);
authResponse.Write(set.CharacterTemplateClasses.Count);
foreach (var c in set.CharacterTemplateClasses)
{
authResponse.Write((byte)c.ClassId);
authResponse.Write(c.FactionGroup);
}
authResponse.PutBits(set.Name.Length, 7);
authResponse.PutBits(set.Description.Length, 10);
authResponse.Flush();
authResponse.Write(set.Name);
authResponse.Write(set.Description);
}
authResponse.PutBit(0);
authResponse.PutBit(0);
authResponse.PutBit(0);
authResponse.PutBit(0);
authResponse.PutBit(0);
authResponse.Flush();
}
session.Send(authResponse);
}