Skip to content

Commit

Permalink
Add /status cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ade committed Jan 22, 2022
1 parent 0049049 commit 8b53b33
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions CelesteNet.Server.ChatModule/CMDs/ChatCMDStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Celeste.Mod.CelesteNet.DataTypes;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Celeste.Mod.CelesteNet.Server.Chat {
public class ChatCMDStatus : ChatCMD {

public override string Args => "<text>";

public override string Info => "Set the server status, shown as the spinning cogwheel for everyone.";

public override bool MustAuth => true;

public override void Run(ChatCMDEnv env, List<ChatCMDArg> args) {
if (args.Count == 0)
throw new Exception("No text.");

env.Server.BroadcastAsync(new DataServerStatus {
Text = args[0].Rest
});
}

}
}

0 comments on commit 8b53b33

Please sign in to comment.