Skip to content

Commit

Permalink
Minor source improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Joy-less committed Mar 30, 2024
1 parent b802677 commit 8c60ffc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
10 changes: 2 additions & 8 deletions TCPMaid/Messages/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,9 @@ public abstract class Request : Message {
/// <summary>
/// The base class for messages that respond to a request. Should not be reused.
/// </summary>
public abstract class Response : Message {
public abstract class Response(ulong RequestID) : Message {
/// <summary>
/// The ID of the request this is a response to.
/// </summary>
public readonly ulong RequestID;
/// <summary>
/// Creates a new response for the given request ID.
/// </summary>
public Response(ulong RequestID) {
this.RequestID = RequestID;
}
public ulong RequestID = RequestID;
}
4 changes: 2 additions & 2 deletions TCPMaid/Miscellaneous/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ private async Task ListenAsync() {
OnReceiveFragment?.Invoke(MessageID, PendingMessage.CurrentBytes.Length, PendingMessage.TotalMessageLength);

// Ensure message is complete
if (PendingMessage.IsIncomplete) {
if (PendingMessage.Incomplete) {
// Ask for next fragment
_ = SendAsync(new NextFragmentMessage(MessageID));
break;
Expand Down Expand Up @@ -333,6 +333,6 @@ public PendingMessage(int total_message_length, byte[] initial_bytes) {
TotalMessageLength = total_message_length;
CurrentBytes = initial_bytes;
}
public bool IsIncomplete => CurrentBytes.Length < TotalMessageLength;
public bool Incomplete => CurrentBytes.Length < TotalMessageLength;
}
}
2 changes: 1 addition & 1 deletion TCPMaid/TCPMaid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>TCPMaid</Title>
<FileVersion></FileVersion>
<Version>2.2.1</Version>
<Version>2.3.0</Version>
<Authors>Joyless</Authors>
<PackageTags>TCP; Server; Client; Netcode; Networking; Multiplayer; SSL; TLS</PackageTags>
<Description>An easy, powerful and lightweight TCP client/server in C#.</Description>
Expand Down

0 comments on commit 8c60ffc

Please sign in to comment.