本文整理汇总了C#中PacketDirection类的典型用法代码示例。如果您正苦于以下问题:C# PacketDirection类的具体用法?C# PacketDirection怎么用?C# PacketDirection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PacketDirection类属于命名空间,在下文中一共展示了PacketDirection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public static void Write(PacketDirection dir, byte[] data)
{
if (Config.PacketLog.Enable)
{
string header = "";
switch (dir)
{
case PacketDirection.ServerToPhoenix:
if (!Config.PacketLog.ServerToPhoenix) return;
header = "Server->Phoenix";
break;
case PacketDirection.PhoenixToServer:
if (!Config.PacketLog.PhoenixToServer) return;
header = "Phoenix->Server";
break;
case PacketDirection.ClientToPhoenix:
if (!Config.PacketLog.ClientToPhoenix) return;
header = "Client->Phoenix";
break;
case PacketDirection.PhoenixToClient:
if (!Config.PacketLog.PhoenixToClient) return;
header = "Phoenix->Client";
break;
}
string packet = BuildString(data).Trim().Replace(Environment.NewLine, "\n").Replace("\n", Environment.NewLine);
Trace.WriteLine(packet, header);
}
}
示例2: Identify
override public IdentificationStatus Identify(int OpCode, int Size, PacketDirection Direction)
{
if((OpCode == OpManager.OpCodeNameToNumber("OP_ZoneEntry")) && (Direction == PacketDirection.ClientToServer))
return IdentificationStatus.Yes;
return IdentificationStatus.No;
}
示例3: PacketAttribute
public PacketAttribute(string name, PacketDirection direction, SessionType sessionType = SessionType.None, bool authRequired = true)
{
Name = name;
Direction = direction;
SessionType = sessionType;
AuthRequired = authRequired;
}
示例4: Packet
public Packet(uint Opcode, PacketDirection Direction, byte[] Data, DateTime Time)
{
this.Opcode = Opcode;
this.Direction = Direction;
this.Data = Data;
this.Time = Time;
}
示例5: PackerHandlerAttribute
public PackerHandlerAttribute(PacketHeader methodId, string name, int size, PacketDirection direction)
{
this.MethodId = (ushort)methodId;
this.Name = name;
this.Size = size;
this.Direction = direction;
}
示例6: ExploreItemPacket
public override void ExploreItemPacket(StreamWriter outputStream, ByteStream buffer, PacketDirection direction)
{
buffer.SkipBytes(4); // Skip type field.
ExploreSubItem(outputStream, ref buffer);
outputStream.WriteLine("");
}
示例7: ExploreItemPacket
public void ExploreItemPacket(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
Buffer.SkipBytes(4); // Skip type field.
ExploreSubItem(OutputStream, ref Buffer);
OutputStream.WriteLine("");
}
示例8: ExploreNPCMoveUpdate
public void ExploreNPCMoveUpdate(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
PositionUpdate PosUpdate;
PosUpdate = Decode_OP_NPCMoveUpdate(Buffer.Buffer);
OutputStream.WriteLine("SpawnID: {0}, X = {1}, Y = {2}, Z = {3}, Heading = {4}", PosUpdate.SpawnID, PosUpdate.p.x, PosUpdate.p.y, PosUpdate.p.z, PosUpdate.p.heading);
}
示例9: ReadPacket
public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction)
{
ProtocolVersion = stream.ReadVarInt();
ServerHostname = stream.ReadString();
ServerPort = stream.ReadUInt16();
NextState = (NetworkMode)stream.ReadVarInt();
return NextState;
}
示例10: WritePacket
public NetworkMode WritePacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction)
{
stream.WriteVarInt(ProtocolVersion);
stream.WriteString(ServerHostname);
stream.WriteUInt16(ServerPort);
stream.WriteVarInt((int)NextState);
return NextState;
}
示例11: TORCapturedPacket
public TORCapturedPacket(int id, TORPacketType type, byte[] data, CaptureSession session, PacketDirection direction)
{
_id = id;
_type = type;
_data = data;
_session = session;
_direction = direction;
}
示例12: IPPacket
public IPPacket(int index,
UInt32 resourceId,
PacketDirection direction,
IPEndPoint localEndpoint,
IPEndPoint remoteEndpoint,
byte[] bytes)
{
Initialize(index, DateTime.Now, resourceId, direction, localEndpoint, remoteEndpoint, bytes);
}
示例13: ExploreCastSpell
public override void ExploreCastSpell(StreamWriter outputStream, ByteStream buffer, PacketDirection direction)
{
UInt32 Slot = buffer.ReadUInt32();
UInt32 SpellID = buffer.ReadUInt32();
outputStream.WriteLine("Casting spell {0} from slot {1}", SpellID, Slot);
outputStream.WriteLine("");
}
示例14: Create
public PacketViewModel Create(PacketDirection packetDirection, byte[] packet)
{
Contract.Requires<ArgumentNullException>(packet != null);
Contract.Requires<ArgumentNullException>(packet.Length >= 16);
Contract.Ensures(Contract.Result<PacketViewModel>() != null);
var packetType = this.packetInspectorService.FindType(packet);
return new PacketViewModel(packetDirection, packet, packetType);
}
示例15: ExploreCastSpell
public void ExploreCastSpell(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
UInt32 Slot = Buffer.ReadUInt32();
UInt32 SpellID = Buffer.ReadUInt32();
OutputStream.WriteLine("Casting spell {0} from slot {1}", SpellID, Slot);
OutputStream.WriteLine("");
}