mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
28 lines
757 B
C#
28 lines
757 B
C#
using TEngine.Core.Network;
|
|
|
|
namespace GameLogic
|
|
{
|
|
public class NetworkUtils
|
|
{
|
|
/// <summary>
|
|
/// 网络消息校验错误码。
|
|
/// </summary>
|
|
/// <param name="response">网络回复消息包。</param>
|
|
/// <returns>是否存在错误。</returns>
|
|
public static bool CheckError(IResponse response)
|
|
{
|
|
bool hasError = false;
|
|
if (response == null)
|
|
{
|
|
// TODO 根据错误码Tips提示。
|
|
// var networkError = "NetWork Response Error";
|
|
hasError = true;
|
|
}
|
|
else
|
|
{
|
|
hasError = response.ErrorCode != 0;
|
|
}
|
|
return hasError;
|
|
}
|
|
}
|
|
} |