Name adjustments and moved some things to the common lib.

This commit is contained in:
flash 2025-04-26 12:51:08 +00:00
commit 0cc5d46ea9
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E
50 changed files with 323 additions and 323 deletions

View file

@ -0,0 +1,19 @@
namespace SharpChat {
public class C2SPacketHandlerContext(
string text,
Context chat,
Connection connection
) {
public string Text { get; } = text ?? throw new ArgumentNullException(nameof(text));
public Context Chat { get; } = chat ?? throw new ArgumentNullException(nameof(chat));
public Connection Connection { get; } = connection ?? throw new ArgumentNullException(nameof(connection));
public bool CheckPacketId(string packetId) {
return Text == packetId || Text.StartsWith(packetId + '\t');
}
public string[] SplitText(int expect) {
return Text.Split('\t', expect + 1);
}
}
}