Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ProtocolManager

커넥터에서 사용할 프로토콜을 관리

프로토버프를 지원하며 서버와 주고받는 모든 프로토콜은 미리 등록 필요

Hierarchy

  • ProtocolManager

Index

Methods

Static GetMessageName

  • GetMessageName(target: Packet): string
  • 패킷에 저장된 메세지의 이름을 반환

    등록하지 않은 메세지인 경우 빈 문자열을 반환

    Parameters

    • target: Packet

      메세지가 저장된 패킷

    Returns string

    메세지의 이름

Static GetProtocolId

  • GetProtocolId<T>(msg: IMessage | {}): number
  • 메세지의 프로토콜 아이디를 반환

    Type parameters

    • T: IMessage

    Parameters

    • msg: IMessage | {}

      확인하고자 하는 메세지

    Returns number

Static IsProtocol

  • IsProtocol(msg: IMessage, target: Packet): boolean
  • 입력받은 메세지가 패킷에에 저장된 메세지와 같은 종류인지 비교

    Parameters

    • msg: IMessage

      비교할 메세지

    • target: Packet

      비교할 패킷

    Returns boolean

    같은 경우 true, 아닐경우 false

Static RegisterProtocol

  • RegisterProtocol(protocolId: number, protocol: any): void
  • 사용할 프로토콜을 등록

    Parameters

    • protocolId: number

      등록할 프로토콜의 아이디. 서버와 같은 값을 사용 ( protocolId >= 0 && protocolId <= 510 )

    • protocol: any

      등록할 프로토콜. 개별 메세지가 아닌 모든 메세지를 가진 상위 객체를 등록

    Returns void

Static UnregisterProtocol

  • UnregisterProtocol(protocolId: number): void
  • 등록한 프로토콜을 등록 해제

    Parameters

    • protocolId: number

      등록 해제할 프로토콜의 아이디

    Returns void

Generated using TypeDoc