Implement `JL` - Join Limbo (#2)

This commit is contained in:
Alan Moon 2024-07-10 02:15:28 -07:00 committed by Robert Paciorek
parent 7321b95821
commit eb4fc7df40
2 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,24 @@
using sodoffmmo.Attributes;
using sodoffmmo.Core;
using sodoffmmo.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace sodoffmmo.CommandHandlers
{
[ExtensionCommandHandler("JL")]
public class JoinLimboHandler : CommandHandler
{
public override Task Handle(Client client, NetworkObject receivedObject)
{
// set client room to limbo
Room limbo = Room.GetOrAdd("LIMBO");
if (limbo != null) client.SetRoom(limbo);
return Task.CompletedTask;
}
}
}

View File

@ -69,7 +69,7 @@ public class Client {
Room.AddClient(this);
Send(Room.SubscribeRoom());
UpdatePlayerUserVariables();
if (Room.Name != "LIMBO") UpdatePlayerUserVariables(); // do not update user vars if room is limbo
}
}
}