本文整理汇总了C#中System.Net.Sockets.NetworkStream.WriteByte方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkStream.WriteByte方法的具体用法?C# NetworkStream.WriteByte怎么用?C# NetworkStream.WriteByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Net.Sockets.NetworkStream
的用法示例。
在下文中一共展示了NetworkStream.WriteByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
StreamHelper.WriteDouble(stream, this.Unknown1);
StreamHelper.WriteDouble(stream, this.Unknown2);
StreamHelper.WriteDouble(stream, this.Unknown3);
StreamHelper.WriteFloat(stream, this.Unknown4);
StreamHelper.WriteInt(stream, Unknown5.Count);
int i = (int)this.Unknown1;
int j = (int)this.Unknown2;
int k = (int)this.Unknown3;
sbyte j1;
for (IEnumerator<ChunkPosition> iter = this.Unknown5.GetEnumerator(); iter.MoveNext(); stream.WriteByte(j1))
{
ChunkPosition chunkpos = iter.Current;
int l = chunkpos.X - i;
int i1 = chunkpos.Y - j;
j1 = (sbyte)(chunkpos.Z - k);
stream.WriteByte((byte)l);
stream.WriteByte((byte)i1);
}
stream.Flush();
}
示例2: Write
public static void Write(ArrayList list, NetworkStream stream)
{
list.ToArray().ToList().ForEach(x =>
{
WatchableObject obj = (WatchableObject)x;
int joined = ((obj.Type << 5) | (obj.Lower & 0x1f)) & 0xff;
stream.WriteByte((byte)joined);
switch (obj.Type)
{
case 0:
stream.WriteByte((byte)obj.Value);
break;
case 1:
StreamHelper.WriteShort(stream, (short)obj.Value);
break;
case 2:
StreamHelper.WriteInt(stream, (int)obj.Value);
break;
case 3:
StreamHelper.WriteFloat(stream, (float)obj.Value);
break;
case 4:
StreamHelper.WriteString(stream, (string)obj.Value);
break;
case 5:
ItemStack stack = (ItemStack)obj.Value;
StreamHelper.WriteShort(stream, (short)stack.ItemID);
stream.WriteByte((byte)stack.StackSize);
StreamHelper.WriteShort(stream, (short)stack.ItemDamage);
break;
}
});
stream.WriteByte(127);
}
示例3: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
stream.WriteByte(this.WindowId);
stream.Flush();
}
示例4: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
stream.WriteByte((OnGround ? (byte)1 : (byte)0));
stream.Flush();
}
示例5: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
StreamHelper.WriteInt(stream, this.EntityID);
stream.WriteByte(this.Unknown);
stream.Flush();
}
示例6: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
StreamHelper.WriteInt(stream, this.X);
StreamHelper.WriteInt(stream, this.Y);
stream.WriteByte((Mode ? (byte)1 : (byte)0));
stream.Flush();
}
示例7: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
StreamHelper.WriteFloat(stream, this.Yaw);
StreamHelper.WriteFloat(stream, this.Pitch);
stream.WriteByte((OnGround ? (byte)1 : (byte)0));
stream.Flush();
}
示例8: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
stream.WriteByte(this.WindowID);
StreamHelper.WriteShort(stream, this.Bar);
StreamHelper.WriteShort(stream, this.Progress);
stream.Flush();
}
示例9: Write
public void Write(ref NetworkStream stream)
{
// write all
stream.Write(BitConverter.GetBytes(this.Year), 0, 2);
stream.WriteByte(this.Month);
stream.WriteByte(this.Day);
stream.WriteByte(this.Hour);
stream.WriteByte(this.Minute);
stream.WriteByte(this.Second);
}
示例10: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
stream.WriteByte(this.WindowID);
StreamHelper.WriteShort(stream, this.Token);
stream.WriteByte((byte)(this.Acknowledged ? 1 : 0));
stream.Flush();
}
示例11: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
StreamHelper.WriteInt(stream, this.EID);
StreamHelper.WriteInt(stream, this.Target);
stream.WriteByte(this.Button);
stream.Flush();
}
示例12: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
StreamHelper.WriteInt(stream, this.Version); //version
StreamHelper.WriteString(stream, this.Username); //username
StreamHelper.WriteString(stream, this.ServerPassword); //server password
StreamHelper.WriteLong(stream, this.MapSeed); //map seed
stream.WriteByte(this.Dimension); //not used
stream.Flush();
}
示例13: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
stream.WriteByte(this.WindowId);
stream.WriteByte((byte)this.WindowType);
StreamHelper.WriteString(stream, this.Title);
stream.WriteByte(this.Slots);
stream.Flush();
}
示例14: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
StreamHelper.WriteInt(stream, this.X);
StreamHelper.WriteShort(stream, this.Y);
StreamHelper.WriteInt(stream, this.Z);
stream.WriteByte((byte)Instrument);
stream.WriteByte(this.Pitch);
stream.Flush();
}
示例15: Write
public void Write(NetworkStream stream)
{
stream.WriteByte((byte)this.Type);
StreamHelper.WriteDouble(stream, this.X);
StreamHelper.WriteDouble(stream, this.Y);
StreamHelper.WriteDouble(stream, this.Stance);
StreamHelper.WriteDouble(stream, this.Z);
stream.WriteByte((OnGround ? (byte)1 : (byte)0));
stream.Flush();
}