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 { 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; } } } }