Skip to content

Commit

Permalink
Add NetClientConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe GOMES PEIXOTO committed Feb 17, 2018
1 parent 3ff5140 commit 6cf80fb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 26 deletions.
13 changes: 13 additions & 0 deletions src/Ether.Network/Client/NetClientConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Ether.Network.Client
{
/// <summary>
/// Provides properties to configure a <see cref="NetClient"/>.
/// </summary>
public sealed class NetClientConfiguration
{
}
}
31 changes: 6 additions & 25 deletions src/Ether.Network/Packets/NetPacketStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,13 @@ private enum PacketStateType
private readonly BinaryReader _memoryReader;
private readonly BinaryWriter _memoryWriter;

/// <summary>
/// Gets the <see cref="NetPacketStream"/> size.
/// </summary>
/// <inheritdoc />
public int Size => (int)this.Length;

/// <summary>
/// Gets the <see cref="NetPacketStream"/> buffer.
/// </summary>
/// <inheritdoc />
public virtual byte[] Buffer => this.GetInternalBuffer();

/// <summary>
/// Gets the current position of the cursor in the packet stream.
/// </summary>
/// <inheritdoc />
public new long Position => base.Position;

/// <summary>
Expand All @@ -54,11 +48,7 @@ public NetPacketStream(byte[] buffer)
this._state = PacketStateType.Read;
}

/// <summary>
/// Reads a T value from the packet.
/// </summary>
/// <typeparam name="T">Type of the value</typeparam>
/// <returns>The value read and converted to the type.</returns>
/// <inheritdoc />
public virtual T Read<T>()
{
if (this._state != PacketStateType.Read)
Expand All @@ -72,12 +62,7 @@ public virtual T Read<T>()
return default(T);
}

/// <summary>
/// Reads an array of T value from the packet.
/// </summary>
/// <typeparam name="T">Value type.</typeparam>
/// <param name="amount">Amount to read.</param>
/// <returns></returns>
/// <inheritdoc />
public virtual T[] Read<T>(int amount)
{
if (this._state != PacketStateType.Read)
Expand All @@ -97,11 +82,7 @@ public virtual T[] Read<T>(int amount)
return array;
}

/// <summary>
/// Writes a T value in the packet.
/// </summary>
/// <typeparam name="T">Value type.</typeparam>
/// <param name="value">Value.</param>
/// <inheritdoc />
public void Write<T>(T value)
{
if (this._state != PacketStateType.Write)
Expand Down
2 changes: 1 addition & 1 deletion src/Ether.Network/Server/NetServerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Ether.Network.Server
{
/// <summary>
/// Provide properties to configuration a <see cref="NetServer{T}"/>.
/// Provide properties to configure a <see cref="NetServer{T}"/>.
/// </summary>
public sealed class NetServerConfiguration
{
Expand Down

0 comments on commit 6cf80fb

Please sign in to comment.