本文整理汇总了C#中NReader类的典型用法代码示例。如果您正苦于以下问题:C# NReader类的具体用法?C# NReader怎么用?C# NReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NReader类属于命名空间,在下文中一共展示了NReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
protected override void Read(ClientProcessor psr, NReader rdr)
{
Time = rdr.ReadInt32();
BulletId = rdr.ReadByte();
ObjectId = rdr.ReadInt32();
TargetId = rdr.ReadInt32();
}
示例2: Read
protected override void Read(NReader rdr)
{
AccountListId = rdr.ReadInt32();
AccountIds = new int[rdr.ReadInt16()];
for (var i = 0; i < AccountIds.Length; i++)
AccountIds[i] = rdr.ReadInt32();
}
示例3: Read
protected override void Read(NReader rdr)
{
Damage = rdr.ReadInt32();
EnemyId = rdr.ReadInt32();
BulletId = rdr.ReadByte();
ArmorPiercing = rdr.ReadBoolean();
}
示例4: Read
protected override void Read(NReader rdr)
{
Time = rdr.ReadInt32();
Position = Position.Read(rdr);
Obj1 = ObjectSlot.Read(rdr);
Obj2 = ObjectSlot.Read(rdr);
}
示例5: Read
protected override void Read(Client client, NReader rdr)
{
Tier = rdr.ReadInt32();
Goal = rdr.ReadUTF();
Description = rdr.ReadUTF();
Image = rdr.ReadUTF();
}
示例6: Read
protected override void Read(ClientProcessor psr, NReader rdr)
{
Time = rdr.ReadInt32();
Position = Position.Read(rdr);
Obj1 = ObjectSlot.Read(rdr);
Obj2 = ObjectSlot.Read(rdr);
}
示例7: Read
protected override void Read(ClientProcessor psr, NReader rdr)
{
AccountListId = rdr.ReadInt32();
AccountIds = new int[rdr.ReadInt16()];
for (int i = 0; i < AccountIds.Length; i++)
AccountIds[i] = rdr.ReadInt32();
}
示例8: Read
protected override void Read(NReader rdr)
{
Time = rdr.ReadInt32();
BulletId = rdr.ReadByte();
ObjectId = rdr.ReadInt32();
TargetId = rdr.ReadInt32();
}
示例9: Read
protected override void Read(Client psr, NReader rdr)
{
Time = rdr.ReadInt32();
BulletId = rdr.ReadByte();
TargetId = rdr.ReadInt32();
Killed = rdr.ReadBoolean();
}
示例10: Read
protected override void Read(NReader rdr)
{
BulletId = rdr.ReadByte();
OwnerId = rdr.ReadInt32();
ContainerType = rdr.ReadUInt16();
Angle = rdr.ReadSingle();
}
示例11: Convert
public static byte[] Convert(string json)
{
var obj = JsonConvert.DeserializeObject<json_dat>(json);
var dat = ZlibStream.UncompressBuffer(obj.data);
Dictionary<short, TerrainTile> tileDict = new Dictionary<short, TerrainTile>();
for (int i = 0; i < obj.dict.Length; i++)
{
var o = obj.dict[i];
tileDict[(short)i] = new TerrainTile()
{
TileId = o.ground == null ? (short)0xff : XmlDatas.IdToType[o.ground],
TileObj = o.objs == null ? null : o.objs[0].id,
Name = o.objs == null ? "" : o.objs[0].name ?? "",
Terrain = TerrainType.None,
Region = o.regions == null ? TileRegion.None : (TileRegion)Enum.Parse(typeof(TileRegion), o.regions[0].id.Replace(' ', '_'))
};
}
var tiles = new TerrainTile[obj.width, obj.height];
using (NReader rdr = new NReader(new MemoryStream(dat)))
for (int y = 0; y < obj.height; y++)
for (int x = 0; x < obj.width; x++)
{
tiles[x, y] = tileDict[rdr.ReadInt16()];
}
return Export(tiles);
}
示例12: Read
protected override void Read(Client psr, NReader rdr)
{
Time = rdr.ReadInt32();
SlotObject = ObjectSlot.Read(psr, rdr);
ItemUsePos = Position.Read(psr, rdr);
UseType = rdr.ReadByte();
}
示例13: Read
protected override void Read(Client psr, NReader rdr)
{
Time = rdr.ReadInt32();
Position = Position.Read(psr, rdr);
SlotObject1 = ObjectSlot.Read(psr, rdr);
SlotObject2 = ObjectSlot.Read(psr, rdr);
}
示例14: Read
protected override void Read(ClientProcessor psr, NReader rdr)
{
BulletId = rdr.ReadByte();
OwnerId = rdr.ReadInt32();
ContainerType = rdr.ReadInt16();
Angle = rdr.ReadSingle();
}
示例15: ServePolicyFile
private static void ServePolicyFile(IAsyncResult ar)
{
try
{
TcpClient cli = (ar.AsyncState as TcpListener).EndAcceptTcpClient(ar);
(ar.AsyncState as TcpListener).BeginAcceptTcpClient(ServePolicyFile, ar.AsyncState);
NetworkStream s = cli.GetStream();
NReader rdr = new NReader(s);
NWriter wtr = new NWriter(s);
if (rdr.ReadNullTerminatedString() == "<policy-file-request/>")
{
wtr.WriteNullTerminatedString(@"<cross-domain-policy>
<allow-access-from domain=""*"" to-ports=""*"" />
</cross-domain-policy>");
wtr.Write((byte)'\r');
wtr.Write((byte)'\n');
}
cli.Close();
}
catch (ObjectDisposedException) { }
catch (Exception ex)
{
logger.Error(ex);
}
}