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

@ -8,11 +8,11 @@ namespace SharpChat.C2SPacketHandlers {
private readonly TimeSpan BumpInterval = TimeSpan.FromMinutes(1);
private DateTimeOffset LastBump = DateTimeOffset.MinValue;
public bool IsMatch(ChatPacketHandlerContext ctx) {
public bool IsMatch(C2SPacketHandlerContext ctx) {
return ctx.CheckPacketId("0");
}
public void Handle(ChatPacketHandlerContext ctx) {
public void Handle(C2SPacketHandlerContext ctx) {
string[] parts = ctx.SplitText(2);
if(!int.TryParse(parts.FirstOrDefault(), out int pTime))
@ -25,7 +25,7 @@ namespace SharpChat.C2SPacketHandlers {
try {
if(LastBump < DateTimeOffset.UtcNow - BumpInterval) {
(string, string)[] bumpList = [.. ctx.Chat.Users
.Where(u => u.Status == ChatUserStatus.Online && ctx.Chat.Connections.Any(c => c.User == u))
.Where(u => u.Status == UserStatus.Online && ctx.Chat.Connections.Any(c => c.User == u))
.Select(u => (u.UserId.ToString(), ctx.Chat.GetRemoteAddresses(u).FirstOrDefault()?.ToString() ?? string.Empty))];
if(bumpList.Length > 0)