注册登录Demo

注册登录Demo
This commit is contained in:
ALEXTANG
2023-07-16 00:57:20 +08:00
parent c178f8bb75
commit c6ecb48944
17 changed files with 350 additions and 22 deletions

View File

@@ -1,4 +1,7 @@
using TEngine.Core.Network;
using System.Collections.Generic;
using TEngine;
using TEngine.Core.Network;
using TEngine.Logic;
namespace GameLogic
{
@@ -21,8 +24,27 @@ namespace GameLogic
else
{
hasError = response.ErrorCode != 0;
if (ErrCodeTextMap.TryGetValue(response.ErrorCode,out var ret))
{
Log.Error(ret);
}
}
return hasError;
}
//Remark 这里图方便注册错误码文本,正常应该走文本配置表。
public static Dictionary<int, string> ErrCodeTextMap = new Dictionary<int, string>
{
{
ErrorCode.ERR_AccountAlreadyRegisted, "账户已经被注册了"
},
{
ErrorCode.ERR_AccountOrPasswordError, "账户或者密码错误"
},
{
ErrorCode.ERR_UserNotOnline, "用户当前不在线"
},
};
}
}