123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using Studio.Scripts.HttpMessage;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using XRTool.Util;
- /********************************************************************************
- ** Company: YC
- ** auth: CaoTing
- ** date: 2021\5
- ** desc: 分发事件
- *******************************************************************************/
- namespace Studio.Scripts
- {
- public class HTTPDistribute : Singleton<HTTPDistribute>
- {
- public void Distribute(BaseHttpCallBackMessage httpMesage)
- {
- switch (httpMesage.MessageType)
- {
- case MessageType.None:
- break;
- case MessageType.SNLoginType:
- LoginProxy.Instance.SNLoginHandler(httpMesage as SnLoginCallBackMessage);
- break;
- case MessageType.PhoneLoginType:
- LoginProxy.Instance.PhoneLoginHandler(httpMesage as PhoneLoginCallBackMessage);
- break;
- case MessageType.AccountLoginType:
- LoginProxy.Instance.AccountLoginHandler(httpMesage as AccountLoginCallBackMessage);
- break;
- case MessageType.AdvanceAccountLoginType:
- LoginProxy.Instance.AdvanceAccountHandler(httpMesage as AdvanceAccountCallBackMessage);
- break;
- case MessageType.LogoutType:
- LoginProxy.Instance.LogOutHandler(httpMesage as LogOutCallBackMessage);
- break;
- case MessageType.CaptchaCodeType:
- LoginProxy.Instance.CaptchaCodeHandler(httpMesage as CapthcaCodeCallBackMessage);
- break;
- case MessageType.SmsCodeType:
- LoginProxy.Instance.PhoneCodeHandler(httpMesage as SMSCodeCallBackMessage);
- break;
- case MessageType.GetAvatarType:
- LoginProxy.Instance.GetUserAvatarListHandler(httpMesage as GetAvatarListCallBackMessage);
- break;
- case MessageType.ModifyRoleType:
- LoginProxy.Instance.ModifyRoleHandler(httpMesage as ModifyRoleCallBackMessage);
- break;
- case MessageType.CreaterRoomType:
- HomeProxy.Instance.CreateRoomHandler(httpMesage as CreateRoomCallBackMessage);
- break;
- case MessageType.DeleteRoomType:
- HomeProxy.Instance.DeleteRoomHandler(httpMesage as DeleteRoomCallBackMessage);
- break;
- case MessageType.GetFileAddressType:
- HomeProxy.Instance.GetFileAddressHandler(httpMesage as FileAddressCallBackMessage);
- break;
- case MessageType.GetAllArtType:
- HomeProxy.Instance.GetArtListHandler(httpMesage as GetArtListCallBackMessage);
- break;
- case MessageType.GetDetailArtType:
- HomeProxy.Instance.GetArtDetailHandler(httpMesage as GetArtDetailCallBackMessage);
- break;
- case MessageType.GetMySetType:
- HomeProxy.Instance.GetSettingsHandler(httpMesage as GetSettingsCallBackMessage);
- break;
- case MessageType.UpdateSetType:
- HomeProxy.Instance.UpdateSettingsHandler(httpMesage as UpdateSettingsCallBackMessage);
- break;
- case MessageType.SearchArtList:
- HomeProxy.Instance.SearchArtListHandler(httpMesage as SearchArtListCallBackMessage);
- break;
- default:
- break;
- }
- }
- public void DistributeError(BaseHttpCallBackMessage httpMesage)
- {
- if (httpMesage.code == 5004 || httpMesage.code == 5016)// 账号已在别处登录
- {
- CommonMethod.ShowLoginAbnormalOutPop();
- }
- switch (httpMesage.messageModuleType)
- {
- case MessageModuleType.None:
- break;
- case MessageModuleType.Common:
- case MessageModuleType.Login:
- //登录账号或者密码错误会返回登录次数
- if (httpMesage.MessageType == MessageType.AccountLoginType || httpMesage.MessageType == MessageType.PhoneLoginType)
- {
- LoginProxy.Instance.LoginErrorHandler(httpMesage.MessageType, httpMesage.code, httpMesage.message, httpMesage);
- }
- else
- {
- LoginProxy.Instance.LoginErrorHandler(httpMesage.MessageType, httpMesage.code, httpMesage.message);
- }
- break;
- case MessageModuleType.Room:
- if (httpMesage.MessageType == MessageType.SearchArtList)
- {
- HomeProxy.Instance.HomeErrorHandler(httpMesage.MessageType, httpMesage.code, httpMesage.message);
- }
- break;
- case MessageModuleType.Set:
- break;
- default:
- break;
- }
- }
- }
- }
|