合理化框架

合理化框架
This commit is contained in:
ALEXTANG
2023-07-16 15:37:38 +08:00
parent c6ecb48944
commit 7ce72b8aa8
12 changed files with 33 additions and 39 deletions

View File

@@ -112,7 +112,7 @@ namespace TEngine.Core.Network
if (networkId != 0 && channelId != 0)
{
NetworkThread.Instance.SynchronizationContext.Post(() =>
NetworkThread.Instance?.SynchronizationContext.Post(() =>
{
NetworkThread.Instance?.RemoveChannel(networkId, channelId);
});

View File

@@ -212,7 +212,7 @@ namespace TEngine.Core.Network
}
}
#endif
public void FailResponse(Session session, IRouteRequest iRouteRequest, int error, uint rpcId)
public void FailResponse(Session session, IRouteRequest iRouteRequest, uint error, uint rpcId)
{
var response = CreateResponse(iRouteRequest, error);
session.Send(response, rpcId);
@@ -223,7 +223,7 @@ namespace TEngine.Core.Network
return new RouteResponse();
}
public IResponse CreateResponse(Type requestType, int error)
public IResponse CreateResponse(Type requestType, uint error)
{
IResponse response;
@@ -240,7 +240,7 @@ namespace TEngine.Core.Network
return response;
}
public IResponse CreateResponse(IRequest iRequest, int error)
public IResponse CreateResponse(IRequest iRequest, uint error)
{
IResponse response;
@@ -257,7 +257,7 @@ namespace TEngine.Core.Network
return response;
}
public IRouteResponse CreateResponse(IRouteRequest iRouteRequest, int error)
public IRouteResponse CreateResponse(IRouteRequest iRouteRequest, uint error)
{
IRouteResponse response;

View File

@@ -12,6 +12,6 @@ namespace TEngine.Core.Network
public interface IResponse : IMessage
{
int ErrorCode { get; set; }
uint ErrorCode { get; set; }
}
}

View File

@@ -12,7 +12,7 @@ namespace TEngine
}
[ProtoMember(90)] public long RpcId { get; set; }
[ProtoMember(91, IsRequired = true)] public int ErrorCode { get; set; }
[ProtoMember(91, IsRequired = true)] public uint ErrorCode { get; set; }
}
[ProtoContract]
@@ -24,7 +24,7 @@ namespace TEngine
}
[ProtoMember(90)] public long RpcId { get; set; }
[ProtoMember(91, IsRequired = true)] public int ErrorCode { get; set; }
[ProtoMember(91, IsRequired = true)] public uint ErrorCode { get; set; }
}
[ProtoContract]
public class PingRequest : AProto, IRequest
@@ -46,7 +46,7 @@ namespace TEngine
}
[ProtoMember(90)] public long RpcId { get; set; }
[ProtoMember(91, IsRequired = true)] public int ErrorCode { get; set; }
[ProtoMember(91, IsRequired = true)] public uint ErrorCode { get; set; }
[ProtoMember(1)] public long Now;
}
/// <summary>
@@ -69,7 +69,7 @@ namespace TEngine
{
public uint OpCode() { return Opcode.AddressableAddResponse; }
[ProtoMember(91, IsRequired = true)]
public int ErrorCode { get; set; }
public uint ErrorCode { get; set; }
}
/// <summary>
/// 查询一个可寻址
@@ -89,7 +89,7 @@ namespace TEngine
{
public uint OpCode() { return Opcode.AddressableGetResponse; }
[ProtoMember(91, IsRequired = true)]
public int ErrorCode { get; set; }
public uint ErrorCode { get; set; }
[ProtoMember(1)]
public long RouteId { get; set; }
}
@@ -111,7 +111,7 @@ namespace TEngine
{
public uint OpCode() { return Opcode.AddressableRemoveResponse; }
[ProtoMember(91, IsRequired = true)]
public int ErrorCode { get; set; }
public uint ErrorCode { get; set; }
}
/// <summary>
/// 锁定一个可寻址
@@ -131,7 +131,7 @@ namespace TEngine
{
public uint OpCode() { return Opcode.AddressableLockResponse; }
[ProtoMember(91, IsRequired = true)]
public int ErrorCode { get; set; }
public uint ErrorCode { get; set; }
}
/// <summary>
/// 解锁一个可寻址
@@ -155,6 +155,6 @@ namespace TEngine
{
public uint OpCode() { return Opcode.AddressableUnLockResponse; }
[ProtoMember(91, IsRequired = true)]
public int ErrorCode { get; set; }
public uint ErrorCode { get; set; }
}
}