1234567891011121314151617181920212223242526272829303132333435 |
- using ET;
- namespace GFGGame
- {
- public class G2C_UpdateQueueHandler : AMHandler<G2C_UpdateQueue>
- {
- protected override async ETTask Run(Session session, G2C_UpdateQueue message)
- {
- Log.Debug(JsonHelper.ToJson(message));
- AlertSystem.Show($"您前面还有{message.Index}人", "当前人数爆满,正在为您排队")
- .SetLeftButton(true, "取消", (obj) => {
- QueueSProxy.ReqSevenCancelQueue().Coroutine();
- });
- EventAgent.DispatchEvent(ConstMessage.UPDATE_QUEUE);
- await ETTask.CompletedTask;
- }
- }
- public static class QueueSProxy
- {
- /// <summary>
- /// 请求服务端取消排队
- /// </summary>
- /// <returns></returns>
- public static async ETTask ReqSevenCancelQueue()
- {
- var response = (G2C_CancelQueue)await MessageHelper.SendToServer(new C2G_CancelQueue());
- if(response.Error == ErrorCode.ERR_Success)
- {
- ViewManager.Hide<ModalStatusView>();
- }
- }
- }
- }
|