summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/PTC/Process/Process_RpcC2M_CreateRoleNew.cs
blob: 3f011702e6a3fce0b97ba72cdcda42b9ddf2b4a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Reflection;
using KKSG;
using XMainClient.UI;
using XUtliPoolLib;

namespace XMainClient
{
	internal class Process_RpcC2M_CreateRoleNew
	{
		public static void OnReply(CreateRoleNewArg oArg, CreateRoleNewRes oRes)
		{
			bool flag = oRes == null;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowErrorCode(ErrorCode.ERR_FAILED);
			}
			else
			{
				bool flag2 = oRes.result == ErrorCode.ERR_INVALID_REQUEST;
				if (flag2)
				{
					string fullName = MethodBase.GetCurrentMethod().ReflectedType.FullName;
					XSingleton<UiUtility>.singleton.OnGetInvalidRequest(fullName);
				}
				else
				{
					XSingleton<XLoginDocument>.singleton.SetBlockUIVisable(false);
					ErrorCode result = oRes.result;
					if (result <= ErrorCode.ERR_INVALID_NAME)
					{
						if (result == ErrorCode.ERR_SUCCESS)
						{
							RpcC2M_SelectRoleNew rpcC2M_SelectRoleNew = new RpcC2M_SelectRoleNew();
							rpcC2M_SelectRoleNew.oArg.index = (int)(oArg.type) % 10 - (int)RoleType.Role_Warrior;
							XSingleton<XClientNetwork>.singleton.Send(rpcC2M_SelectRoleNew);
							return;
						}
						if (result - ErrorCode.ERR_NAME_EXIST > 1)
						{
							goto IL_D3;
						}
					}
					else if (result != ErrorCode.ERR_WORD_FORBID && result - ErrorCode.ERR_NAME_ALLNUM > 2)
					{
						goto IL_D3;
					}
					XSingleton<UiUtility>.singleton.ShowSystemTip(oRes.result, "fece00");
					return;
					IL_D3:
					XSingleton<XClientNetwork>.singleton.OnServerErrorNotify((uint)oRes.result, null);
				}
			}
		}

		public static void OnTimeout(CreateRoleNewArg oArg)
		{
		}
	}
}