mirror of
https://github.com/SoDOff-Project/sodoff-mmo.git
synced 2025-10-11 08:18:49 -07:00
player count management command
This commit is contained in:
parent
86314a84ee
commit
98fa2742f4
16
src/Management/Commands/PlayerCount.cs
Normal file
16
src/Management/Commands/PlayerCount.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using sodoffmmo.Attributes;
|
||||||
|
using sodoffmmo.Core;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace sodoffmmo.Management.Commands;
|
||||||
|
|
||||||
|
[ManagementCommand("playercount", Role.Admin)]
|
||||||
|
class PlayerCount : IManagementCommand {
|
||||||
|
public void Handle(Client client, string[] arguments) {
|
||||||
|
client.Send(Utils.BuildServerSideMessage($"Current room: {(client.Room?.ClientsCount.ToString() ?? "not in room")}, Server total: {Room.AllRooms().Sum(x => x.ClientsCount)}", "Server"));
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user