egametang/ET · error · Exception

not found response type, request type: {request.FullName}

Error message

not found response type, request type: {request.FullName}

What it means

OpcodeType.GetResponseType maps a request type to its response type via the requestResponse dictionary built from [ResponseType] attributes. It throws when a request has no recorded response type, meaning the attribute is missing or the named response type was not generated/loaded.

Source

Thrown at Packages/cn.etetet.core/Scripts/Core/Share/Network/OpcodeType.cs:83

            }
            return opcode;
        }

        public Type GetType(ushort opcode)
        {
            Type type = this.typeOpcode.GetKeyByValue(opcode);
            if (type == null)
            {
                throw new Exception($"OpcodeType not found type: {opcode}");
            }
            return type;
        }

        public Type GetResponseType(Type request)
        {
            if (!this.requestResponse.TryGetValue(request, out Type response))
            {
                throw new Exception($"not found response type, request type: {request.FullName}");
            }

            return response;
        }
    }
}

View on GitHub (pinned to 5cab01f7a8)

Solutions

  1. Add [ResponseType(nameof(XxxResponse))] to the request message.
  2. Regenerate protocol files so the response type and attribute are emitted.
  3. Ensure the response type exists in a scanned assembly.

Example fix

// before
[Message(...)] public class XxxRequest { ... } // no response
// after
[ResponseType(nameof(XxxResponse))]
[Message(...)] public class XxxRequest { ... }
Defensive patterns

Strategy: validation

Validate before calling

var respAttr = request.GetCustomAttribute<ResponseTypeAttribute>();
if (respAttr == null) throw new InvalidOperationException($"{request} missing [ResponseType]");
Type resp = OpcodeType.Instance.GetResponseType(request);

Type guard

public bool HasResponseType(Type req) => requestResponse.ContainsKey(req);

Try / catch

null

Prevention

When it happens

Trigger: Calling an RPC whose request class lacks [ResponseType("XxxResponse")], or where the ET.XxxResponse type referenced by the attribute does not exist.

Common situations: New request added without the ResponseType attribute, response type renamed without updating the attribute, or the response assembly not loaded.

Related errors


AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13). Data as JSON: /api/errors/d1a45cccb398624c. Report an issue: GitHub.