interface INetworkService {
    moveSyncInterval: number;
    generateMessageId(): string;
    off<T>(event: T, listener: INetworkServiceEvents[T]): EventHandler;
    on<T>(event: T, listener: INetworkServiceEvents[T]): EventHandle;
    sendMessage<T>(data: T, options?: {
        batch?: boolean;
        entityId?: string;
        messageId?: string;
    }): string;
}

Hierarchy

  • IBotService
    • INetworkService

Implemented by

Properties

moveSyncInterval: number

Synchronization frequency of player's movement. Default value is 150ms, the configurable range is 30ms to 150ms.

Methods

  • Send custom message.

    Type Parameters

    • T = Record<string, unknown>

    Parameters

    • data: T
    • Optionaloptions: {
          batch?: boolean;
          entityId?: string;
          messageId?: string;
      }

      Other options.

      • Optionalbatch?: boolean

        Batch processing of messages: If set to true, the messages will be cached and sent together later.

      • OptionalentityId?: string

        Entity GUID: Specifies the entity that can receive the message through the receive:message event.

      • OptionalmessageId?: string

        Message ID: Used to override messages with the same ID that have not been sent yet.

    Returns string

    • Message ID.