This commit is contained in:
3cxc
2025-12-25 18:21:46 +08:00
parent 990bd00aba
commit 9ab2bd7c86
16 changed files with 1060 additions and 0 deletions

31
Utils/Util.cs Normal file
View File

@@ -0,0 +1,31 @@
using EasyTools.Events;
using LabApi.Features.Wrappers;
using MEC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EasyTools.Utils
{
public class Util
{
public static IEnumerator<float> AutoServerBroadcast()
{
while (true)
{
if (Round.IsRoundEnded || !Round.IsRoundStarted)
{
yield break;
}
//随机公告
int tmp = new Random().Next(0, CustomEventHandler.Config.AutoServerMessageText.Count - 1);
Server.SendBroadcast(CustomEventHandler.Config.AutoServerMessageText[tmp], CustomEventHandler.Config.AutoServerMessageTimer, global::Broadcast.BroadcastFlags.Normal);
yield return Timing.WaitForSeconds(CustomEventHandler.Config.AutoServerMessageTime * 60f);
}
}
}
}