embed plugin loader directly into the launcher

This commit is contained in:
zznty
2022-10-29 01:50:14 +07:00
parent 7204815c0c
commit 66d3dc2ead
53 changed files with 5689 additions and 10 deletions

View File

@@ -0,0 +1,25 @@
using System.Net;
namespace PluginLoader.Tools;
public class PostHttpContent : HttpContent
{
private readonly byte[] content;
public PostHttpContent(string content)
{
this.content = content == null ? null : Tools.Utf8.GetBytes(content);
}
protected override async Task SerializeToStreamAsync(Stream stream, TransportContext context)
{
if (content != null && content.Length > 0)
await stream.WriteAsync(content, 0, content.Length);
}
protected override bool TryComputeLength(out long length)
{
length = content.Length;
return true;
}
}