本文整理汇总了C#中Packet.FlushBits方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.FlushBits方法的具体用法?C# Packet.FlushBits怎么用?C# Packet.FlushBits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.FlushBits方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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();
}
示例3: 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);
}
示例4: WriteReadBitDataTest
public void WriteReadBitDataTest()
{
Packet writePacket = new Packet(packetOpcode);
writePacket.WriteBit(byteValue & 0x1);
writePacket.WriteBit(byteValue & 0x2);
writePacket.WriteBit(byteValue & 0x4);
writePacket.WriteBit(byteValue & 0x8);
writePacket.WriteBit(byteValue & 0x10);
writePacket.WriteBit(byteValue & 0x20);
writePacket.WriteBit(byteValue & 0x40);
writePacket.WriteBit(byteValue & 0x80);
writePacket.WriteBit(true);
writePacket.WriteBit(false);
writePacket.FlushBits();
int bVal = 0;
Packet readPacket = new Packet(writePacket.Data);
for (int i = 0; i < 8; i++)
if (readPacket.ReadBit())
bVal |= 1 << i;
Assert.AreEqual(byteValue, bVal);
Assert.IsTrue(readPacket.ReadBit());
Assert.IsFalse(readPacket.ReadBit());
readPacket.Dispose();
writePacket.Dispose();
}
示例5: 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);
}
示例6: Write
public void Write(Packet packet)
{
packet.Write(TemplateSetID);
packet.Write(Classes.Count);
Classes.ForEach(c => c.Write(packet));
packet.PutBits(Name.Length, 7);
packet.PutBits(Description.Length, 10);
packet.FlushBits();
packet.WriteString(Name);
packet.WriteString(Description);
}
示例7: 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();
}
示例8: 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();
}
示例9: 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);
}
示例10: Write
public void Write(Packet packet)
{
packet.Write(WaitCount);
packet.PutBit(HasFCM);
packet.FlushBits();
}