跳转到正文

protocol API ​

完整接口目录 · 协议包用法 · 工具包下载

模块说明 ​

text
Versioned typed protocol models; encode and send through ``ctx.packets.typed``.

packets ​

python
packets = models

PROTOCOL_VERSION ​

python
PROTOCOL_VERSION = models.SCHEMA['protocol_version']

SCHEMA_ID ​

python
SCHEMA_ID = models.SCHEMA['schema_hash']

PACKET_TYPES ​

python
PACKET_TYPES = dict(models.REGISTRY.packets)

packet_class ​

python
def packet_class(packet_id)

SDK 说明:

text
Return a registered model class; unknown packet IDs raise KeyError.

包入口再导出 ​

以下名称可直接从该包导入;点开名称查看定义、参数和类型字段。

  • models:neomega_runtime.protocol.models。
  • Packet:neomega_runtime.protocol.runtime.Packet。
  • Struct:neomega_runtime.protocol.runtime.Struct。
  • OptionalValue:neomega_runtime.protocol.runtime.OptionalValue。
  • UnionValue:neomega_runtime.protocol.runtime.UnionValue。
  • DynamicValue:neomega_runtime.protocol.runtime.DynamicValue。
  • FloatBits:neomega_runtime.protocol.runtime.FloatBits。
  • PointerValue:neomega_runtime.protocol.runtime.PointerValue。
  • StringBytes:neomega_runtime.protocol.runtime.StringBytes。
  • Timestamp:neomega_runtime.protocol.runtime.Timestamp。
  • packet_from_envelope:neomega_runtime.protocol.values.packet_from_envelope。

Neomega · 使用、开发与参考文档