mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
合理化框架
合理化框架
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -12,6 +12,6 @@ namespace TEngine.Core.Network
|
||||
|
||||
public interface IResponse : IMessage
|
||||
{
|
||||
int ErrorCode { get; set; }
|
||||
uint ErrorCode { get; set; }
|
||||
}
|
||||
}
|
@@ -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; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user