本文整理汇总了C#中StreamHandler.WriteUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# StreamHandler.WriteUInt32方法的具体用法?C# StreamHandler.WriteUInt32怎么用?C# StreamHandler.WriteUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamHandler
的用法示例。
在下文中一共展示了StreamHandler.WriteUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
public override void Save(StreamHandler writer)
{
writer.WriteInt32(Items.Length);
foreach (var item in Items)
writer.WriteStruct(item);
writer.WriteUInt32(TotalItemCount);
writer.WriteUInt32(NextSearchDelayMs);
}
示例2: Save
public override void Save(StreamHandler writer)
{
writer.WriteByte((byte)ContainerSlot);
writer.WriteByte((byte)Slot);
writer.WriteByte(CastId);
writer.WriteUInt32(SpellId);
writer.WriteGuid(ItemGuid);
writer.WriteUInt32(GlyphSlot);
writer.WriteByte(UnkFlags);
TargetData.Write(writer);
}
示例3: Save
public override void Save(StreamHandler writer)
{
writer.WriteUInt32((uint)Roles);
writer.WriteUInt16(0);
writer.WriteByte((byte)Dungeons.Length);
foreach (var entry in Dungeons)
writer.WriteUInt32(entry.Entry);
writer.WriteByte(3);
writer.WriteUInt16(0);
writer.WriteByte(0);
writer.WriteCString(Comment);
}
示例4: Write
public void Write(StreamHandler Writer)
{
Writer.WriteUInt32((uint)Flags);
if ((Flags & (
SpellCastTargetFlags.Unit | SpellCastTargetFlags.Unk2 |
SpellCastTargetFlags.Object |
SpellCastTargetFlags.Corpse | SpellCastTargetFlags.PvPCorpse
)) != 0)
Writer.WritePackedGuid(TargetUnit);
if ((Flags & (SpellCastTargetFlags.Item | SpellCastTargetFlags.TradeItem)) != 0)
Writer.WritePackedGuid(TargetItem);
if ((Flags & SpellCastTargetFlags.SourceLocation) != 0)
{
Writer.WritePackedGuid(SourceTransportGuid);
Writer.WriteStruct<Vector3>(SourceLocation);
}
if ((Flags & SpellCastTargetFlags.DestLocation) != 0)
{
Writer.WritePackedGuid(DestTransportGuid);
Writer.WriteStruct<Vector3>(DestLocation);
}
if ((Flags & SpellCastTargetFlags.String) != 0)
Writer.WriteCString(StringTarget);
}
示例5: WriteElement
protected override void WriteElement(StreamHandler writer, RegularMovementPacket.MovementStatusElements element, MovementStatus status, byte[] guid, byte[] tguid)
{
if (element == MovementStatusElements.GenericDword0)
{
writer.FlushUnalignedBits();
writer.WriteUInt32(this.ChangeCounter);
}
else
base.WriteElement(writer, element, status, guid, tguid);
}
示例6: ElementWrite
protected override void ElementWrite(StreamHandler writer, int index)
{
if (index == -2)
{
writer.FlushUnalignedBits();
writer.WriteUInt32(this.NewValue);
}
else
base.ElementWrite(writer, index);
}
示例7: ElementWrite
protected override void ElementWrite(StreamHandler writer, int index)
{
if (index == -1)
{
writer.FlushUnalignedBits();
writer.WriteUInt32(this.ChangeCounter);
}
else
throw new InvalidOperationException("Unknown write element: " + index);
}
示例8: Save
public override void Save(StreamHandler writer)
{
writer.WritePackedGuid(this.Unit);
writer.WriteInt32(ThreatList.Length);
for (int i = 0; i < ThreatList.Length; ++i)
{
writer.WritePackedGuid(ThreatList[i].Unit);
writer.WriteUInt32(ThreatList[i].Threat);
}
}
示例9: ElementWrite
protected override void ElementWrite(StreamHandler writer, int index)
{
if (index == -5)
{
writer.WriteUInt32(this.Unk);
}
else
{
index = -index - 1;
writer.WriteInt32(this.Data[index].Length);
writer.WriteBytes(this.Data[index]);
}
}
示例10: Save
public override void Save(StreamHandler Writer)
{
Writer.WritePackedGuid(Caster);
Writer.WritePackedGuid(CastInvoker);
Writer.WriteByte(CastId);
Writer.WriteUInt32(SpellId);
Writer.WriteUInt32((uint)Flags);
Writer.WriteUInt32(Unk43);
Writer.WriteUInt32(Unk43_2);
TargetData.Write(Writer);
if ((Flags & CastFlags.PredictedPower) != 0)
Writer.WriteUInt32(PredictedPower);
if ((Flags & CastFlags.RuneStates) != 0)
{
Writer.WriteByte((byte)RunesBefore);
Writer.WriteByte((byte)RunesAfter);
for (int i = 0; i < RuneCooldowns.Length; ++i)
Writer.WriteByte((byte)RuneCooldowns[i]);
}
if ((Flags & CastFlags.Ammo) != 0)
{
Writer.WriteUInt32(ProjectileDisplayId);
Writer.WriteUInt32((uint)ProjectileInventoryType);
}
if ((Flags & CastFlags.Unk0x04000000) != 0)
{
Writer.WriteUInt32(Unk0x04000000_UInt32_1);
Writer.WriteUInt32(Unk0x04000000_UInt32_2);
}
}
示例11: Save
public override void Save(StreamHandler Writer)
{
Writer.WriteUInt16((ushort)this.Map);
EnsureRead();
long nUpdatesPos = Writer.BaseStream.Position;
uint nUpdates = 0;
Writer.WriteUInt32(nUpdates);
if (this.DestroyedObjects.Count > 0)
{
++nUpdates;
Writer.WriteByte((byte)UpdateTypes.DestroyObjects);
Writer.WriteInt32(this.DestroyedObjects.Count);
foreach (WowGuid guid in this.DestroyedObjects)
Writer.WritePackedGuid(guid);
}
foreach (var pair in this.ValuesUpdates)
{
++nUpdates;
Writer.WriteByte((byte)UpdateTypes.UpdateValues);
Writer.WritePackedGuid(pair.Key);
WriteValues(Writer, pair.Value, WowObject.GetTypeId(pair.Key.Type));
}
foreach (var pair in this.CreatedObjects)
{
++nUpdates;
var type = UpdateTypes.CreateObjects;
var obj = pair.Value;
if (obj.MovementData.HavePosition)
{
if (obj.TypeId == ObjectTypeId.DynamicObject
|| obj.TypeId == ObjectTypeId.Corpse
|| obj.TypeId == ObjectTypeId.Player)
{
type = UpdateTypes.CreateObjects2;
}
if (obj.TypeId == ObjectTypeId.GameObject && obj is WowGameObject)
{
switch ((obj as WowGameObject).GameObjectType)
{
case GameObjectTypes.Trap:
case GameObjectTypes.DuelArbiter:
case GameObjectTypes.FlagStand:
case GameObjectTypes.FlagDrop:
type = UpdateTypes.CreateObjects2;
break;
}
}
}
var guid = obj.Guid;
Writer.WriteByte((byte)type);
Writer.WritePackedGuid(guid);
Writer.WriteByte((byte)obj.TypeId);
obj.MovementData.Save(Writer);
WriteValues(Writer, obj.GetValues(), obj.TypeId);
}
long pos = Writer.BaseStream.Position;
Writer.BaseStream.Position = nUpdatesPos;
Writer.WriteUInt32(nUpdates);
Writer.BaseStream.Position = pos;
}
示例12: WriteElement
protected virtual void WriteElement(StreamHandler writer, MovementStatusElements element, MovementStatus status, byte[] guid, byte[] tguid)
{
if (element >= MovementStatusElements.GuidByte0 && element <= MovementStatusElements.GuidByte7)
{
WriteByteMask(writer, guid[element - MovementStatusElements.GuidByte0]);
return;
}
if (element >= MovementStatusElements.TransportGuidByte0 &&
element <= MovementStatusElements.TransportGuidByte7)
{
if (status.HaveTransportData)
WriteByteMask(writer, tguid[element - MovementStatusElements.TransportGuidByte0]);
return;
}
if (element >= MovementStatusElements.GuidByte0_2 && element <= MovementStatusElements.GuidByte7_2)
{
WriteByteSeq(writer, guid[element - MovementStatusElements.GuidByte0_2]);
return;
}
if (element >= MovementStatusElements.TransportGuidByte0_2 &&
element <= MovementStatusElements.TransportGuidByte7_2)
{
if (status.HaveTransportData)
WriteByteSeq(writer, tguid[element - MovementStatusElements.TransportGuidByte0_2]);
return;
}
switch (element)
{
case MovementStatusElements.Flags:
writer.UnalignedWriteBit(status.Flags == 0);
break;
case MovementStatusElements.Flags_2:
if (status.Flags != 0)
writer.UnalignedWriteInt((uint)status.Flags, 30);
break;
case MovementStatusElements.Flags2:
writer.UnalignedWriteBit(status.Flags2 == 0);
break;
case MovementStatusElements.Flags2_2:
if (status.Flags2 != 0)
writer.UnalignedWriteInt((ushort)status.Flags2, 12);
break;
case MovementStatusElements.Timestamp:
writer.UnalignedWriteBit(status.TimeStamp == 0);
break;
case MovementStatusElements.Timestamp_2:
if (status.TimeStamp != 0)
writer.WriteUInt32(status.TimeStamp);
break;
case MovementStatusElements.Pitch:
writer.UnalignedWriteBit(!status.HavePitch);
break;
case MovementStatusElements.Pitch_2:
if (status.HavePitch)
writer.WriteSingle(status.Pitch);
break;
case MovementStatusElements.HaveFallData:
writer.UnalignedWriteBit(status.HaveFallData);
break;
case MovementStatusElements.HaveFallDirection:
if (status.HaveFallData)
writer.UnalignedWriteBit(status.HaveFallDirection);
break;
case MovementStatusElements.HaveTransportData:
writer.UnalignedWriteBit(status.HaveTransportData);
break;
case MovementStatusElements.TransportHaveTime2:
if (status.HaveTransportData)
writer.UnalignedWriteBit(status.HaveTransportTime2);
break;
case MovementStatusElements.TransportHaveTime3:
if (status.HaveTransportData)
writer.UnalignedWriteBit(status.HaveTransportTime3);
break;
case MovementStatusElements.HaveSpline:
writer.UnalignedWriteBit(status.HaveSpline);
break;
case MovementStatusElements.HaveSpline2:
writer.UnalignedWriteBit(status.HaveSpline2);
break;
case MovementStatusElements.SplineElev:
writer.UnalignedWriteBit(!status.HaveSplineElevation);
break;
case MovementStatusElements.SplineElev_2:
if (status.HaveSplineElevation)
writer.WriteSingle(status.SplineElevation);
break;
case MovementStatusElements.PositionX:
writer.WriteSingle(status.Position.X);
break;
case MovementStatusElements.PositionY:
writer.WriteSingle(status.Position.Y);
break;
case MovementStatusElements.PositionZ:
writer.WriteSingle(status.Position.Z);
break;
//.........这里部分代码省略.........
示例13: Save
//.........这里部分代码省略.........
.UnalignedWriteBit(this.HaveTransportTime3)
.UnalignedWriteBit(bytes[3] != 0)
.UnalignedWriteBit(bytes[2] != 0)
.UnalignedWriteBit(bytes[6] != 0)
.UnalignedWriteBit(bytes[5] != 0)
.UnalignedWriteBit(bytes[0] != 0)
.UnalignedWriteBit(bytes[4] != 0)
.UnalignedWriteBit(this.HaveTransportTime2)
.UnalignedWriteBit(bytes[7] != 0);
}
}
// TODO: shorts here
if (this.HaveAttackingTarget)
{
fixed (byte* bytes = this.AttackingTarget.Bytes)
{
Writer
.UnalignedWriteBit(bytes[3] != 0)
.UnalignedWriteBit(bytes[4] != 0)
.UnalignedWriteBit(bytes[6] != 0)
.UnalignedWriteBit(bytes[0] != 0)
.UnalignedWriteBit(bytes[1] != 0)
.UnalignedWriteBit(bytes[7] != 0)
.UnalignedWriteBit(bytes[5] != 0)
.UnalignedWriteBit(bytes[2] != 0);
}
}
Writer.FlushUnalignedBits();
foreach (var val in this.UnkUInt32)
Writer.WriteUInt32(val);
if (this.HavePosition)
{
Writer
.WriteSingle(this.Position.Z)
.WriteSingle(this.Orientation)
.WriteSingle(this.Position.X)
.WriteSingle(this.Position.Y);
}
if (this.HaveVehicleData)
{
Writer
.WriteUInt32(this.VehicleId)
.WriteSingle(this.VehicleAimAdjustement);
}
if (this.HaveGameObjectPosition)
{
fixed (byte* bytes = this.TransportGuid.Bytes)
{
Writer
.WriteXorByte(bytes[1])
.WriteXorByte(bytes[4])
.WriteSingle(this.TransportPosition.Z);
if (this.HaveTransportTime3)
Writer.WriteUInt32(this.TransportTime3);
Writer.WriteUInt32(this.TransportTime);
Writer
示例14: WriteValues
private void WriteValues(StreamHandler Writer, UpdateFields values, ObjectTypeId type)
{
uint nValueUpdates = UpdateFields.GetCount(type, values.Last().Key);
byte nBlocks = (byte)((nValueUpdates + 31) / 32);
BitArray mask = new BitArray(nBlocks * 32);
foreach (int key in values.Keys)
mask[key] = true;
// Write block count
Writer.WriteByte(nBlocks);
// Write all blocks
int index = 0;
for (byte i = 0; i < nBlocks; ++i)
{
uint block = 0;
uint bit = 1;
for (int j = 0; j < 32; ++j)
{
if (mask[index])
block |= bit;
++index;
bit <<= 1;
}
Writer.WriteUInt32(block);
}
// Write all values
foreach (uint value in values.Values)
Writer.WriteUInt32(value);
}
示例15: Save
public override void Save(StreamHandler writer)
{
writer.WriteGuid(Entity);
writer.WriteUInt32(Model);
writer.WriteByte((byte)Race);
writer.WriteByte((byte)Gender);
writer.WriteByte((byte)Class);
writer.WriteByte(Skin);
writer.WriteByte(Face);
writer.WriteByte(Hair);
writer.WriteByte(HairColor);
writer.WriteByte(FaceFeatures);
writer.WriteGuid(Guild);
writer.WriteUInt32(Head);
writer.WriteUInt32(Shoulders);
writer.WriteUInt32(Body);
writer.WriteUInt32(Chest);
writer.WriteUInt32(Waist);
writer.WriteUInt32(Legs);
writer.WriteUInt32(Feet);
writer.WriteUInt32(Wrists);
writer.WriteUInt32(Hands);
writer.WriteUInt32(Back);
writer.WriteUInt32(Tabard);
}