implement `JU`

This commit is contained in:
Alan Moon 2025-03-18 16:11:57 -07:00
parent fd9c7b817c
commit b57bd2679f

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using sodoffmmo.Attributes;
using sodoffmmo.Core;
using sodoffmmo.Data;
namespace sodoffmmo.CommandHandlers
{
[ExtensionCommandHandler("JU")]
public class JoinUserHandler : CommandHandler
{
public override Task Handle(Client client, NetworkObject receivedObject)
{
string mpId = receivedObject.Get<NetworkObject>("p").Get<string>("0");
if (mpId != null)
{
Room? room = Room.AllRooms().FirstOrDefault(e => e.Id == Int32.Parse(mpId));
if (room != null)
{
client.SetRoom(room);
}
}
return Task.CompletedTask;
}
}
}