mirror of
https://github.com/GittyMac/A1Emu.git
synced 2026-08-28 12:04:09 -05:00
Added A1_Sender for sending to certain users.
This commit is contained in:
23
A1Emu/A1_Utils/A1_Sender.cs
Normal file
23
A1Emu/A1_Utils/A1_Sender.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user