mirror of
https://gitee.com/cssfw/EasyTools.git
synced 2026-03-28 12:01:36 +08:00
default
This commit is contained in:
31
Utils/Util.cs
Normal file
31
Utils/Util.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user