mirror-ac/service/Message.cs

34 lines
768 B
C#
Raw Normal View History

2023-09-02 15:47:15 +02:00
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO.Pipes;
using service;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace service
{
public class Message
{
private byte[] _buffer;
private int _bufferSize;
2023-09-02 17:56:46 +02:00
public Message(byte[] buffer, int bufferSize)
2023-09-02 15:47:15 +02:00
{
2023-09-02 17:56:46 +02:00
_bufferSize = bufferSize;
_buffer = buffer;
2023-09-02 15:47:15 +02:00
}
public void SendMessageToServer()
{
Client client = new Client(_buffer, _bufferSize);
client.SendMessageToServer();
}
public T GetPacketHeader<T>(ref byte[] buffer)
{
2023-09-02 18:55:40 +02:00
return Helper.BytesToStructure<T>(ref buffer, 0);
2023-09-02 15:47:15 +02:00
}
}
}