forked from SoDOff-Project/sodoff-mmo
Implement `JL
` - Join Limbo (#2)
This commit is contained in:
parent
7321b95821
commit
eb4fc7df40
24
src/CommandHandlers/JoinLimboHandler.cs
Normal file
24
src/CommandHandlers/JoinLimboHandler.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -69,7 +69,7 @@ public class Client {
|
|||||||
Room.AddClient(this);
|
Room.AddClient(this);
|
||||||
|
|
||||||
Send(Room.SubscribeRoom());
|
Send(Room.SubscribeRoom());
|
||||||
UpdatePlayerUserVariables();
|
if (Room.Name != "LIMBO") UpdatePlayerUserVariables(); // do not update user vars if room is limbo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user