Skip to content

Commit

Permalink
updated wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
baetz-daniel committed Aug 1, 2019
1 parent 58dabaf commit 29c3827
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 44 deletions.
1 change: 0 additions & 1 deletion Exomia.Network/Encoding/PayloadEncoding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ private static void Encode(uint* checksum, byte* buffer, byte* data, int size)
/// <param name="checksum"> [in,out] If non-null, the checksum. </param>
/// <param name="dest"> [in,out] If non-null, destination for the. </param>
/// <param name="src"> [in,out] If non-null, source for the. </param>
/// <param name="o2"> The second int. </param>
/// <param name="size"> The size. </param>
private static void Decode(uint* checksum, byte* dest, byte* src, int size)
{
Expand Down
103 changes: 61 additions & 42 deletions Exomia.Network/ServerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,10 @@ private void InvokeClientConnected(T arg0)
/// </summary>
/// <param name="deserialize"> The deserialize handler. </param>
/// <param name="commandIDs"> A variable-length parameters list containing command ids. </param>
/// <exception cref="ArgumentNullException">
/// Thrown when one or more required arguments
/// are null.
/// </exception>
/// <exception cref="ArgumentOutOfRangeException">
/// Thrown when one or more arguments are outside
/// the required range.
/// </exception>
/// <exception cref="ArgumentNullException"> Thrown when one or more required arguments
/// are null. </exception>
/// <exception cref="ArgumentOutOfRangeException"> Thrown when one or more arguments are outside
/// the required range. </exception>
public void AddCommand(DeserializePacketHandler<object> deserialize, params uint[] commandIDs)
{
if (commandIDs == null) { throw new ArgumentNullException(nameof(commandIDs)); }
Expand Down Expand Up @@ -442,10 +438,8 @@ public void AddCommand(DeserializePacketHandler<object> deserialize, params uint
/// <returns>
/// True if at least one command is removed, false otherwise.
/// </returns>
/// <exception cref="ArgumentOutOfRangeException">
/// Thrown when one or more arguments are outside
/// the required range.
/// </exception>
/// <exception cref="ArgumentOutOfRangeException"> Thrown when one or more arguments are outside
/// the required range. </exception>
public bool RemoveCommands(params uint[] commandIDs)
{
bool removed = false;
Expand Down Expand Up @@ -475,18 +469,12 @@ public bool RemoveCommands(params uint[] commandIDs)
/// </summary>
/// <param name="commandID"> Identifier for the command. </param>
/// <param name="callback"> ClientDataReceivedHandler{Socket|Endpoint} </param>
/// <exception cref="ArgumentOutOfRangeException">
/// Thrown when one or more arguments are outside
/// the required range.
/// </exception>
/// <exception cref="ArgumentNullException">
/// Thrown when one or more required arguments
/// are null.
/// </exception>
/// <exception cref="Exception">
/// Thrown when an exception error condition
/// occurs.
/// </exception>
/// <exception cref="ArgumentOutOfRangeException"> Thrown when one or more arguments are outside
/// the required range. </exception>
/// <exception cref="ArgumentNullException"> Thrown when one or more required arguments
/// are null. </exception>
/// <exception cref="Exception"> Thrown when an exception error condition
/// occurs. </exception>
public void AddDataReceivedCallback(uint commandID, ClientDataReceivedHandler<TServerClient> callback)
{
if (commandID > Constants.USER_COMMAND_LIMIT)
Expand Down Expand Up @@ -520,14 +508,10 @@ public void AddDataReceivedCallback(uint commandID, ClientDataReceivedHandler<TS
/// </summary>
/// <param name="commandID"> Identifier for the command. </param>
/// <param name="callback"> ClientDataReceivedHandler{Socket|Endpoint} </param>
/// <exception cref="ArgumentOutOfRangeException">
/// Thrown when one or more arguments are outside
/// the required range.
/// </exception>
/// <exception cref="ArgumentNullException">
/// Thrown when one or more required arguments
/// are null.
/// </exception>
/// <exception cref="ArgumentOutOfRangeException"> Thrown when one or more arguments are outside
/// the required range. </exception>
/// <exception cref="ArgumentNullException"> Thrown when one or more required arguments
/// are null. </exception>
public void RemoveDataReceivedCallback(uint commandID, ClientDataReceivedHandler<TServerClient> callback)
{
if (commandID > Constants.USER_COMMAND_LIMIT)
Expand All @@ -548,6 +532,20 @@ public void RemoveDataReceivedCallback(uint commandID, ClientDataReceivedHandler

#region Send

/// <summary>
/// Sends to.
/// </summary>
/// <param name="arg0"> Socket|Endpoint. </param>
/// <param name="packetID"> Identifier for the packet. </param>
/// <param name="commandID"> Identifier for the command. </param>
/// <param name="responseID"> Identifier for the response. </param>
/// <param name="src"> [in,out] If non-null, source for the. </param>
/// <param name="chunkLength"> Length of the chunk. </param>
/// <param name="chunkOffset"> The chunk offset. </param>
/// <param name="length"> The length. </param>
/// <returns>
/// A SendError.
/// </returns>
private protected abstract unsafe SendError SendTo(T arg0,
int packetID,
uint commandID,
Expand All @@ -557,6 +555,18 @@ private protected abstract unsafe SendError SendTo(T arg0,
int chunkOffset,
int length);

/// <summary>
/// Sends to.
/// </summary>
/// <param name="arg0"> Socket|Endpoint. </param>
/// <param name="commandID"> Identifier for the command. </param>
/// <param name="data"> The data. </param>
/// <param name="offset"> The offset. </param>
/// <param name="length"> The length. </param>
/// <param name="responseID"> Identifier for the response. </param>
/// <returns>
/// A SendError.
/// </returns>
private unsafe SendError SendTo(T arg0,
uint commandID,
byte[] data,
Expand Down Expand Up @@ -598,7 +608,7 @@ private unsafe SendError SendTo(T arg0,
return SendError.Invalid;
}

/// <inheritdoc />
/// <inheritdoc/>
public SendError SendTo(TServerClient client,
uint commandID,
byte[] data,
Expand All @@ -609,7 +619,7 @@ public SendError SendTo(TServerClient client,
return SendTo(client.Arg0, commandID, data, offset, length, responseID);
}

/// <inheritdoc />
/// <inheritdoc/>
public SendError SendTo(TServerClient client,
uint commandID,
ISerializable serializable,
Expand All @@ -619,7 +629,7 @@ public SendError SendTo(TServerClient client,
return SendTo(client.Arg0, commandID, dataB, 0, length, responseID);
}

/// <inheritdoc />
/// <inheritdoc/>
public SendError SendTo<T1>(TServerClient client,
uint commandID,
in T1 data,
Expand All @@ -630,7 +640,7 @@ public SendError SendTo<T1>(TServerClient client,
return SendTo(client.Arg0, commandID, dataB, 0, length, responseID);
}

/// <inheritdoc />
/// <inheritdoc/>
public void SendToAll(uint commandID, byte[] data, int offset, int length)
{
Dictionary<T, TServerClient> clients;
Expand All @@ -654,15 +664,15 @@ public void SendToAll(uint commandID, byte[] data, int offset, int length)
}
}

/// <inheritdoc />
/// <inheritdoc/>
public void SendToAll<T1>(uint commandID, in T1 data)
where T1 : unmanaged
{
byte[] buffer = data.ToBytesUnsafe2(out int length);
SendToAll(commandID, buffer, 0, length);
}

/// <inheritdoc />
/// <inheritdoc/>
public void SendToAll(uint commandID, ISerializable serializable)
{
byte[] buffer = serializable.Serialize(out int length);
Expand All @@ -678,7 +688,7 @@ public void SendToAll(uint commandID, ISerializable serializable)
/// </summary>
private bool _disposed;

/// <inheritdoc />
/// <inheritdoc/>
public void Dispose()
{
Dispose(true);
Expand Down Expand Up @@ -724,6 +734,9 @@ protected virtual void OnDispose(bool disposing) { }
#endregion
}

/// <summary>
/// A big data handler.
/// </summary>
class BigDataHandler
{
/// <summary>
Expand Down Expand Up @@ -809,14 +822,20 @@ internal unsafe byte[] Receive(int key,
/// </summary>
private struct Buffer
{
/// <summary>
/// The data.
/// </summary>
public readonly byte[] Data;
/// <summary>
/// The bytes left.
/// </summary>
public int BytesLeft;

/// <summary>
/// Initializes a new instance of the <see cref="BigDataBuffer" /> struct.
/// Initializes a new instance of the <see cref="Buffer" /> struct.
/// </summary>
/// <param name="data"> The data. </param>
/// <param name="bytesLeft"> The bytes left. </param>
/// <param name="data"> The data. </param>
/// <param name="bytesLeft"> The bytes left. </param>
public Buffer(byte[] data, int bytesLeft)
{
Data = data;
Expand Down
2 changes: 1 addition & 1 deletion network.wiki

0 comments on commit 29c3827

Please sign in to comment.