mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
17
Assets/GameScripts/DotNet/Hotfix/Server/Demo/HttpHelper.cs
Normal file
17
Assets/GameScripts/DotNet/Hotfix/Server/Demo/HttpHelper.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
namespace ET.Server
|
||||
{
|
||||
public static partial class HttpHelper
|
||||
{
|
||||
public static void Response(HttpListenerContext context, object response)
|
||||
{
|
||||
byte[] bytes = MongoHelper.ToJson(response).ToUtf8();
|
||||
context.Response.StatusCode = 200;
|
||||
context.Response.ContentEncoding = Encoding.UTF8;
|
||||
context.Response.ContentLength64 = bytes.Length;
|
||||
context.Response.OutputStream.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user