Added A1_Sender for sending to certain users.

This commit is contained in:
GittyMac
2022-07-14 22:33:53 -04:00
parent 80a80d786f
commit 0116e9dd3c

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using NetCoreServer;
public class A1_Sender {
public void SendToUser(TcpServer sendingServer, string guid, string message){
TcpSession session = sendingServer.FindSession(new Guid(guid));
List<byte[]> d = new List<byte[]>();
Byte[] reply = Encoding.ASCII.GetBytes(message);
byte[] b2 = new byte[] {0x00};
d.Add(reply);
d.Add(b2);
byte[] b3 = d.SelectMany(a => a).ToArray();
Console.WriteLine(message);
session?.Send(b3, 0, b3.Length);
}
}