这里做处理?
public object GetInstance(ushort opcode)
{
#if SERVER
Type type = this.GetType(opcode);
if (type == null)
{
// 服务端因为有人探测端口,有可能会走到这一步,如果找不到opcode,抛异常
throw new Exception($"not found opcode: {opcode}");
}
return Activator.CreateInstance(type);
#else
return this.typeMessages[opcode];
#endif
}
外层应该会捕获到异常的,断开Session,做一些黑名单啥的?