using ET; namespace GFGGame { public class G2C_UpdateQueueHandler : AMHandler { protected override async ETTask Run(Session session, G2C_UpdateQueue message) { if(message.Index > 1) { AlertSystem.Show($"您前面还有{message.Index}位玩家", "当前服务器爆满,正在为您排队") .SetLeftButton(true, "取消", (obj) => { QueueSProxy.ReqSevenCancelQueue().Coroutine(); }); await ETTask.CompletedTask; } } } public static class QueueSProxy { /// /// 请求服务端取消排队 /// /// public static async ETTask ReqSevenCancelQueue() { var response = (G2C_CancelQueue)await MessageHelper.SendToServer(new C2G_CancelQueue()); if(response.Error == ErrorCode.ERR_Success) { ViewManager.Hide(); GameGlobal.zoneScene.GetComponent().Notify(new ET.WaitType.Wait_SceneChangeStart() { Error = WaitTypeError.Cancel}); GameController.QuitToLoginView(false); } } } }