| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using ET;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace GFGGame
- {
- public static class AccountSProxy
- {
- public static async ETTask<bool> ReqDeleteAccount(string name, string identityNum)
- {
- A2C_ReqDeleteAccount response = null;
- bool notLogin = false;
- Session accountSession = GameGlobal.zoneScene.GetComponent<SessionComponent>().AccountSession;
- if (accountSession == null || accountSession.IsDisposed)
- {
- notLogin = true;
- accountSession = GameGlobal.zoneScene.GetComponent<NetWSComponent>()
- .Create(null, GameConfig.LoginAddress);
- }
- try
- {
- AccountInfoComponent accountInfoComponent = GameGlobal.zoneScene.GetComponent<AccountInfoComponent>();
- response = (A2C_ReqDeleteAccount)await accountSession?.Call(new C2A_ReqDeleteAccount()
- {
- Account = accountInfoComponent.Account,
- Name = name,
- IdentityNum = identityNum,
- PlatformId = LauncherConfig.platformId,
- ChannelId = LauncherConfig.ChannelId
- });
- }
- catch (Exception e)
- {
- Log.Debug(e.ToString());
- ErrorCodeController.Handler(ErrorCode.ERR_NetWorkError);
- if (notLogin)
- {
- accountSession?.Dispose();
- }
- return false;
- }
- if (response.Error != ErrorCode.ERR_Success)
- {
- ErrorCodeController.Handler(response.Error);
- if (notLogin)
- {
- accountSession?.Dispose();
- }
- return false;
- }
- if (notLogin)
- {
- accountSession?.Dispose();
- }
- return true;
- }
- }
- }
|